1 .\" Author: Juli Mallett <jmallett@FreeBSD.org>
2 .\" Date: June 04, 2003
4 .\" Manual page for libufs functions:
10 .\" This file is in the public domain.
18 .Nm sbget , sbput , sbread , 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 sbput "int devfd" "struct fs *fs" "int numaltwrite"
34 .Fn sbread "struct uufsd *disk"
36 .Fn sbwrite "struct uufsd *disk" "int all"
42 functions provide superblock reads for
49 functions provide superblock writes for
55 function first allocates a buffer to hold the superblock.
58 file descriptor that references the filesystem disk,
60 reads the superblock located at the byte offset specified by
62 into the allocated buffer.
67 to request that the standard location for the superblock be read.
68 Flags are specified by
72 .Bl -tag -width UFS_NOHASHFAIL
74 Will note if the check hash is wrong but will still return the superblock.
76 Indicates that superblock inconsistency error messages should not be printed.
78 Causes only the superblock itself to be returned, but does not read in any auxiliary data structures like the cylinder group summary information.
83 returns a pointer to the buffer containing the superblock in
87 function is safe to use in threaded applications.
91 function writes the superblock specified by
93 to the location from which it was read on the disk referenced by the
98 function will update the first
100 alternate superblock locations.
101 To update all the alternate superblocks,
108 function is safe to use in threaded applications.
111 function needs to be called only if the superblock has been
112 modified and the on-disk copy needs to be updated.
116 function reads the standard filesystem superblock into the
118 structure embedded in the given user-land UFS disk structure.
122 function writes the superblock from the
124 structure embedded in the given user-land UFS disk structure
125 to the location from which it was read.
128 function will write to all the alternate superblock locations if the
132 .Rv -std sbread sbwrite
137 functions return the value 0 if successful;
138 otherwise they return one of the errors described below.
140 The errors returned by
144 include any of the errors specified for the library function
146 Additionally, they may follow the
148 error methodologies in situations where no usable superblock could be
151 The errors returned by
155 include any of the errors specified for the library function
162 These functions first appeared as part of
167 .An Juli Mallett Aq Mt jmallett@FreeBSD.org
168 .An Marshall Kirk McKusick Aq Mt mckusick@FreeBSD.org