makefs: clean up some leftovers after $FreeBSD$ tag removalFixes: 2a63c3be1582
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
Remove $FreeBSD$: one-line .c patternRemove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
Remove $FreeBSD$: one-line .h patternRemove /^\s*\*+\s*\$FreeBSD\$.*$\n/
Remove $FreeBSD$: two-line .h patternRemove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
ffs: restore backward compatibility of newfs and makefs with older binariesThe previous change to CGSIZE had the unintended side-effect of allowingnewfs and makefs to create file systems that woul
ffs: restore backward compatibility of newfs and makefs with older binariesThe previous change to CGSIZE had the unintended side-effect of allowingnewfs and makefs to create file systems that would fail validation whenexamined by older commands and kernels, by allowing newfs/makefs to packslightly more blocks into a CG than those older binaries think is valid.Fix this by having newfs/makefs artificially restrict the number of blocksin a CG to the slightly smaller value that those older binaries will accept.The validation code will continue to accept the slightly larger valuethat the current newfs/makefs (before this change) could create.Fixes: 0a6e34e950cd5889122a199c34519b67569be9ccReviewed by: mckusickMFC after: 3 daysSponsored by: Netflix
show more ...
Fix size differences between architectures of the UFS/FFS CGSIZE macro value.The cylinder group header structure ended with `u_int8_t cg_space[1]'representing the beginning of the inode bitmap arr
Fix size differences between architectures of the UFS/FFS CGSIZE macro value.The cylinder group header structure ended with `u_int8_t cg_space[1]'representing the beginning of the inode bitmap array. Some architectureslike the i386 rounded this up to a 4-byte boundry while otherarchitectures like the amd64 rounded it up to an 8-byte boundry.Thus sizeof(struct cg) was four bytes bigger on an amd64 machinethan on an i386 machine. If a filesystem created on an i386 machinewas moved to an amd64 machine, the size of the cylinder groupcalculated by the CGSIZE macro would appear to grow by four bytes.Filesystems whose cylinder groups were exactly equal to the blocksize on an i386 machine would appear to have a cylinder group thatwas four bytes too big when moved to an amd64 machine. Note thatalthough the structure appears to be too big, it in fact is fine.It is just the calaculation of its size that is in error.The fix is to remove the cg_space element from the cylinder-groupstructure so that the calculated size of the structure is the samesize on all architectures.Reported by: Tijl CoosemansTested by: Tijl Coosemans and Peter HolmMFC after: 1 weekSponsored by: The FreeBSD Foundation
spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDThe SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catchup to that fact and revert to their recommended match of BS
spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDThe SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catchup to that fact and revert to their recommended match of BSD-2-Clause.Discussed with: pfgMFC After: 3 daysSponsored by: Netflix
makefs: call brelse from breadThis matches NetBSD and rationalizes makefs with the kernel API.This reverts commit 370e009188ba90c3290b1479aa06ec98b66e140a.Reviewed by: mckusickSponsored by: Th
makefs: call brelse from breadThis matches NetBSD and rationalizes makefs with the kernel API.This reverts commit 370e009188ba90c3290b1479aa06ec98b66e140a.Reviewed by: mckusickSponsored by: The FreeBSD FoundationObtained from: NetBSD 0a62dad69f62, 0c4125e1a19f, cb6a5a3575fdDifferential Revision: https://reviews.freebsd.org/D39070
makefs: use %s and __func__ in printf messagesFor diff reduction against NetBSD.Obtained from: NetBSD 0c4125e1a19fSponsored by: The FreeBSD Foundation
makefs: use size_t or ssize_t where appropriateObtained from: NetBSD af7bc97830ac
makefs(8): do not print comma after the last super-blockReviewed by: markj, emasteMFC after: 1 weekDifferential Revision: https://reviews.freebsd.org/D39430
makefs: do not call brelse if bread returns an errorIf bread returns an error there is no bp to brelse. One of thesechanges was taken from NetBSD commit 0a62dad69f62 ("This works wellenough to p
makefs: do not call brelse if bread returns an errorIf bread returns an error there is no bp to brelse. One of thesechanges was taken from NetBSD commit 0a62dad69f62 ("This works wellenough to populate..."), the rest were found by looking for the samepattern.Reviewed by: impSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D39069
makefs: Ignore some sign comparison warnings from GCC.Reviewed by: markjDifferential Revision: https://reviews.freebsd.org/D37470
makefs: whitespace cleanup (remove space before tab)MFC after: 1 week
makefs(8): Fix a few typos in source code comments- s/concearned/concerned/- s/quadradically/quadratically/Obtained from: NetBSDMFC after: 3 days
ufs: Rework shortlink handling to avoid subobject overflowsShortlinks occupy the space of both di_db and di_ib when used. However,everywhere that wants to read or write a shortlink takes a pointer
ufs: Rework shortlink handling to avoid subobject overflowsShortlinks occupy the space of both di_db and di_ib when used. However,everywhere that wants to read or write a shortlink takes a pointer dodi_db and promptly runs off the end of it into di_ib. This is fine onmost architectures, if a little dodgy. However, on CHERI, the compilercan optionally restrict the bounds on pointers to subobjects to justthat subobject, in order to mitigate intra-object buffer overflows, andthis is enabled in CheriBSD's pure-capability kernels.Instead, clean this up by inserting a union such that a new di_shortlinkcan be added with the right size and element type, avoiding the need tocast and allowing the use of the DIP macro to access the field. Thisalso mirrors how the ext2fs code implements extents support, with theexact same structure other than having a uint32_t i_data[] instead of achar di_shortlink[].Reviewed by: mckusick, jhbDifferential Revision: https://reviews.freebsd.org/D33650
makefs: Cast daddr_t to off_t before multiplicationApparently some large-file systems out there, such as my powerpc64leLinux box, define daddr_t as a 32-bit type, which is sad and stymiescross-bu
makefs: Cast daddr_t to off_t before multiplicationApparently some large-file systems out there, such as my powerpc64leLinux box, define daddr_t as a 32-bit type, which is sad and stymiescross-building disk images. Cast daddr_t to off_t before doingarithmetic that overflows.Reviewed by: arichardson, jrtc27, impMFC after: 1 weekDifferential Revision: https://reviews.freebsd.org/D27458
Allocate extra inodes in makefs when leaving free space in UFS images.By default, makefs(8) has very few spare inodes in its output images,which is fine for static filesystems, but not so great fo
Allocate extra inodes in makefs when leaving free space in UFS images.By default, makefs(8) has very few spare inodes in its output images,which is fine for static filesystems, but not so great for VM imageswhere many more files will be added. Make makefs(8) use the samedefault settings as newfs(8) when creating images with free space --there isn't much point to leaving free space on the image if youcan't put files there. If no free space is requested, use currentbehavior of a minimal number of available inodes.Reviewed by: manuMFC after: 3 weeksDifferential Revision: https://reviews.freebsd.org/D29492
Remove #define _KERNEL hacks from libprocstatMake sys/buf.h, sys/pipe.h, sys/fs/devfs/devfs*.h headers usable inuserspace, assuming that the consumer has an idea what it is for.Unhide more materi
Remove #define _KERNEL hacks from libprocstatMake sys/buf.h, sys/pipe.h, sys/fs/devfs/devfs*.h headers usable inuserspace, assuming that the consumer has an idea what it is for.Unhide more material from sys/mount.h and sys/ufs/ufs/inode.h,sys/ufs/ufs/ufsmount.h for consumption of userspace tools, with thesame caveat.Remove unacceptable hack from usr.sbin/makefs which relied on sys/buf.hbeing unusable in userspace, where it override struct buf with its owndefinition. Instead, provide struct m_buf and struct m_vnode and adaptcode to use local variants.Reviewed by: mckusickTested by: phoSponsored by: The FreeBSD FoundationDifferential revision: https://reviews.freebsd.org/D28679
Fix -Wpointer-sign warnings in makefs and mkimgReviewed By: emasteDifferential Revision: https://reviews.freebsd.org/D27175
Allocate an fs_summary_info structure when creating a UFS filesystemneeded since introduced in -r362358.PR: 247425Sponsored by: Netflix
makefs: share denode.h between kernel msdosfs and makefsThere is no need to duplicate this file when it can be triviallyshared (just exposing sections previously under #ifdef _KERNEL).MFC with:
makefs: share denode.h between kernel msdosfs and makefsThere is no need to duplicate this file when it can be triviallyshared (just exposing sections previously under #ifdef _KERNEL).MFC with: r351273Differential Revision: The FreeBSD Foundation
makefs: use `char *` not `void *` for buf b_data, drop casts in msdos(The kernel uses caddr_t.)Suggested by: cemReviewed by: cemMFC with: r351273Sponsored by: The FreeBSD FoundationDifferenti
makefs: use `char *` not `void *` for buf b_data, drop casts in msdos(The kernel uses caddr_t.)Suggested by: cemReviewed by: cemMFC with: r351273Sponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D21348
makefs: use FreeBSD brelse function signatureAlthough the ffs (and later msdosfs) implementation in makefs isindependent of the one in kernel, it makes sense to keep differences toa minimum in or
makefs: use FreeBSD brelse function signatureAlthough the ffs (and later msdosfs) implementation in makefs isindependent of the one in kernel, it makes sense to keep differences toa minimum in order to ease comparison and porting changes across.Submitted by: Siva MahadevanSponsored by: The FreeBSD Foundation
123