Module Name: src
Committed By: dyoung
Date: Wed May 20 03:50:39 UTC 2009
Modified Files:
src/share/man/man9: disk.9
Log Message:
Describe disk_begindetach(9).
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/share/man/man9/disk.9
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/man/man9/disk.9
diff -u src/share/man/man9/disk.9:1.30 src/share/man/man9/disk.9:1.31
--- src/share/man/man9/disk.9:1.30 Wed Apr 8 12:51:43 2009
+++ src/share/man/man9/disk.9 Wed May 20 03:50:39 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: disk.9,v 1.30 2009/04/08 12:51:43 joerg Exp $
+.\" $NetBSD: disk.9,v 1.31 2009/05/20 03:50:39 dyoung Exp $
.\"
.\" Copyright (c) 1995, 1996 Jason R. Thorpe.
.\" All rights reserved.
@@ -30,13 +30,14 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd March 14, 2009
+.Dd May 19, 2009
.Dt DISK 9
.Os
.Sh NAME
.Nm disk ,
.Nm disk_init ,
.Nm disk_attach ,
+.Nm disk_begindetach ,
.Nm disk_detach ,
.Nm disk_destroy ,
.Nm disk_busy ,
@@ -53,6 +54,8 @@
.Ft void
.Fn disk_attach "struct disk *"
.Ft void
+.Fn disk_begindetach "struct disk *" "int (*lastclose)(device_t)" "device_t self" "int flags"
+.Ft void
.Fn disk_detach "struct disk *"
.Ft void
.Fn disk_destroy "struct disk *"
@@ -137,6 +140,22 @@
.Dq attached time
timestamp, insert the disk into the disklist, and increment the
system disk count.
+.It Fn disk_begindetach
+Check whether the disk is open, and if not, return 0.
+If the disk is open, and
+.Dv DETACH_FORCE
+is not set in
+.Fa flags ,
+return
+.Dv EBUSY .
+Otherwise, call the provided
+.Fa lastclose
+routine
+.Po
+if not
+.Dv NULL
+.Pc
+and return its exit code.
.It Fn disk_detach
Detach a disk; free storage for the disklabel, remove the disk
from the disklist, and decrement the system disk count.
@@ -181,6 +200,7 @@
The functions typically called by device drivers are
.Fn disk_init
.Fn disk_attach ,
+.Fn disk_begindetach ,
.Fn disk_detach ,
.Fn disk_destroy,
.Fn disk_busy ,