version 1.377, 2022/11/10 10:53:29 |
version 1.378, 2022/11/17 06:40:40 |
Line 845 ffs_reload(struct mount *mp, kauth_cred_ |
|
Line 845 ffs_reload(struct mount *mp, kauth_cred_ |
|
|
|
brelse(bp, 0); |
brelse(bp, 0); |
|
|
|
/* Allow converting from UFS2 to UFS2EA but not vice versa. */ |
|
if (newfs->fs_magic == FS_UFS2EA_MAGIC) { |
|
ump->um_flags |= UFS_EA; |
|
newfs->fs_magic = FS_UFS2_MAGIC; |
|
} else { |
|
if ((ump->um_flags & UFS_EA) != 0) |
|
return EINVAL; |
|
} |
|
|
if ((newfs->fs_magic != FS_UFS1_MAGIC) && |
if ((newfs->fs_magic != FS_UFS1_MAGIC) && |
(newfs->fs_magic != FS_UFS2_MAGIC)) { |
(newfs->fs_magic != FS_UFS2_MAGIC)) { |
kmem_free(newfs, fs_sbsize); |
kmem_free(newfs, fs_sbsize); |
Line 1217 ffs_mountfs(struct vnode *devvp, struct |
|
Line 1226 ffs_mountfs(struct vnode *devvp, struct |
|
* size to read the superblock. Once read, we swap the whole |
* size to read the superblock. Once read, we swap the whole |
* superblock structure. |
* superblock structure. |
*/ |
*/ |
|
if (fs->fs_magic == FS_UFS2EA_MAGIC) { |
|
ump->um_flags |= UFS_EA; |
|
fs->fs_magic = FS_UFS2_MAGIC; |
|
} else if (fs->fs_magic == FS_UFS2EA_MAGIC_SWAPPED) { |
|
ump->um_flags |= UFS_EA; |
|
fs->fs_magic = FS_UFS2_MAGIC_SWAPPED; |
|
} |
if (fs->fs_magic == FS_UFS1_MAGIC) { |
if (fs->fs_magic == FS_UFS1_MAGIC) { |
fs_sbsize = fs->fs_sbsize; |
fs_sbsize = fs->fs_sbsize; |
fstype = UFS1; |
fstype = UFS1; |
Line 2375 ffs_sbupdate(struct ufsmount *mp, int wa |
|
Line 2391 ffs_sbupdate(struct ufsmount *mp, int wa |
|
memcpy(bp->b_data, fs, fs->fs_sbsize); |
memcpy(bp->b_data, fs, fs->fs_sbsize); |
|
|
ffs_oldfscompat_write((struct fs *)bp->b_data, mp); |
ffs_oldfscompat_write((struct fs *)bp->b_data, mp); |
|
if (mp->um_flags & UFS_EA) { |
|
struct fs *bfs = (struct fs *)bp->b_data; |
|
KASSERT(bfs->fs_magic == FS_UFS2_MAGIC); |
|
bfs->fs_magic = FS_UFS2EA_MAGIC; |
|
} |
#ifdef FFS_EI |
#ifdef FFS_EI |
if (mp->um_flags & UFS_NEEDSWAP) |
if (mp->um_flags & UFS_NEEDSWAP) |
ffs_sb_swap((struct fs *)bp->b_data, (struct fs *)bp->b_data); |
ffs_sb_swap((struct fs *)bp->b_data, (struct fs *)bp->b_data); |