Main index | Section 3 | Options |
#include <sys/param.h>
#include <sys/mount.h>
#include <ufs/ufs/ufsmount.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#include <libufs.h>
The cgget() function reads the cylinder group specified by cg into the buffer pointed to by cgp from the disk referenced by the user-land UFS-disk structure. The cgget() function is the only cylinder group read function that is safe to use in threaded applications.
The cgput() function writes the cylinder group specified by cgp to the disk referenced by the user-land UFS-disk structure. The cgput() function is the only cylinder group write function that is safe to use in threaded applications. Note that the cgput() function needs to be called only if the cylinder group has been modified and the on-disk copy needs to be updated.
The cgread1() function reads from the cylinder group specified by cg into the d_cg cylinder-group structure in a user-land UFS-disk structure. It sets the d_lcg field to the cylinder group number cg.
The cgread() function operates on sequential cylinder groups. Calling the cgread() function is equivalent to calling cgread1() with a cylinder group specifier equivalent to the value of the current d_ccg field, and then incrementing the d_ccg field.
The cgwrite() function stores on disk the cylinder group held in the d_cg cylinder-group structure in a user-land UFS-disk structure.
The cgwrite1() function provides no additional functionality over the cgwrite() function as there is only one place that a given cylinder group can correctly be written. If the caller gets the cg parameter wrong, the function fails with the error EDOOFUS. This function remains only to provide backward compatibility.
The cgput(), cgwrite(), and cgwrite1() functions may fail and set errno for any of the errors specified for the library function bwrite(3). Additionally the cgwrite1() will return the EDOOFUS error if the cylinder group specified does not match the cylinder group that it is requesting to write.
CGREAD (3) | January 19, 2018 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.