forked from billm/pfsense-tools-centipede-slbd
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- stable/8/sys/ufs/ffs/ffs_vfsops.c 2012/01/30 05:45:11 230762 | ||
+++ stable/8/sys/ufs/ffs/ffs_vfsops.c 2012/02/21 10:16:17 231967 | ||
@@ -1321,17 +1321,26 @@ | ||
int softdep_accdeps; | ||
struct bufobj *bo; | ||
|
||
+ wait = 0; | ||
+ suspend = 0; | ||
+ suspended = 0; | ||
td = curthread; | ||
fs = ump->um_fs; | ||
if (fs->fs_fmod != 0 && fs->fs_ronly != 0) | ||
panic("%s: ffs_sync: modification on read-only filesystem", | ||
fs->fs_fsmnt); | ||
/* | ||
+ * For a lazy sync, we just care about the filesystem metadata. | ||
+ */ | ||
+ if (waitfor == MNT_LAZY) { | ||
+ secondary_accwrites = 0; | ||
+ secondary_writes = 0; | ||
+ lockreq = 0; | ||
+ goto metasync; | ||
+ } | ||
+ /* | ||
* Write back each (modified) inode. | ||
*/ | ||
- wait = 0; | ||
- suspend = 0; | ||
- suspended = 0; | ||
lockreq = LK_EXCLUSIVE | LK_NOWAIT; | ||
if (waitfor == MNT_SUSPEND) { | ||
suspend = 1; | ||
@@ -1402,11 +1411,12 @@ | ||
#ifdef QUOTA | ||
qsync(mp); | ||
#endif | ||
+ | ||
+metasync: | ||
devvp = ump->um_devvp; | ||
bo = &devvp->v_bufobj; | ||
BO_LOCK(bo); | ||
- if (waitfor != MNT_LAZY && | ||
- (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0)) { | ||
+ if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) { | ||
BO_UNLOCK(bo); | ||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); | ||
if ((error = VOP_FSYNC(devvp, waitfor, td)) != 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- stable/8/sys/ufs/ufs/ufs_vnops.c 2011/11/07 23:09:18 227325 | ||
+++ stable/8/sys/ufs/ufs/ufs_vnops.c 2012/02/21 10:11:17 231965 | ||
@@ -562,8 +562,9 @@ | ||
DIP_SET(ip, i_flags, ip->i_flags); | ||
} | ||
ip->i_flag |= IN_CHANGE; | ||
+ error = UFS_UPDATE(vp, 0); | ||
if (vap->va_flags & (IMMUTABLE | APPEND)) | ||
- return (0); | ||
+ return (error); | ||
} | ||
if (ip->i_flags & (IMMUTABLE | APPEND)) | ||
return (EPERM); | ||
@@ -729,6 +730,9 @@ | ||
VI_LOCK(vp); | ||
ip->i_flag |= IN_ACCESS; | ||
VI_UNLOCK(vp); | ||
+ /* | ||
+ * XXXKIB No UFS_UPDATE(ap->a_vp, 0) there. | ||
+ */ | ||
return (0); | ||
} | ||
|
||
@@ -785,6 +789,9 @@ | ||
if ((vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0) | ||
error = ufs_update_nfs4_acl_after_mode_change(vp, mode, ip->i_uid, cred, td); | ||
#endif | ||
+ if (error == 0 && (ip->i_flag & IN_CHANGE) != 0) | ||
+ error = UFS_UPDATE(vp, 0); | ||
+ | ||
return (error); | ||
} | ||
|
||
@@ -903,7 +910,8 @@ | ||
DIP_SET(ip, i_mode, ip->i_mode); | ||
} | ||
} | ||
- return (0); | ||
+ error = UFS_UPDATE(vp, 0); | ||
+ return (error); | ||
} | ||
|
||
static int | ||
@@ -2071,6 +2079,7 @@ | ||
dp->i_nlink--; | ||
DIP_SET(dp, i_nlink, dp->i_nlink); | ||
dp->i_flag |= IN_CHANGE; | ||
+ error = UFS_UPDATE(dvp, 0); | ||
ip->i_nlink--; | ||
DIP_SET(ip, i_nlink, ip->i_nlink); | ||
ip->i_flag |= IN_CHANGE; | ||
@@ -2119,6 +2128,7 @@ | ||
ip->i_size = len; | ||
DIP_SET(ip, i_size, len); | ||
ip->i_flag |= IN_CHANGE | IN_UPDATE; | ||
+ error = UFS_UPDATE(vp, 0); | ||
} else | ||
error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, | ||
UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, |