MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vfs_write_suspend_umnt

Function vfs_write_suspend_umnt

freebsd/kern/vfs_vnops.c:2077–2104  ·  view source on GitHub ↗

* Helper loop around vfs_write_suspend() for filesystem unmount VFS * methods. */

Source from the content-addressed store, hash-verified

2075 * methods.
2076 */
2077int
2078vfs_write_suspend_umnt(struct mount *mp)
2079{
2080 int error;
2081
2082 KASSERT((curthread->td_pflags & TDP_IGNSUSP) == 0,
2083 ("vfs_write_suspend_umnt: recursed"));
2084
2085 /* dounmount() already called vn_start_write(). */
2086 for (;;) {
2087 vn_finished_write(mp);
2088 error = vfs_write_suspend(mp, 0);
2089 if (error != 0) {
2090 vn_start_write(NULL, &mp, V_WAIT);
2091 return (error);
2092 }
2093 MNT_ILOCK(mp);
2094 if ((mp->mnt_kern_flag & MNTK_SUSPENDED) != 0)
2095 break;
2096 MNT_IUNLOCK(mp);
2097 vn_start_write(NULL, &mp, V_WAIT);
2098 }
2099 mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2);
2100 wakeup(&mp->mnt_flag);
2101 MNT_IUNLOCK(mp);
2102 curthread->td_pflags |= TDP_IGNSUSP;
2103 return (0);
2104}
2105
2106/*
2107 * Implement kqueues for files by translating it to vnode operation.

Callers

nothing calls this directly

Calls 4

vn_finished_writeFunction · 0.85
vfs_write_suspendFunction · 0.85
vn_start_writeFunction · 0.85
wakeupFunction · 0.70

Tested by

no test coverage detected