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"
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.
63 If successful, it returns a pointer to the buffer containing the superblock in
67 function is safe to use in threaded applications.
71 function writes the superblock specified by
73 to the location from which it was read on the disk referenced by the
78 function will update the first
80 alternate superblock locations.
81 To update all the alternate superblocks,
88 function is safe to use in threaded applications.
91 function needs to be called only if the superblock has been
92 modified and the on-disk copy needs to be updated.
96 function reads the standard filesystem superblock into the
98 structure embedded in the given user-land UFS disk structure.
102 function writes the superblock from the
104 structure embedded in the given user-land UFS disk structure
105 to the location from which it was read.
108 function will write to all the alternate superblock locations if the
112 .Rv -std sbread sbwrite
117 functions return the value 0 if successful;
118 otherwise they return one of the errors described below.
120 The errors returned by
124 include any of the errors specified for the library function
126 Additionally, they may follow the
128 error methodologies in situations where no usable superblock could be
131 The errors returned by
135 include any of the errors specified for the library function
142 These functions first appeared as part of
147 .An Juli Mallett Aq Mt jmallett@FreeBSD.org