xref: /freebsd/share/man/man9/vfs_busy.9 (revision 09356c848473844673c36bb823b82effc73f1ea5)
18981fef8SAlfred Perlstein.\"
28981fef8SAlfred Perlstein.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
38981fef8SAlfred Perlstein.\"
48981fef8SAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without
58981fef8SAlfred Perlstein.\" modification, are permitted provided that the following conditions
68981fef8SAlfred Perlstein.\" are met:
78981fef8SAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright
88981fef8SAlfred Perlstein.\"    notice(s), this list of conditions and the following disclaimer as
98981fef8SAlfred Perlstein.\"    the first lines of this file unmodified other than the possible
108981fef8SAlfred Perlstein.\"    addition of one or more copyright notices.
118981fef8SAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright
128981fef8SAlfred Perlstein.\"    notice(s), this list of conditions and the following disclaimer in the
138981fef8SAlfred Perlstein.\"    documentation and/or other materials provided with the distribution.
148981fef8SAlfred Perlstein.\"
158981fef8SAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
168981fef8SAlfred Perlstein.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
178981fef8SAlfred Perlstein.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
188981fef8SAlfred Perlstein.\" DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
198981fef8SAlfred Perlstein.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
208981fef8SAlfred Perlstein.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
218981fef8SAlfred Perlstein.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
228981fef8SAlfred Perlstein.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
238981fef8SAlfred Perlstein.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
248981fef8SAlfred Perlstein.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
258981fef8SAlfred Perlstein.\" DAMAGE.
268981fef8SAlfred Perlstein.\"
278981fef8SAlfred Perlstein.\" $FreeBSD$
288981fef8SAlfred Perlstein.\"
298981fef8SAlfred Perlstein.Dd July 8, 2001
308981fef8SAlfred Perlstein.Dt VFS_BUSY 9
318981fef8SAlfred Perlstein.Os
328981fef8SAlfred Perlstein.Sh NAME
338981fef8SAlfred Perlstein.Nm vfs_busy
3423789024SRuslan Ermilov.Nd "marks a mount point as busy"
358981fef8SAlfred Perlstein.Sh SYNOPSIS
3623789024SRuslan Ermilov.In sys/param.h
3723789024SRuslan Ermilov.In sys/mount.h
388981fef8SAlfred Perlstein.Ft int
39211ab871SSheldon Hearn.Fn vfs_busy "struct mount *mp" "int flags" "struct mtx *interlkp" "struct thread *td"
408981fef8SAlfred Perlstein.Sh DESCRIPTION
418981fef8SAlfred PerlsteinThe
4223789024SRuslan Ermilov.Fn vfs_busy
4323789024SRuslan Ermilovfunction marks a mount point as busy.
4423789024SRuslan ErmilovThe purpose of this
4523789024SRuslan Ermilovfunction is to synchronize access to a mount point.
46034709cbSRuslan ErmilovIt also delays unmounting by sleeping on
47034709cbSRuslan Ermilov.Fa mp
48034709cbSRuslan Ermilovif the
4923789024SRuslan Ermilov.Dv MNTK_UNMOUNT
5023789024SRuslan Ermilovflag is set in
5123789024SRuslan Ermilov.Fa mp->mnt_kern_flag
5223789024SRuslan Ermilovand the
5323789024SRuslan Ermilov.Dv LK_NOWAIT
5423789024SRuslan Ermilovflag is
5523789024SRuslan Ermilov.Em not
5623789024SRuslan Ermilovset.
578981fef8SAlfred Perlstein.Pp
588981fef8SAlfred PerlsteinIts arguments are:
59e8b02a42SRuslan Ermilov.Bl -tag -width ".Fa interlkp"
6023789024SRuslan Ermilov.It Fa mp
618981fef8SAlfred PerlsteinThe mount point to busy.
6223789024SRuslan Ermilov.It Fa flags
63034709cbSRuslan ErmilovFlags controlling how
64034709cbSRuslan Ermilov.Fn vfs_busy
65034709cbSRuslan Ermilovshould act.
66e8b02a42SRuslan Ermilov.Bl -tag -width ".Dv LK_NOWAIT"
6723789024SRuslan Ermilov.It Dv LK_NOWAIT
6823789024SRuslan Ermilovdo not sleep if
6923789024SRuslan Ermilov.Dv MNTK_UNMOUNT
7023789024SRuslan Ermilovis set.
7123789024SRuslan Ermilov.El
7223789024SRuslan Ermilov.It Fa interlkp
7323789024SRuslan ErmilovThe interlock mutex for
7423789024SRuslan Ermilov.Fa mp->mount_lock .
7523789024SRuslan ErmilovIf there is any chance
7623789024SRuslan Ermilovthe mount point is being unmounted and
7723789024SRuslan Ermilov.Dv LK_NOWAIT
7823789024SRuslan Ermilovis not set then
798981fef8SAlfred Perlsteininterlock must be valid locked mutex.
80211ab871SSheldon Hearn.It Fa td
81211ab871SSheldon HearnThe thread responsible for this call.
828981fef8SAlfred Perlstein.El
838981fef8SAlfred Perlstein.Sh LOCKS
8423789024SRuslan ErmilovIf
8523789024SRuslan Ermilov.Fa interlkp
8623789024SRuslan Ermilovis a valid pointer it must be locked on entry,
87034709cbSRuslan Ermilovand it will not be unlocked even in the case of an error.
888981fef8SAlfred Perlstein.Sh RETURN VALUES
8923789024SRuslan ErmilovA 0 value is returned on success.
9023789024SRuslan ErmilovIf the mount point is being
9123789024SRuslan Ermilovunmounted
9223789024SRuslan Ermilov.Er ENOENT
9323789024SRuslan Ermilovwill always be returned.
948981fef8SAlfred Perlstein.Sh ERRORS
9523789024SRuslan Ermilov.Bl -tag -width Er
9623789024SRuslan Ermilov.It Bq Er ENOENT
9723789024SRuslan ErmilovThe mount point is being unmounted
9823789024SRuslan Ermilov.Dv ( MNTK_UNMOUNT
9923789024SRuslan Ermilovis set).
1008981fef8SAlfred Perlstein.El
1018981fef8SAlfred Perlstein.Sh AUTHORS
10209356c84SHiten PandyaThis manual page was written by
103034709cbSRuslan Ermilov.An Chad David Aq davidc@acns.ab.ca .
104