]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libufs/ufs_disk_close.3
bhnd(9): Fix a few mandoc related issues
[FreeBSD/FreeBSD.git] / lib / libufs / ufs_disk_close.3
1 .\" Author:     Juli Mallett <jmallett@FreeBSD.org>
2 .\" Date:       June 04, 2003
3 .\" Description:
4 .\"     Manual page for libufs functions:
5 .\"             ufs_disk_close(3)
6 .\"             ufs_disk_fillout(3)
7 .\"             ufs_disk_fillout_blank(3)
8 .\"             ufs_disk_write(3)
9 .\"
10 .\" This file is in the public domain.
11 .\"
12 .\" $FreeBSD$
13 .\"
14 .Dd June 4, 2003
15 .Dt UFS_DISK_CLOSE 3
16 .Os
17 .Sh NAME
18 .Nm ufs_disk_close ,
19 .Nm ufs_disk_fillout ,
20 .Nm ufs_disk_fillout_blank ,
21 .Nm ufs_disk_write
22 .Nd open and close userland UFS disks
23 .Sh LIBRARY
24 .Lb libufs
25 .Sh SYNOPSIS
26 .In sys/param.h
27 .In sys/mount.h
28 .In ufs/ufs/ufsmount.h
29 .In ufs/ufs/dinode.h
30 .In ufs/ffs/fs.h
31 .In libufs.h
32 .Ft int
33 .Fn ufs_disk_close "struct uufsd *disk"
34 .Ft int
35 .Fn ufs_disk_fillout "struct uufsd *disk" "const char *name"
36 .Ft int
37 .Fn ufs_disk_fillout_blank "struct uufsd *disk" "const char *name"
38 .Ft int
39 .Fn ufs_disk_write "struct uufsd *disk"
40 .Sh DESCRIPTION
41 The
42 .Fn ufs_disk_close
43 function closes a disk and frees internal memory related to it.
44 It does not free the
45 .Fa disk
46 structure.
47 .Pp
48 The
49 .Fn ufs_disk_fillout
50 and
51 .Fn ufs_disk_fillout_blank
52 functions open a disk specified by
53 .Fa name
54 and populate the structure pointed to by
55 .Fa disk .
56 The disk is opened read-only.
57 The specified
58 .Fa name
59 may be either a mountpoint, a device name or a filesystem image.
60 The
61 .Fn ufs_disk_fillout
62 function assumes there is a valid superblock and will fail if not,
63 whereas the
64 .Fn ufs_disk_fillout_blank
65 function makes no assumptions of that sort.
66 .Pp
67 The
68 .Fn ufs_disk_write
69 function attempts to re-open a disk as writable if it is not currently.
70 .Sh ERRORS
71 The function
72 .Fn ufs_disk_close
73 has no failure points.
74 .Pp
75 The function
76 .Fn ufs_disk_fillout
77 may fail for any of the reasons
78 .Fn ufs_disk_fillout_blank
79 might, as well as for any reason
80 .Xr sbread 3
81 might.
82 .Pp
83 The
84 .Fn ufs_disk_fillout_blank
85 may fail and set
86 .Va errno
87 for any of the errors specified for the library functions
88 .Xr open 2 ,
89 .Xr strdup 3 .
90 Additionally, it may follow the
91 .Xr libufs 3
92 error methodologies in situations where no device could be found to
93 open.
94 .Pp
95 The function
96 .Fn ufs_disk_write
97 may fail and set
98 .Va errno
99 for any of the errors specified for the library functions
100 .Xr open 2
101 and
102 .Xr stat 2 .
103 Namely, it will fail if the disk in question may not be written to.
104 .Sh SEE ALSO
105 .Xr open 2 ,
106 .Xr getfsfile 3 ,
107 .Xr libufs 3 ,
108 .Xr sbread 3
109 .Sh HISTORY
110 These functions first appeared as part of
111 .Xr libufs 3
112 in
113 .Fx 5.0 .
114 .Sh AUTHORS
115 .An Juli Mallett Aq Mt jmallett@FreeBSD.org