diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2002-11-27 02:18:58 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2002-11-27 02:18:58 +0000 |
commit | ada981b228eba1fdb31f9817c015e69a757e1cb3 (patch) | |
tree | d1928be6bf74e88babe007808d7eaa98444918f3 /sbin/fsck_ffs | |
parent | bd32b70236011007576b1ce556b04eb22c759794 (diff) | |
download | src-ada981b228eba1fdb31f9817c015e69a757e1cb3.tar.gz src-ada981b228eba1fdb31f9817c015e69a757e1cb3.zip |
Create a new 32-bit fs_flags word in the superblock. Add code to move
the old 8-bit fs_old_flags to the new location the first time that the
filesystem is mounted by a new kernel. One of the unused flags in
fs_old_flags is used to indicate that the flags have been moved.
Leave the fs_old_flags word intact so that it will work properly if
used on an old kernel.
Change the fs_sblockloc superblock location field to be in units
of bytes instead of in units of filesystem fragments. The old units
did not work properly when the fragment size exceeeded the superblock
size (8192). Update old fs_sblockloc values at the same time that
the flags are moved.
Suggested by: BOUWSMA Barry <freebsd-misuser@netscum.dyndns.dk>
Sponsored by: DARPA & NAI Labs.
Notes
Notes:
svn path=/head/; revision=107294
Diffstat (limited to 'sbin/fsck_ffs')
-rw-r--r-- | sbin/fsck_ffs/fsutil.c | 4 | ||||
-rw-r--r-- | sbin/fsck_ffs/setup.c | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index 60b455bca2da..0ce866306d1c 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -296,9 +296,9 @@ ckfini(int markclean) } flush(fswritefd, &sblk); if (havesb && cursnapshot == 0 && sblock.fs_magic == FS_UFS2_MAGIC && - sblk.b_bno != fsbtodb(&sblock, sblock.fs_sblockloc) && + sblk.b_bno != sblock.fs_sblockloc / dev_bsize && !preen && reply("UPDATE STANDARD SUPERBLOCK")) { - sblk.b_bno = fsbtodb(&sblock, sblock.fs_sblockloc); + sblk.b_bno = sblock.fs_sblockloc / dev_bsize; sbdirty(); flush(fswritefd, &sblk); } diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index db9feb0874e5..87927dcaa950 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -313,8 +313,7 @@ readsb(int listerr) return (0); if ((sblock.fs_magic == FS_UFS1_MAGIC || (sblock.fs_magic == FS_UFS2_MAGIC && - sblock.fs_sblockloc == - numfrags(&sblock, sblock_try[i]))) && + sblock.fs_sblockloc == sblock_try[i])) && sblock.fs_ncg >= 1 && sblock.fs_bsize >= MINBSIZE && sblock.fs_bsize >= sizeof(struct fs)) |