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