diff options
author | phk <phk@FreeBSD.org> | 2005-02-08 21:03:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-02-08 21:03:52 +0000 |
commit | e64e9f38d4432ab314933f6b9faf86fa3c0c778f (patch) | |
tree | 4c98592ea35af7b7fa3ca78a77988305c82c09d3 /sys | |
parent | 5d77ec547b12517653680cde88f7d33c3e098ff3 (diff) | |
download | FreeBSD-src-e64e9f38d4432ab314933f6b9faf86fa3c0c778f.zip FreeBSD-src-e64e9f38d4432ab314933f6b9faf86fa3c0c778f.tar.gz |
Split the vop_vector for ffs1 and ffs2, this is mostly for the different
EXTATTR support.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_extern.h | 6 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 12 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 41 |
3 files changed, 33 insertions, 26 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 63fc3dd..a836cb8 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -91,8 +91,10 @@ int ffs_vfree(struct vnode *, ino_t, int); vfs_vget_t ffs_vget; vfs_vptofh_t ffs_vptofh; -extern struct vop_vector ffs_vnodeops; -extern struct vop_vector ffs_fifoops; +extern struct vop_vector ffs_vnodeops1; +extern struct vop_vector ffs_fifoops1; +extern struct vop_vector ffs_vnodeops2; +extern struct vop_vector ffs_fifoops2; /* * Soft update function prototypes. diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 6434f62..a7317e3 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1179,6 +1179,7 @@ ffs_vget(mp, ino, flags, vpp) ump = VFSTOUFS(mp); dev = ump->um_dev; + fs = ump->um_fs; /* * We do not lock vnode creation as it is believed to be too @@ -1201,7 +1202,10 @@ ffs_vget(mp, ino, flags, vpp) ip = uma_zalloc(uma_inode, M_WAITOK); /* Allocate a new vnode/inode. */ - error = getnewvnode("ufs", mp, &ffs_vnodeops, &vp); + if (fs->fs_magic == FS_UFS1_MAGIC) + error = getnewvnode("ufs", mp, &ffs_vnodeops1, &vp); + else + error = getnewvnode("ufs", mp, &ffs_vnodeops2, &vp); if (error) { *vpp = NULL; uma_zfree(uma_inode, ip); @@ -1211,7 +1215,6 @@ ffs_vget(mp, ino, flags, vpp) /* * FFS supports recursive locking. */ - fs = ump->um_fs; vp->v_vnlock->lk_flags |= LK_CANRECURSE; vp->v_data = ip; vp->v_bufobj.bo_bsize = fs->fs_bsize; @@ -1281,7 +1284,10 @@ ffs_vget(mp, ino, flags, vpp) * Initialize the vnode from the inode, check for aliases. * Note that the underlying vnode may have changed. */ - error = ufs_vinit(mp, &ffs_fifoops, &vp); + if (ip->i_ump->um_fstype == UFS1) + error = ufs_vinit(mp, &ffs_fifoops1, &vp); + else + error = ufs_vinit(mp, &ffs_fifoops2, &vp); if (error) { vput(vp); *vpp = NULL; diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 942a7e2..9b3a440 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -120,7 +120,24 @@ static vop_setextattr_t ffs_setextattr; /* Global vfs data structures for ufs. */ -struct vop_vector ffs_vnodeops = { +struct vop_vector ffs_vnodeops1 = { + .vop_default = &ufs_vnodeops, + .vop_fsync = ffs_fsync, + .vop_getpages = ffs_getpages, + .vop_lock = ffs_lock, + .vop_read = ffs_read, + .vop_reallocblks = ffs_reallocblks, + .vop_write = ffs_write, +}; + +struct vop_vector ffs_fifoops1 = { + .vop_default = &ufs_fifoops, + .vop_fsync = ffs_fsync, + .vop_reallocblks = ffs_reallocblks, /* XXX: really ??? */ +}; + +/* Global vfs data structures for ufs. */ +struct vop_vector ffs_vnodeops2 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, .vop_getpages = ffs_getpages, @@ -136,7 +153,7 @@ struct vop_vector ffs_vnodeops = { .vop_setextattr = ffs_setextattr, }; -struct vop_vector ffs_fifoops = { +struct vop_vector ffs_fifoops2 = { .vop_default = &ufs_fifoops, .vop_fsync = ffs_fsync, .vop_lock = ffs_lock, @@ -160,13 +177,11 @@ ffs_fsync(struct vop_fsync_args *ap) int error; error = ffs_syncvnode(ap->a_vp, ap->a_waitfor); -#ifdef SOFTUPDATES if (error) return (error); if (ap->a_waitfor == MNT_WAIT && (ap->a_vp->v_mount->mnt_flag & MNT_SOFTDEP)) - error = softdep_fsync(ap->a_vp); -#endif + error = softdep_fsync(ap->a_vp); return (error); } @@ -1263,8 +1278,6 @@ struct vop_openextattr_args { ip = VTOI(ap->a_vp); fs = ip->i_fs; - if (fs->fs_magic == FS_UFS1_MAGIC) - return (ufs_vnodeops.vop_openextattr(ap)); if (ap->a_vp->v_type == VCHR) return (EOPNOTSUPP); @@ -1293,8 +1306,6 @@ struct vop_closeextattr_args { ip = VTOI(ap->a_vp); fs = ip->i_fs; - if (fs->fs_magic == FS_UFS1_MAGIC) - return (ufs_vnodeops.vop_closeextattr(ap)); if (ap->a_vp->v_type == VCHR) return (EOPNOTSUPP); @@ -1327,9 +1338,6 @@ vop_deleteextattr { ip = VTOI(ap->a_vp); fs = ip->i_fs; - if (fs->fs_magic == FS_UFS1_MAGIC) - return (ufs_vnodeops.vop_deleteextattr(ap)); - if (ap->a_vp->v_type == VCHR) return (EOPNOTSUPP); @@ -1417,9 +1425,6 @@ vop_getextattr { ip = VTOI(ap->a_vp); fs = ip->i_fs; - if (fs->fs_magic == FS_UFS1_MAGIC) - return (ufs_vnodeops.vop_getextattr(ap)); - if (ap->a_vp->v_type == VCHR) return (EOPNOTSUPP); @@ -1480,9 +1485,6 @@ vop_listextattr { ip = VTOI(ap->a_vp); fs = ip->i_fs; - if (fs->fs_magic == FS_UFS1_MAGIC) - return (ufs_vnodeops.vop_listextattr(ap)); - if (ap->a_vp->v_type == VCHR) return (EOPNOTSUPP); @@ -1553,9 +1555,6 @@ vop_setextattr { ip = VTOI(ap->a_vp); fs = ip->i_fs; - if (fs->fs_magic == FS_UFS1_MAGIC) - return (ufs_vnodeops.vop_setextattr(ap)); - if (ap->a_vp->v_type == VCHR) return (EOPNOTSUPP); |