freebsd-nq/lib/libufs/libufs.3
Kirk McKusick 72f854ce8f Correct fsck journal-recovery code to update a cylinder-group
check-hash after making changes to the cylinder group. The problem
was that the journal-recovery code was calling the libufs bwrite()
function instead of the cgput() function. The cgput() function updates
the cylinder-group check-hash before writing the cylinder group.

This change required the additions of the cgget() and cgput() functions
to the libufs API to avoid a gratuitous bcopy of every cylinder group
to be read or written. These new functions have been added to the
libufs manual pages. This was the first opportunity that I have had
to use and document the use of the EDOOFUS error code.

Reviewed by: kib
Reported by: emaste and others
2018-01-17 17:58:24 +00:00

82 lines
1.6 KiB
Groff

.\" Author: Juli Mallett <jmallett@FreeBSD.org>
.\" Date: June 04, 2003
.\" Description:
.\" Manual page for libufs.
.\"
.\" This file is in the public domain.
.\"
.\" $FreeBSD$
.\"
.Dd January 19, 2018
.Dt LIBUFS 3
.Os
.Sh NAME
.Nm libufs
.Nd operate on UFS file systems from userland
.Sh LIBRARY
.Lb libufs
.Sh SYNOPSIS
.In sys/param.h
.In sys/mount.h
.In ufs/ufs/ufsmount.h
.In ufs/ufs/dinode.h
.In ufs/ffs/fs.h
.In libufs.h
.Sh DESCRIPTION
The
.Nm
library and the functions it provides are used for implementing
utilities which need to access a UFS file system at a low level from
userland.
Facilities provided are used to implement utilities such as
.Xr newfs 8
and
.Xr dumpfs 8 .
The
.Nm
library is designed to be simple, and to provide functions that are
traditionally useful to have.
.Pp
A disk is represented as the type
.Vt "struct uufsd"
as defined in
.In libufs.h .
The structure is filled out, operations are performed, and the disk
is closed.
.Sh ERRORS
Functions provided by
.Nm
return \-1 in every functional error situation.
They also set the
.Va d_error
field of
.Vt "struct uufsd"
to a string describing the error.
.Sh SEE ALSO
.Xr bread 3 ,
.Xr bwrite 3 ,
.Xr cgget 3 ,
.Xr cgput 3 ,
.Xr cgread 3 ,
.Xr cgread1 3 ,
.Xr cgwrite 3 ,
.Xr cgwrite1 3 ,
.Xr sbread 3 ,
.Xr sbwrite 3 ,
.Xr ufs_disk_close 3 ,
.Xr ufs_disk_fillout 3 ,
.Xr ufs_disk_fillout_blank 3 ,
.Xr ufs_disk_write 3 ,
.Xr ffs 7
.Sh HISTORY
The
.Xr libufs 3
library first appeared in
.Fx 5.0 .
.Sh AUTHORS
.An Juli Mallett Aq Mt jmallett@FreeBSD.org
.Pp
.An -nosplit
Additional design, feedback, and ideas were provided by
.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .