diff options
author | phk <phk@FreeBSD.org> | 1997-10-16 10:50:27 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1997-10-16 10:50:27 +0000 |
commit | d166441755d9516e482ede0d988b7989be25b10a (patch) | |
tree | ad2fb706565dc877eddf12a6581bfa2467513503 /sys/gnu/fs/ext2fs/ext2_subr.c | |
parent | efcfb5d9cd2ecb3d30ec4c7701bfe737dc1b4606 (diff) | |
download | FreeBSD-src-d166441755d9516e482ede0d988b7989be25b10a.zip FreeBSD-src-d166441755d9516e482ede0d988b7989be25b10a.tar.gz |
VFS mega cleanup commit (x/N)
1. Add new file "sys/kern/vfs_default.c" where default actions for
VOPs go. Implement proper defaults for ABORTOP, BWRITE, LEASE,
POLL, REVOKE and STRATEGY. Various stuff spread over the entire
tree belongs here.
2. Change VOP_BLKATOFF to a normal function in cd9660.
3. Kill VOP_BLKATOFF, VOP_TRUNCATE, VOP_VFREE, VOP_VALLOC. These
are private interface functions between UFS and the underlying
storage manager layer (FFS/LFS/MFS/EXT2FS). The functions now
live in struct ufsmount instead.
4. Remove a kludge of VOP_ functions in all filesystems, that did
nothing but obscure the simplicity and break the expandability.
If a filesystem doesn't implement VOP_FOO, it shouldn't have an
entry for it in its vnops table. The system will try to DTRT
if it is not implemented. There are still some cruft left, but
the bulk of it is done.
5. Fix another VCALL in vfs_cache.c (thanks Bruce!)
Diffstat (limited to 'sys/gnu/fs/ext2fs/ext2_subr.c')
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_subr.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_subr.c b/sys/gnu/fs/ext2fs/ext2_subr.c index 399f973..8083b96 100644 --- a/sys/gnu/fs/ext2fs/ext2_subr.c +++ b/sys/gnu/fs/ext2fs/ext2_subr.c @@ -56,13 +56,11 @@ * remaining space in the directory. */ int -ext2_blkatoff(ap) - struct vop_blkatoff_args /* { - struct vnode *a_vp; - off_t a_offset; - char **a_res; - struct buf **a_bpp; - } */ *ap; +ext2_blkatoff(vp, offset, res, bpp) + struct vnode *vp; + off_t offset; + char **res; + struct buf **bpp; { struct inode *ip; register struct ext2_sb_info *fs; @@ -70,19 +68,19 @@ ext2_blkatoff(ap) daddr_t lbn; int bsize, error; - ip = VTOI(ap->a_vp); + ip = VTOI(vp); fs = ip->i_e2fs; - lbn = lblkno(fs, ap->a_offset); + lbn = lblkno(fs, offset); bsize = blksize(fs, ip, lbn); - *ap->a_bpp = NULL; - if (error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp)) { + *bpp = NULL; + if (error = bread(vp, lbn, bsize, NOCRED, &bp)) { brelse(bp); return (error); } - if (ap->a_res) - *ap->a_res = (char *)bp->b_data + blkoff(fs, ap->a_offset); - *ap->a_bpp = bp; + if (res) + *res = (char *)bp->b_data + blkoff(fs, offset); + *bpp = bp; return (0); } |