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.
20 .Nm sbget , sbsearch , sbput , sbread , sbfind , sbwrite
21 .Nd read and write superblocks of a UFS file system
27 .In ufs/ufs/ufsmount.h
32 .Fn sbget "int devfd" "struct fs **fsp" "off_t sblockloc" "int flags"
34 .Fn sbsearch "int devfd" "struct fs **fsp" "int flags"
36 .Fn sbput "int devfd" "struct fs *fs" "int numaltwrite"
38 .Fn sbread "struct uufsd *disk"
40 .Fn sbfind "struct uufsd *disk" "int flags"
42 .Fn sbwrite "struct uufsd *disk" "int all"
50 functions provide superblock reads for
57 functions provide superblock writes for
65 functions first allocate a buffer to hold the superblock.
68 file descriptor that references the filesystem disk,
70 reads the superblock located at the byte offset specified by
72 into the allocated buffer.
77 to request that the standard location for the superblock be read.
82 file descriptor that references the filesystem disk,
83 to search first for the superblock at the standard location.
84 If it is not found or is too damaged to use
86 will attempt to find one of the filesystem's alternate superblocks.
87 Flags are specified by
91 .Bl -tag -width UFS_NOCSUM
93 Causes only the superblock itself to be returned, but does not read in any
94 auxiliary data structures like the cylinder group summary information.
96 Indicates that superblock inconsistency error messages should not be printed.
103 functions return a pointer to the buffer containing the superblock in
109 functions are safe to use in threaded applications.
113 function writes the superblock specified by
115 to the location from which it was read on the disk referenced by the
120 function will update the first
122 alternate superblock locations.
123 To update all the alternate superblocks,
130 function is safe to use in threaded applications.
133 function needs to be called only if the superblock has been
134 modified and the on-disk copy needs to be updated.
138 function reads the standard filesystem superblock.
141 function tries to find a usable superblock.
142 It searchs first for the superblock at the standard location.
143 If it is not found or is too damaged to use
145 will attempt to find one of the filesystem's alternate superblocks.
150 return a superblock in the
152 structure embedded in the given user-land UFS disk structure.
156 function writes the superblock from the
158 structure embedded in the given user-land UFS disk structure
159 to the location from which it was read.
162 function will write to all the alternate superblock locations if the
166 .Rv -std sbread sbwrite
172 functions return the value 0 if successful;
173 otherwise they return one of the errors described below.
175 The errors returned by
181 include any of the errors specified for the library function
183 Additionally, they may follow the
185 error methodologies in situations where no usable superblock could be
188 The errors returned by
192 include any of the errors specified for the library function
199 These functions first appeared as part of
204 .An Juli Mallett Aq Mt jmallett@FreeBSD.org
205 .An Marshall Kirk McKusick Aq Mt mckusick@FreeBSD.org