xref: /freebsd/lib/libufs/ufs_disk_close.3 (revision 5b9c547c)
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
38The
39.Fn ufs_disk_close
40function closes a disk and frees internal memory related to it.
41It does not free the
42.Fa disk
43structure.
44.Pp
45The
46.Fn ufs_disk_fillout
47and
48.Fn ufs_disk_fillout_blank
49functions open a disk specified by
50.Fa name
51and populate the structure pointed to by
52.Fa disk .
53The disk is opened read-only.
54The specified
55.Fa name
56may be either a mountpoint, a device name or a filesystem image.
57The
58.Fn ufs_disk_fillout
59function assumes there is a valid superblock and will fail if not,
60whereas the
61.Fn ufs_disk_fillout_blank
62function makes no assumptions of that sort.
63.Pp
64The
65.Fn ufs_disk_write
66function attempts to re-open a disk as writable if it is not currently.
67.Sh ERRORS
68The function
69.Fn ufs_disk_close
70has no failure points.
71.Pp
72The function
73.Fn ufs_disk_fillout
74may fail for any of the reasons
75.Fn ufs_disk_fillout_blank
76might, as well as for any reason
77.Xr sbread 3
78might.
79.Pp
80The
81.Fn ufs_disk_fillout_blank
82may fail and set
83.Va errno
84for any of the errors specified for the library functions
85.Xr open 2 ,
86.Xr strdup 3 .
87Additionally, it may follow the
88.Xr libufs 3
89error methodologies in situations where no device could be found to
90open.
91.Pp
92The function
93.Fn ufs_disk_write
94may fail and set
95.Va errno
96for any of the errors specified for the library functions
97.Xr open 2
98and
99.Xr stat 2 .
100Namely, 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
107These functions first appeared as part of
108.Xr libufs 3
109in
110.Fx 5.0 .
111.Sh AUTHORS
112.An Juli Mallett Aq Mt jmallett@FreeBSD.org
113