]> Zhao Yanbai Git Server - minix.git/commitdiff
Clean up obsolete FS support routines 59/2759/4
authorDavid van Moolenbroek <david@minix3.org>
Sun, 24 Aug 2014 11:53:52 +0000 (11:53 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Thu, 18 Sep 2014 13:01:02 +0000 (13:01 +0000)
Change-Id: I56d0ab51f32064bb964051732de7e2465dc22b75

minix/include/minix/libminixfs.h
minix/include/minix/minlib.h
minix/lib/libc/gen/fslib.c
minix/lib/libminixfs/Makefile
minix/lib/libminixfs/cache.c
minix/lib/libminixfs/fetch_credentials.c [deleted file]

index a0369904b56851ff54bc2cd708ea7fb0be94c60c..20fff415291b895630a4bd32f2e5a1cdf5e14fc3 100644 (file)
@@ -3,9 +3,6 @@
 #ifndef _MINIX_FSLIB_H
 #define _MINIX_FSLIB_H
 
-#include <minix/safecopies.h>
-#include <minix/sef.h>
-#include <minix/vfsif.h>
 #include <minix/fsdriver.h>
 
 struct buf {
@@ -30,9 +27,6 @@ struct buf {
   u64_t lmfs_inode_offset;
 };
 
-int fs_lookup_credentials(vfs_ucred_t *credentials,
-        uid_t *caller_uid, gid_t *caller_gid, cp_grant_id_t grant2, size_t cred_size);
-
 void lmfs_markdirty(struct buf *bp);
 void lmfs_markclean(struct buf *bp);
 int lmfs_isclean(struct buf *bp);
@@ -55,7 +49,6 @@ void lmfs_invalidate(dev_t device);
 void lmfs_put_block(struct buf *bp, int block_type);
 void lmfs_rw_scattered(dev_t, struct buf **, int, int);
 void lmfs_setquiet(int q);
-int lmfs_do_bpeek(message *);
 void lmfs_cache_reevaluate(dev_t dev);
 void lmfs_blockschange(dev_t dev, int delta);
 
@@ -86,4 +79,3 @@ ssize_t lmfs_bio(dev_t dev, struct fsdriver_data *data, size_t bytes,
 void lmfs_bflush(dev_t dev);
 
 #endif /* _MINIX_FSLIB_H */
-
index 1e66eae9944c96066b84415ede3a2263e87e9b43..52059eb5a68942bf73593d0eb54e572eb41c810a 100644 (file)
@@ -13,7 +13,6 @@ int fsversion(char *_dev, char *_prog);
 int getprocessor(void);
 void _cpuid(u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx);
 int load_mtab(char *_prog_name);
-uint8_t fs_mode_to_type(mode_t mode);
 int get_mtab_entry(char dev[PATH_MAX], char mount_point[PATH_MAX],
                        char type[MNTNAMELEN], char flags[MNTFLAGLEN]);
 
index 4e54cae16a39232f136e12bb55d9c8ceeb879e41..58f01e78cdba9babf3fff3d34d8b609c8a5588c6 100644 (file)
@@ -8,7 +8,6 @@
 #include <sys/types.h>
 #include <minix/const.h>
 #include <minix/type.h>                /* for unshort :-( */
-#include <minix/sysutil.h>
 #include <minix/minlib.h>
 #include <minix/ipc.h>
 #include "mfs/const.h"         /* depends of -I flag in Makefile */
@@ -16,7 +15,6 @@
 #include "mfs/inode.h"         /* ditto */
 #include "mfs/super.h"
 #include <minix/fslib.h>
-#include <sys/stat.h>
 
 /* The next routine is copied from fsck.c and mkfs.c...  (Re)define some
  * things for consistency.  Some things should be done better.
@@ -46,20 +44,3 @@ int block_size;
   if (((bit_t) nr_blocks * FS_BITS_PER_BLOCK(block_size)) < nr_bits) ++nr_blocks;
   return(nr_blocks);
 }
-
-uint8_t fs_mode_to_type(mode_t mode)
-{
-       if(S_ISREG(mode)) return DT_REG;
-       else if(S_ISDIR(mode)) return DT_DIR;
-       else if(S_ISLNK(mode)) return DT_LNK;
-       else if(S_ISCHR(mode)) return DT_CHR;
-       else if(S_ISBLK(mode)) return DT_BLK;
-       else if(S_ISFIFO(mode)) return DT_FIFO;
-       else if(S_ISSOCK(mode)) return DT_SOCK;
-
-       assert(0 && "unknown type");
-
-       /* assert()s are removed on NDEBUG builds. */
-       abort();
-}
-
index 5a3578eb2ce69f0cc357ed6a6dbeb41461b1eb2a..0426137c766152d13b98e0851041b63857fd8abe 100644 (file)
@@ -6,6 +6,6 @@ CPPFLAGS+= -D_MINIX_SYSTEM
 .include <bsd.own.mk>
 LIB=           minixfs
 
-SRCS=          fetch_credentials.c cache.c bio.c
+SRCS=          cache.c bio.c
 
 .include <bsd.lib.mk>
index aba2a9bb9d210b682d30d51040020e5eb16bcee0..8c410981ad882999d5d78747caef4f3a9190dfa4 100644 (file)
@@ -931,38 +931,3 @@ int lmfs_rdwt_err(void)
 {
        return rdwt_err;
 }
-
-int lmfs_do_bpeek(message *m)
-{
-       block_t startblock, b, limitblock;
-       dev_t dev = m->m_vfs_fs_breadwrite.device;
-       off_t extra, pos = m->m_vfs_fs_breadwrite.seek_pos;
-       size_t len = m->m_vfs_fs_breadwrite.nbytes;
-       struct buf *bp;
-
-       assert(m->m_type == REQ_BPEEK);
-       assert(fs_block_size > 0);
-       assert(dev != NO_DEV);
-
-       if(!vmcache) { return ENXIO; }
-
-       assert(!(fs_block_size % PAGE_SIZE));
-
-       if((extra=(pos % fs_block_size))) {
-               pos -= extra;
-               len += extra;
-       }
-
-       len = roundup(len, fs_block_size);
-
-       startblock = pos/fs_block_size;
-       limitblock = startblock + len/fs_block_size;
-
-       for(b = startblock; b < limitblock; b++) {
-               bp = lmfs_get_block(dev, b, NORMAL);
-               assert(bp);
-               lmfs_put_block(bp, FULL_DATA_BLOCK);
-       }
-
-       return OK;
-}
diff --git a/minix/lib/libminixfs/fetch_credentials.c b/minix/lib/libminixfs/fetch_credentials.c
deleted file mode 100644 (file)
index 34fb6fd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-
-#include <minix/vfsif.h>
-#include <minix/type.h>
-#include <minix/syslib.h>
-#include <assert.h>
-#include <string.h>
-
-#include "minixfs.h"
-
-int fs_lookup_credentials(vfs_ucred_t *credentials,
-       uid_t *caller_uid, gid_t *caller_gid, cp_grant_id_t grant2, size_t cred_size)
-{
-  int r;
-
-  memset(credentials, 0, sizeof(*credentials));
-
-  r = sys_safecopyfrom(VFS_PROC_NR, grant2, (vir_bytes) 0,
-                       (vir_bytes) credentials, cred_size);
-  if (r != OK) {
-       printf("FS: cred copy failed\n");
-       return(r);
-  }
-
-  assert(credentials->vu_ngroups <= NGROUPS_MAX);
-
-  *caller_uid = credentials->vu_uid;
-  *caller_gid = credentials->vu_gid;
-
-  return OK;
-}
-