libufs, a library for dealing with UFS from userland.

Juli Mallett <[email protected]>
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
Hi,

I'm trying to get review of something phk@ talked me into having a go at,
libufs, which is a library to un-duplicate code for dealing with UFS on a
raw disk device.  Currently it defines a generic structure for UFS on any
disk that one might want to refer to from the userland, including the UFS
superblock, version, and the name and file descriptor for the device used
to work with the disk.  That structure is then used by implementations of
block read/write (bread/bwrite), functions to read and write the superblock
in a uufsd structure (sbread/sbwrite) and a function to get the inode
structure for a given file.

Here's a shell archive:
	http://people.freebsd.org/~jmallett/libufs.shar

And here's diffs to dumpfs and tunefs:
	http://people.freebsd.org/~jmallett/libufs-dumpfs.diff
	http://people.freebsd.org/~jmallett/libufs-tunefs.diff

To build (e.g. tunefs) with libufs, do something like:
	cd libufs
	make
	co /home/ncvs/src/sbin/tunefs.c,v
	cc tunefs.c -o libufs-tunefs -L. -lufs

I get identical output from dumpfs and libufs-dumpfs currently and I can
toggle softdep flags fine with tunefs.  I'd like to commit this by the
coming Tuesday as I will be out of town from Tuesday morning and will not
have any way to further work on this, etc.

Further functionality may/will be added to libufs, however this is a good
"milestone" of abstraction, in my opinion, as it can replace code in a number
of utilities, namely dump, dumpfs, tunefs, ffsinfo, growfs, and possibly one
or two others, if I recall correctly.

Architectural review, comments, and "feel free to commit" welcome :)

Thanks,
juli.
-- 
Juli Mallett <[email protected]>       | FreeBSD: The Power To Serve
Taking over the FreeBSD negaverse.        | FreeBSD Negacore Team
Will break world for fulltime employment. | finger [email protected]

To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-audit" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.