freebsd-dev/stand
Kirk McKusick efbf396426 This change is some refactoring of Mark Johnston's changes in r329375
to fix the memory leak that I introduced in r328426. Instead of
trying to clear up the possible memory leak in all the clients, I
ensure that it gets cleaned up in the source (e.g., ffs_sbget ensures
that memory is always freed if it returns an error).

The original change in r328426 was a bit sparse in its description.
So I am expanding on its description here (thanks cem@ and rgrimes@
for your encouragement for my longer commit messages).

In preparation for adding check hashing to superblocks, r328426 is
a refactoring of the code to get the reading/writing of the superblock
into one place. Unlike the cylinder group reading/writing which
ends up in two places (ffs_getcg/ffs_geom_strategy in the kernel
and cgget/cgput in libufs), I have the core superblock functions
just in the kernel (ffs_sbfetch/ffs_sbput in ffs_subr.c which is
already imported into utilities like fsck_ffs as well as libufs to
implement sbget/sbput). The ffs_sbfetch and ffs_sbput functions
take a function pointer to do the actual I/O for which there are
four variants:

    ffs_use_bread / ffs_use_bwrite for the in-kernel filesystem

    g_use_g_read_data / g_use_g_write_data for kernel geom clients

    ufs_use_sa_read for the standalone code (stand/libsa/ufs.c
	but not stand/libsa/ufsread.c which is size constrained)

    use_pread / use_pwrite for libufs

Uses of these interfaces are in the UFS filesystem, geoms journal &
label, libsa changes, and libufs. They also permeate out into the
filesystem utilities fsck_ffs, newfs, growfs, clri, dump, quotacheck,
fsirand, fstyp, and quot. Some of these utilities should probably be
converted to directly use libufs (like dumpfs was for example), but
there does not seem to be much win in doing so.

Tested by: Peter Holm (pho@)
2018-03-02 04:34:53 +00:00
..
arm Go back to one loader.conf 2018-02-26 03:16:47 +00:00
arm64
common Fix module loading on arm after the metadata.c unification in r329190. 2018-02-28 21:51:51 +00:00
defaults Fix a typo: "now" -> "no". 2018-02-26 18:50:39 +00:00
efi stand: Fix build after r330249 2018-03-01 21:46:01 +00:00
fdt Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
ficl Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
ficl32
forth These two directories build man pages, so it's incorrect to tag them 2018-02-26 15:41:20 +00:00
geli Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
i386 stand: Fix build after r330249 2018-03-01 21:46:01 +00:00
kshim A more definitions to kernel emulation shim in order to build stand/usb. 2018-02-07 18:50:36 +00:00
liblua liblua: Implement write support 2018-02-24 02:57:24 +00:00
liblua32 Add Lua as a scripting langauge to /boot/loader 2018-02-12 15:31:53 +00:00
libsa This change is some refactoring of Mark Johnston's changes in r329375 2018-03-02 04:34:53 +00:00
libsa32
lua lualoader: Use string literal \xNN instead of string.char() 2018-03-02 03:05:36 +00:00
man
mips Go back to one loader.conf 2018-02-26 03:16:47 +00:00
ofw Fix regression introduced in r328806, preventing boot at least on all 2018-02-03 23:49:21 +00:00
powerpc stand: Fix build after r330249 2018-03-01 21:46:01 +00:00
sparc64 stand: Fix build after r330249 2018-03-01 21:46:01 +00:00
uboot stand: Fix build after r330249 2018-03-01 21:46:01 +00:00
usb Move the stand/usb test loader into its own directory. 2018-02-07 19:20:59 +00:00
userboot libsa: Const-ify buffer argument of write(2) analog 2018-02-23 20:18:09 +00:00
zfs libsa: Const-ify buffer argument of write(2) analog 2018-02-23 20:18:09 +00:00
zfs32
defs.mk Add NO_OBJ to those directories that don't make anything. 2018-02-26 03:16:04 +00:00
fdt.mk
ficl.mk Now that we no longer conditionally compile some files outside of ficl 2018-02-02 15:01:54 +00:00
loader.mk Consolidate three copies of ZFS commands into a central location. 2018-02-21 15:57:36 +00:00
lua.mk Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
Makefile Create LOADER_UBOOT, and LOADER_OFW. Move these options out of 2018-03-01 19:50:55 +00:00
Makefile.amd64 Create LOADER_UBOOT, and LOADER_OFW. Move these options out of 2018-03-01 19:50:55 +00:00
Makefile.inc Minor flags cleanup 2017-12-02 00:06:58 +00:00
uboot.mk Unify metadata load files for arm, mips, powerpc, sparc64 2018-02-13 03:44:50 +00:00