summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>2006-03-11 01:08:37 +0000
committertegge <tegge@FreeBSD.org>2006-03-11 01:08:37 +0000
commit69041c93c00904511474c4edc5cb7b7eb0c4f558 (patch)
treec9982c1b049f435cfe486a86b24a5c35e0589234 /sys/kern/vfs_vnops.c
parentdffb931651deee52af7d1976b0f14baf193bba39 (diff)
downloadFreeBSD-src-69041c93c00904511474c4edc5cb7b7eb0c4f558.zip
FreeBSD-src-69041c93c00904511474c4edc5cb7b7eb0c4f558.tar.gz
Block secondary writes while expunging active unlinked files.
Fix detection of active unlinked files by checking VI_OWEINACT and VI_DOINGINACT in addition to v_usecount. Defer inactive handling for unlinked files if the file system is mostly suspended (secondary writes being blocked). Perform deferred inactive handling after the file system is resumed.
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 79a233d..f598360 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -982,7 +982,7 @@ vn_start_secondary_write(vp, mpp, flags)
if ((mp = *mpp) == NULL)
return (0);
MNT_ILOCK(mp);
- if ((mp->mnt_kern_flag & MNTK_SUSPENDED) == 0) {
+ if ((mp->mnt_kern_flag & (MNTK_SUSPENDED | MNTK_SUSPEND2)) == 0) {
mp->mnt_secondary_writes++;
mp->mnt_secondary_accwrites++;
MNT_IUNLOCK(mp);
@@ -1087,7 +1087,8 @@ vfs_write_resume(mp)
MNT_ILOCK(mp);
if ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) {
- mp->mnt_kern_flag &= ~(MNTK_SUSPEND | MNTK_SUSPENDED);
+ mp->mnt_kern_flag &= ~(MNTK_SUSPEND | MNTK_SUSPEND2 |
+ MNTK_SUSPENDED);
wakeup(&mp->mnt_writeopcount);
wakeup(&mp->mnt_flag);
}
OpenPOWER on IntegriCloud