freebsd-skq/sys
mckusick ea7d671565 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 Rationalize license text on Linuxolator files 2018-03-01 13:52:18 +00:00
arm Revert r328964: if_awg: Skip emac reset if configured for internal PHY 2018-02-28 20:51:21 +00:00
arm64 Allow releasing APs to take more time, as long as we are making progress. 2018-02-28 16:03:40 +00:00
bsm sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
cam Use bool instead of int for predicate functions relating to work 2018-02-23 16:06:54 +00:00
cddl add ZFS_ENTER protection to .zfs/snapshot vnode operations that need it 2018-02-27 14:08:54 +00:00
compat Rationalize license text on Linuxolator files 2018-03-01 13:52:18 +00:00
conf PowerNV: Initial support for OPAL I2C transfers 2018-03-01 14:11:07 +00:00
contrib Define CK_MD_TSO for the relevant arches (i386, amd64 and sparc64). 2018-02-16 17:50:06 +00:00
crypto Remove unused error return from API that cannot fail 2018-02-23 20:15:19 +00:00
ddb Implement 'domainset', a cpuset based NUMA policy mechanism. This allows 2018-01-12 22:48:23 +00:00
dev Add a function to retrieve the EFI realtime clock capabilities. 2018-03-01 22:57:14 +00:00
dts Switch to mainstream DTS for Raspberry Pi-B and Pi-2. 2018-02-27 15:01:17 +00:00
fs {ext2|ufs}_readdir: Avoid setting negative ncookies. 2018-02-06 22:38:19 +00:00
gdb sys/gdb: further adoption of SPDX licensing ID tags. 2017-11-27 15:16:59 +00:00
geom This change is some refactoring of Mark Johnston's changes in r329375 2018-03-02 04:34:53 +00:00
gnu bwn(4): txpid2g/txpid5g[lh] are not defined after sromrev 7; the default 2018-02-13 17:43:54 +00:00
i386 Remove unused error return from API that cannot fail 2018-02-23 20:15:19 +00:00
isa Add ISA PNP tables to ISA drivers. Fix a few incidental comments. 2018-01-29 00:22:30 +00:00
kern Don't generate data in sysctl_out_proc unless we intend to copy out. 2018-02-25 15:16:58 +00:00
kgssapi kgssapi: Remove trivial deadcode 2018-02-14 00:12:03 +00:00
libkern iconv uses strlen directly on user supplied memory 2018-02-26 18:23:36 +00:00
mips Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
modules Add a SPI driver for imx5 and imx6. 2018-02-26 02:28:32 +00:00
net pf: Cope with overly large net.pf.states_hashsize 2018-02-25 08:56:44 +00:00
net80211 net80211: sanitize input for ieee80211_output() 2017-12-30 00:40:34 +00:00
netgraph Correct pseudo misspelling in sys/ comments 2018-02-23 18:15:50 +00:00
netinet When checking the TCP fast cookie length, conststently also check 2018-02-27 22:12:38 +00:00
netinet6 Update the MTU in affected routes when IPv6 RA changes the MTU 2018-02-12 19:49:20 +00:00
netipsec Remove unused variables and sysctl declaration. 2018-02-19 12:20:51 +00:00
netpfil pf: Cope with overly large net.pf.states_hashsize 2018-02-25 08:56:44 +00:00
netsmb Unsign some values related to allocation. 2018-01-22 02:08:10 +00:00
nfs Modernize nfssvc(2) registartion. 2018-02-08 20:09:42 +00:00
nfsclient style: Remove remaining deprecated MALLOC/FREE macros 2018-01-25 22:25:13 +00:00
nfsserver sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
nlm Use syscall_helper_register() to register syscalls and initialize though 2018-02-10 01:09:22 +00:00
ofed Import the mthca kernel side infiniband driver from Linux 4.9 and fix 2018-02-13 17:04:34 +00:00
opencrypto Move per-operation data out of the csession structure. 2018-01-26 23:21:50 +00:00
powerpc PowerNV: Initial support for OPAL I2C transfers 2018-03-01 14:11:07 +00:00
riscv Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
rpc Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
security mac_portacl(4): stop panicing INVARIANTS-enabled kernel by loading .ko 2018-02-25 23:10:13 +00:00
sparc64 Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
sys Add a function to retrieve the EFI realtime clock capabilities. 2018-03-01 22:57:14 +00:00
teken sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
tests
tools Avoid using \$. It's an unknown escape sequence. Some awks warn about 2018-01-28 05:13:08 +00:00
ufs This change is some refactoring of Mark Johnston's changes in r329375 2018-03-02 04:34:53 +00:00
vm Give the 0th domain's page daemon thread a consistent name. 2018-02-27 16:51:09 +00:00
x86 Correct pseudo misspelling in sys/ comments 2018-02-23 18:15:50 +00:00
xdr sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
xen sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
Makefile