Clean up obsolete FS support routines
Change-Id: I56d0ab51f32064bb964051732de7e2465dc22b75
This commit is contained in:
parent
c2f99d7c3a
commit
ef9dc93f44
6 changed files with 1 additions and 95 deletions
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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]);
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in a new issue