Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152135489
D56108.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56108.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D56108: vfs: Simplify vfs_write_resume()/vn_start_write_refed()
Attached
Detach File
Event Timeline
Log In to Comment