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

Function vfs_op_enter

freebsd/kern/vfs_mount.c:1529–1559  ·  view source on GitHub ↗

* There are various reference counters associated with the mount point. * Normally it is permitted to modify them without taking the mnt ilock, * but this behavior can be temporarily disabled if stable value is needed * or callers are expected to block (e.g. to not allow new users during * forced unmount). */

Source from the content-addressed store, hash-verified

1527 * forced unmount).
1528 */
1529void
1530vfs_op_enter(struct mount *mp)
1531{
1532 struct mount_pcpu *mpcpu;
1533 int cpu;
1534
1535 MNT_ILOCK(mp);
1536 mp->mnt_vfs_ops++;
1537 if (mp->mnt_vfs_ops > 1) {
1538 MNT_IUNLOCK(mp);
1539 return;
1540 }
1541 vfs_op_barrier_wait(mp);
1542 CPU_FOREACH(cpu) {
1543 mpcpu = vfs_mount_pcpu_remote(mp, cpu);
1544
1545 mp->mnt_ref += mpcpu->mntp_ref;
1546 mpcpu->mntp_ref = 0;
1547
1548 mp->mnt_lockref += mpcpu->mntp_lockref;
1549 mpcpu->mntp_lockref = 0;
1550
1551 mp->mnt_writeopcount += mpcpu->mntp_writeopcount;
1552 mpcpu->mntp_writeopcount = 0;
1553 }
1554 if (mp->mnt_ref <= 0 || mp->mnt_lockref < 0 || mp->mnt_writeopcount < 0)
1555 panic("%s: invalid count(s) on mp %p: ref %d lockref %d writeopcount %d\n",
1556 __func__, mp, mp->mnt_ref, mp->mnt_lockref, mp->mnt_writeopcount);
1557 MNT_IUNLOCK(mp);
1558 vfs_assert_mount_counters(mp);
1559}
1560
1561void
1562vfs_op_exit_locked(struct mount *mp)

Callers 3

vfs_write_suspendFunction · 0.85
vfs_domount_updateFunction · 0.85
dounmountFunction · 0.85

Calls 3

vfs_op_barrier_waitFunction · 0.85
panicFunction · 0.70

Tested by

no test coverage detected