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/ufs/lfs/lfs_alloc.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/ufs/lfs/lfs_alloc.c')
-rw-r--r-- | sys/ufs/lfs/lfs_alloc.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/sys/ufs/lfs/lfs_alloc.c b/sys/ufs/lfs/lfs_alloc.c index 797d0ba..a3f979d 100644 --- a/sys/ufs/lfs/lfs_alloc.c +++ b/sys/ufs/lfs/lfs_alloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_alloc.c 8.7 (Berkeley) 5/14/95 - * $Id: lfs_alloc.c,v 1.16 1997/10/14 14:22:29 phk Exp $ + * $Id: lfs_alloc.c,v 1.17 1997/10/14 18:46:43 phk Exp $ */ #include "opt_quota.h" @@ -60,13 +60,11 @@ extern u_long nextgennumber; /* Allocate a new inode. */ /* ARGSUSED */ int -lfs_valloc(ap) - struct vop_valloc_args /* { - struct vnode *a_pvp; - int a_mode; - struct ucred *a_cred; - struct vnode **a_vpp; - } */ *ap; +lfs_valloc(pvp, mode, cred, vpp) + struct vnode *pvp; + int mode; + struct ucred *cred; + struct vnode **vpp; { struct lfs *fs; struct buf *bp; @@ -79,7 +77,7 @@ lfs_valloc(ap) int error; /* Get the head of the freelist. */ - fs = VTOI(ap->a_pvp)->i_lfs; + fs = VTOI(pvp)->i_lfs; new_ino = fs->lfs_free; #ifdef ALLOCPRINT printf("lfs_ialloc: allocate inode %d\n", new_ino); @@ -120,7 +118,7 @@ lfs_valloc(ap) } /* Create a vnode to associate with the inode. */ - if (error = lfs_vcreate(ap->a_pvp->v_mount, new_ino, &vp)) + if (error = lfs_vcreate(pvp->v_mount, new_ino, &vp)) return (error); @@ -139,11 +137,11 @@ lfs_valloc(ap) if (error = ufs_vinit(vp->v_mount, lfs_specop_p, LFS_FIFOOPS, &vp)) { vput(vp); - *ap->a_vpp = NULL; + *vpp = NULL; return (error); } - *ap->a_vpp = vp; + *vpp = vp; vp->v_flag |= VDIROP; VREF(ip->i_devvp); @@ -206,12 +204,10 @@ lfs_vcreate(mp, ino, vpp) /* Free an inode. */ /* ARGUSED */ int -lfs_vfree(ap) - struct vop_vfree_args /* { - struct vnode *a_pvp; - ino_t a_ino; - int a_mode; - } */ *ap; +lfs_vfree(pvp, ino, mode) + struct vnode *pvp; + ino_t ino; + int mode; { SEGUSE *sup; struct buf *bp; @@ -222,7 +218,7 @@ lfs_vfree(ap) ino_t ino; /* Get the inode number and file system. */ - ip = VTOI(ap->a_pvp); + ip = VTOI(pvp); fs = ip->i_lfs; ino = ip->i_number; if (ip->i_flag & IN_MODIFIED) { |