Page MenuHomeFreeBSD

D56108.diff
No OneTemporary

D56108.diff

diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -2078,26 +2078,22 @@
* suspension is over, and then proceed.
*/
static int
-vn_start_write_refed(struct mount *mp, int flags, bool mplocked)
+vn_start_write_refed(struct mount *mp, int flags)
{
struct mount_pcpu *mpcpu;
int error, mflags;
- if (__predict_true(!mplocked) && (flags & V_XSLEEP) == 0 &&
- vfs_op_thread_enter(mp, mpcpu)) {
+ if ((flags & V_XSLEEP) == 0 && vfs_op_thread_enter(mp, mpcpu)) {
MPASS((mp->mnt_kern_flag & MNTK_SUSPEND) == 0);
vfs_mp_count_add_pcpu(mpcpu, writeopcount, 1);
vfs_op_thread_exit(mp, mpcpu);
return (0);
}
- if (mplocked)
- mtx_assert(MNT_MTX(mp), MA_OWNED);
- else
- MNT_ILOCK(mp);
-
error = 0;
+ MNT_ILOCK(mp);
+
/*
* Check on status of suspension.
*/
@@ -2165,7 +2161,7 @@
if (vp == NULL)
vfs_ref(mp);
- error = vn_start_write_refed(mp, flags, false);
+ error = vn_start_write_refed(mp, flags);
if (error != 0 && (flags & V_NOWAIT) == 0)
*mpp = NULL;
return (error);
@@ -2373,10 +2369,12 @@
if ((flags & VR_NO_SUSPCLR) == 0)
VFS_SUSP_CLEAN(mp);
vfs_op_exit(mp);
- } else if ((flags & VR_START_WRITE) != 0) {
- MNT_REF(mp);
- vn_start_write_refed(mp, 0, true);
} else {
+ if ((flags & VR_START_WRITE) != 0) {
+ MNT_REF(mp);
+ mp->mnt_writeopcount++;
+ }
+
MNT_IUNLOCK(mp);
}
}

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 13, 11:46 PM (6 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30593351
Default Alt Text
D56108.diff (1 KB)

Event Timeline