From owner-freebsd-audit Sat Jun 29 5:37:54 2002 Delivered-To: freebsd-audit@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 02D1937B400; Sat, 29 Jun 2002 05:37:48 -0700 (PDT) Date: Sat, 29 Jun 2002 05:37:47 -0700 From: Juli Mallett To: audit@FreeBSD.ORG, current@FreeBSD.ORG Cc: Poul-Henning Kamp , Kirk McKusick Subject: libufs, a library for dealing with UFS from userland. Message-ID: <20020629053747.A68232@FreeBSD.ORG> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Organisation: The FreeBSD Project X-Alternate-Addresses: , , , X-Affiliated-Projects: FreeBSD, xMach, ircd-hybrid-7 X-Towel: Yes X-LiveJournal: flata X-Negacore: Yes Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 | FreeBSD: The Power To Serve Taking over the FreeBSD negaverse. | FreeBSD Negacore Team Will break world for fulltime employment. | finger jmallett@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message