1 .\" Author: Juli Mallett <jmallett@FreeBSD.org>
2 .\" Date: June 04, 2003
4 .\" Manual page for libufs functions:
12 .\" This file is in the public domain.
18 .Nm sbget , sbsearch , sbput , sbread , sbfind , sbwrite
19 .Nd read and write superblocks of a UFS file system
25 .In ufs/ufs/ufsmount.h
30 .Fn sbget "int devfd" "struct fs **fsp" "off_t sblockloc" "int flags"
32 .Fn sbsearch "int devfd" "struct fs **fsp" "int flags"
34 .Fn sbput "int devfd" "struct fs *fs" "int numaltwrite"
36 .Fn sbread "struct uufsd *disk"
38 .Fn sbfind "struct uufsd *disk" "int flags"
40 .Fn sbwrite "struct uufsd *disk" "int all"
48 functions provide superblock reads for
55 functions provide superblock writes for
63 functions first allocate a buffer to hold the superblock.
66 file descriptor that references the filesystem disk,
68 reads the superblock located at the byte offset specified by
70 into the allocated buffer.
75 to request that the standard location for the superblock be read.
80 file descriptor that references the filesystem disk,
81 to search first for the superblock at the standard location.
82 If it is not found or is too damaged to use
84 will attempt to find one of the filesystem's alternate superblocks.
85 Flags are specified by
89 .Bl -tag -width UFS_NOCSUM
91 Causes only the superblock itself to be returned, but does not read in any
92 auxiliary data structures like the cylinder group summary information.
94 Indicates that superblock inconsistency error messages should not be printed.
101 functions return a pointer to the buffer containing the superblock in
107 functions are safe to use in threaded applications.
111 function writes the superblock specified by
113 to the location from which it was read on the disk referenced by the
118 function will update the first
120 alternate superblock locations.
121 To update all the alternate superblocks,
128 function is safe to use in threaded applications.
131 function needs to be called only if the superblock has been
132 modified and the on-disk copy needs to be updated.
136 function reads the standard filesystem superblock.
139 function tries to find a usable superblock.
140 It searchs first for the superblock at the standard location.
141 If it is not found or is too damaged to use
143 will attempt to find one of the filesystem's alternate superblocks.
148 return a superblock in the
150 structure embedded in the given user-land UFS disk structure.
154 function writes the superblock from the
156 structure embedded in the given user-land UFS disk structure
157 to the location from which it was read.
160 function will write to all the alternate superblock locations if the
164 .Rv -std sbread sbwrite
170 functions return the value 0 if successful;
171 otherwise they return one of the errors described below.
173 The errors returned by
179 include any of the errors specified for the library function
181 Additionally, they may follow the
183 error methodologies in situations where no usable superblock could be
186 The errors returned by
190 include any of the errors specified for the library function
197 These functions first appeared as part of
202 .An Juli Mallett Aq Mt jmallett@FreeBSD.org
203 .An Marshall Kirk McKusick Aq Mt mckusick@FreeBSD.org