freebsd-dev/stand/libsa
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
..
amd64
i386
mips
powerpc
sparc64
__main.c
abort.c Implement abort() as a call to panic. 2018-01-26 17:13:04 +00:00
arp.c libsa: Consolidate tftp sendrecv into net.c sendrecv 2018-02-15 19:49:15 +00:00
assert.c
bcd.c
bootp.c libsa: Consolidate tftp sendrecv into net.c sendrecv 2018-02-15 19:49:15 +00:00
bootp.h dhcp_try_rfc1048() is not used any more 2017-12-06 06:49:53 +00:00
bootparam.c
bootparam.h
bzipfs.c
cd9660.c libsa: replace remaining _write callbacks by null_write 2018-02-27 12:53:25 +00:00
close.c
closeall.c
crc32.c
crc32.h
dev.c
dosfs.c
dosfs.h
environment.c getenv does not return tainted data in the boot loader. Attempt to 2018-01-23 18:01:36 +00:00
ether.c
ext2fs.c
fstat.c
getopt.c
gets.c
globals.c
gpt.c Remove the 'mini libstand in libstand' that util.[ch] provided. These 2017-12-15 23:16:53 +00:00
gpt.h
gzipfs.c
in_cksum.c
inet_ntoa.c
ioctl.c
iodesc.h
ip.c libsa: Fix IP recv timeout 2018-02-14 15:40:13 +00:00
libsa.3 Move libstand.3 to libsa.3. Update libsa.3 to include functions 2018-01-31 04:29:05 +00:00
lseek.c
Makefile Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
Makefile.depend
nandfs.c
net.c libsa: Partially revert r330023 2018-02-26 18:24:24 +00:00
net.h libsa: Move MAXWAIT from net.h to net.c 2018-02-26 18:14:37 +00:00
netif.c
netif.h
nfs.c libsa: Const-ify buffer argument of write(2) analog 2018-02-23 20:18:09 +00:00
nfsv2.h
nullfs.c libsa: replace remaining _write callbacks by null_write 2018-02-27 12:53:25 +00:00
open.c
pager.c
panic.c Split panic routine 2018-01-26 17:13:00 +00:00
pkgfs.c
printf.c
qdivrem.c
quad.h
random.c Fix random() and srandom() prototypes to match the standard. 2017-12-02 00:07:19 +00:00
rarp.c libsa: Consolidate tftp sendrecv into net.c sendrecv 2018-02-15 19:49:15 +00:00
read.c
readdir.c
rpc.c libsa: Consolidate tftp sendrecv into net.c sendrecv 2018-02-15 19:49:15 +00:00
rpc.h
rpcv2.h
saioctl.h
sbrk.c Panic in sbrk if setheap hasn't been called yet. This is preferable to 2017-12-15 23:16:47 +00:00
splitfs.c
stand.h liblua: Implement write support 2018-02-24 02:57:24 +00:00
stat.c
strcasecmp.c
strdup.c
strerror.c
tftp.c libsa: replace remaining _write callbacks by null_write 2018-02-27 12:53:25 +00:00
tftp.h
twiddle.c
udp.c
ufs.c This change is some refactoring of Mark Johnston's changes in r329375 2018-03-02 04:34:53 +00:00
ufsread.c
uuid_from_string.c
uuid_to_string.c
write.c libsa: Const-ify buffer argument of write(2) analog 2018-02-23 20:18:09 +00:00
xlocale_private.h Kill copies of strtol and strtoul. Use the ones that are in libc, 2018-01-31 04:29:00 +00:00
zalloc_defs.h
zalloc_malloc.c
zalloc_mem.h
zalloc_protos.h
zalloc.c