fragstoblks()
blkstofrags()
fragnum()
blknum()
to finish the job of distinguishing them from the lfs versions, which
Christos renamed the other day.
I believe this is the last of the overtly ambiguous exported symbols
from ffs... or at least, the last of the ones that conflicted with lfs.
ffs still pollutes the C namespace very broadly (as does ufs) and this
needs quite a bit more cleanup.
XXX: boo on macros with lowercase names. But I'm not tackling that just yet.
MAXDIRSIZE -> UFS_MAXDIRSIZE or LFS_MAXDIRSIZE
NINDIR -> FFS_NINDIR, EXT2_NINDIR, LFS_NINDIR, or MFS_NINDIR
INOPB -> FFS_INOPB, LFS_INOPB
INOPF -> FFS_INOPF, LFS_INOPF
blksize -> ffs_blksize, ext2_blksize, or lfs_blksize
sblksize -> ffs_blksize
These are not the only ambiguously defined filesystem macros, of
course, there's a pile more. I may not have found all the ambiguous
definitions of blksize(), too, as there are a lot of other things
called 'blksize' in the system.
pollution. Specifically:
ROOTINO -> UFS_ROOTINO
WINO -> UFS_WINO
NXADDR -> UFS_NXADDR
NDADDR -> UFS_NDADDR
NIADDR -> UFS_NIADDR
MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)
Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.
No functional change intended.
host, and vice versa), to fix PR#44203.
Add support for growing (but not yet shrinking) UFS2 file systems. Partially
addresses PR#44205.
While I'm here, reformat the code for closer adherence to KNF.
Fairly extensive testing was performed, using the shortly-to-be-committed
updated ATF tests. Patch posted to tech-userlevel on 21 December 2010,
no comments.
unsupported, while catching up to some changes in my local tree which
will hopefully support them at some time in the future.
Also, change "device" variable to "special", to reflect the fact
that resize_ffs will work on a plain file.
and depending on file system data, can actually be a false error.
Fixes what I was actually testing for in bin/44209, though the
actual problem was not what I originally described.
copy appropriate data to where they are expected in the updated superblock.
When writing the updated superblock, move the updated values back to the
old ffsv1 superblock locations. Also check for old superblock format when
updating the last cylinder group and adjust cg_old_ncyl appropriately.
Derived from how mksf sets them. Should address PR bin/44209.
to ensure it's been properly extended. Clears up some problems at certain
blocksizes which showed up during creation of atf tests, which is done
using file-backed file systems.
when testing that the last sector of the new size is writeable, make
sure we're ACTUALLY writing in the new space, instead of possibly
overwriting something in the existing fs.
Discovered while writing tests - tests which uncovered file corruption at
certain block sizes.
XXX should rewrite writeat() to expect fs blocks instead of disk blocks.
OK mlelstv@
- sync usage comment with current reality
- sort includes
- wrap lines
- use EXIT_FAILURE consistently
- make error messages consistent: Cannot->Can't
- Remove "Old FFSv1 macros" in favor of system macros in ufs/ffs/fs.h .
Leave dblksize() because it uses the on-disk dinode structure.
More cleanup is needed.
No functional changes intended.
were commented out with XXX and a notation to "fix once fsck is fixed."
fsck seems to have been fixed for this particular issue sometime in the
7 years since the code was brought into the tree.
Update cg_old_niblk instead of cg_ni_blk, since this tool
currently supports ffsv1 only.
With these two changes, I can grow a file system and have the result
be clean according to fsck_ffs. Shrinking still results in an unclean
file system.
OK mhitch@
While I'm here, fix a typo in an error message.
filesystem on a vnd partition for me. It did grow the filesystem, and after
a fsck -f on the partition to fix a few superblock inconsistencies, all
looks good.