aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/ufs/ffs/ffs_extern.h6
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c12
-rw-r--r--sys/ufs/ffs/ffs_vnops.c41
3 files changed, 33 insertions, 26 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 63fc3dd1bd08..a836cb89768b 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 6434f62f7894..a7317e303bce 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 942a7e2c5fc4..9b3a440133c6 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);