kernel - Rejigger mount code to add vfs_flags in struct vfsops * Rejigger the mount code so we can add a vfs_flags field to vfsops, which mount_init() has visibility to. * Allows nullfs to flag that its mounts do not need a syncer thread. Previously nullfs would destroy the syncer thread after the fact. * Improves dsynth performance (it does lots of nullfs mounts).
kernel - Fix improper mplock in mount path * VFS_MOUNT() was being called before MNTK_ALL_MPSAFE could be set by the filesystem, causing the operation to run with the MP token held. * Add VFCF_MPSAFE to the vfsconf flags and specify it for MPSAFE filesystems in their VFS_SET() specification. This flag causes MNTK_ALL_MPSAFE to be set in mount->mnt_kern_flags prior to the VFS_MOUNT() call. Set this flag for devfs, procfs, tmpfs, nullfs, hammer, and hammer2. * Primarily effects synth or other bulk-builds which do a lot of mounting.
hammer - Remove global VOP counters * Remove global VOP counters. These were only used for debugging. Removing these globals significantly improves concurrent VOP operations on multi-core systems, particularly multi-socket systems, by removing a cache ping-pong bottleneck. Discussed-with: Mateusz Guzik (mjg_)
build - Rewire secure, remove conflicts from libmd, libcrypt * Remove /usr/src/secure, folding all of its subsystems into /usr/src. There's no point having a /usr/src/secure any more, the system won't run without the secure stuff, the idea that some foreign actor could segregate it in order to legally download code without crypto is absurd on the modern internet, and the U.S. government stopped caring decades ago. * Remove conflicts from libmd and libcrypt. Essentially this removes the SHA*_*() and MD5_*() APIs from libmd because these APIs already exist in lib[re]ssl. The older SHA*() and MD5*() APIs are partially retained for legacy base code, but will be removed in a later stage (moved to direct-linking the needed support source). Conflicting routines in libcrypt have been renamed and internalized to be libcrypt-only. * Major rewiring of the Makefile's to support the changes.
kernel - Rename desiredvnodes to maxvnodes, fix deadlock * Rename the kernel variable 'desiredvnodes' to 'maxvnodes' to match the sysctl name (which has always been 'maxvnodes'), and to make the code more readable. * Probable fix to a rare mount/umount deadlock which can occur in two situations (1) When a large number of mounts and unmounts are running concurrently, and (2) During a umount -a, shutdown, or reboot. * Considered minor, normal use cases will not reproduce this bug. Only synth or poudriere can generate the mount/umount traffic necessary to reproduce this bug. * Also fixes a minor kernel memory leak of the mount structure which can occur when a 'df' or filesystem sync races a umount. Also minor. Reported-by: marino (mount race)
hammer - Make vfs.hammer.cluster_enable an integer * Instead of being a boolean, make it an integer and use it to control how much read-ahead is requested (in 64KB blocks). * Change cluster_enable from 1 to 2 to roughly match the cluster_read() changes committed to the kernel. * Make hammer_io_indirect_read() use cluster_readcb() instead of breadcb() so we get read-ahead on this path.
sys/vfs/hammer: Don't store negative free/avail for statfs/statvfs f_bfree and f_bavail (these two equal on HAMMER) are likely to be negative when the filesystem usage has reached its limit or almost reaches limit. There is no point in having negative values by using internally reserved size (means not physically finalized with actual data), so force 0 instead of -. Note that this doesn't fix ENOSPC issues. -- before this commit # df -T /HAMMER Filesystem Type 1K-blocks Used Avail Capacity Mounted on TEST hammer 116359168 116363168 -4000 100% /HAMMER -- with this commit # df -T /HAMMER Filesystem Type 1K-blocks Used Avail Capacity Mounted on TEST hammer 116359168 116359168 0 100% /HAMMER
sys/vfs/hammer: Rename ondisk vol_name to vol_label Ondisk volume header having a field named vol_name for a label (not a block device path) is confusing, especially when inmemory volume structure has vol_name for a block device but not a label. There is even a kprintf message wrongly using ondisk vol_name as a block device path, as well as some comments saying vol_name is a filesystem label but not a path, which implies the name was misleading. This commit changes ondisk vol_name to vol_label. This commit also changes vol_name in struct hammer_ioc_info to vol_label. Outbox userspace programs using these two will see compile error after this commit (which I doubt there is any...). This commit doesn't break binaries. Note that vol_name in struct libhammer_fsinfo is unchanged.
sys/vfs/hammer: Add lo_to_pfs()/pfs_to_lo() macros These macros hide 16 bits shift and cast to int/uint32_t that are necessary on localization to/from PFS id conversion. Some code are better without details being hidden by macros, but this seems to be more readable with x_to_y macros that hide bunch of >>16, <<16, and casts. (No diff in binary on x86_64/gcc5)
sys/vfs/hammer: Remove unused global variables and sysctls Remove the following entries that aren't used for anything. These are mostly from the early stage of hammer development and no longer used. vfs.hammer.debug_recover_faults vfs.hammer.write_mode vfs.hammer.zone_limit