Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/ext2fs/ext2_vfsops.c
Show First 20 Lines • Show All 918 Lines • ▼ Show 20 Lines | "WARNING: R/W mount denied. Filesystem is not clean - run fsck\n"); | ||||
/* | /* | ||||
* Calculate the maximum contiguous blocks and size of cluster summary | * Calculate the maximum contiguous blocks and size of cluster summary | ||||
* array. In FFS this is done by newfs; however, the superblock | * array. In FFS this is done by newfs; however, the superblock | ||||
* in ext2fs doesn't have these variables, so we can calculate | * in ext2fs doesn't have these variables, so we can calculate | ||||
* them here. | * them here. | ||||
*/ | */ | ||||
e2fs_maxcontig = MAX(1, maxphys / ump->um_e2fs->e2fs_bsize); | e2fs_maxcontig = MAX(1, maxphys / ump->um_e2fs->e2fs_bsize); | ||||
ump->um_e2fs->e2fs_contigsumsize = MIN(e2fs_maxcontig, EXT2_MAXCONTIG); | ump->um_e2fs->e2fs_contigsumsize = MIN(e2fs_maxcontig, EXT2_MAXCONTIG); | ||||
ump->um_e2fs->e2fs_maxsymlinklen = EXT2_MAXSYMLINKLEN; | |||||
if (ump->um_e2fs->e2fs_contigsumsize > 0) { | if (ump->um_e2fs->e2fs_contigsumsize > 0) { | ||||
size = ump->um_e2fs->e2fs_gcount * sizeof(int32_t); | size = ump->um_e2fs->e2fs_gcount * sizeof(int32_t); | ||||
ump->um_e2fs->e2fs_maxcluster = malloc(size, M_EXT2MNT, M_WAITOK); | ump->um_e2fs->e2fs_maxcluster = malloc(size, M_EXT2MNT, M_WAITOK); | ||||
size = ump->um_e2fs->e2fs_gcount * sizeof(struct csum); | size = ump->um_e2fs->e2fs_gcount * sizeof(struct csum); | ||||
ump->um_e2fs->e2fs_clustersum = malloc(size, M_EXT2MNT, M_WAITOK); | ump->um_e2fs->e2fs_clustersum = malloc(size, M_EXT2MNT, M_WAITOK); | ||||
lp = ump->um_e2fs->e2fs_maxcluster; | lp = ump->um_e2fs->e2fs_maxcluster; | ||||
sump = ump->um_e2fs->e2fs_clustersum; | sump = ump->um_e2fs->e2fs_clustersum; | ||||
for (i = 0; i < ump->um_e2fs->e2fs_gcount; i++, sump++) { | for (i = 0; i < ump->um_e2fs->e2fs_gcount; i++, sump++) { | ||||
Show All 17 Lines | "WARNING: R/W mount denied. Filesystem is not clean - run fsck\n"); | ||||
if (ronly == 0) { | if (ronly == 0) { | ||||
fs->e2fs_fmod = 1; /* mark it modified and set fs invalid */ | fs->e2fs_fmod = 1; /* mark it modified and set fs invalid */ | ||||
fs->e2fs->e2fs_state = | fs->e2fs->e2fs_state = | ||||
htole16(le16toh(fs->e2fs->e2fs_state) & ~E2FS_ISCLEAN); | htole16(le16toh(fs->e2fs->e2fs_state) & ~E2FS_ISCLEAN); | ||||
} | } | ||||
mp->mnt_data = ump; | mp->mnt_data = ump; | ||||
mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); | mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); | ||||
mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; | mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; | ||||
mp->mnt_maxsymlinklen = EXT2_MAXSYMLINKLEN; | |||||
MNT_ILOCK(mp); | MNT_ILOCK(mp); | ||||
mp->mnt_flag |= MNT_LOCAL; | mp->mnt_flag |= MNT_LOCAL; | ||||
MNT_IUNLOCK(mp); | MNT_IUNLOCK(mp); | ||||
ump->um_mountp = mp; | ump->um_mountp = mp; | ||||
ump->um_dev = dev; | ump->um_dev = dev; | ||||
ump->um_devvp = devvp; | ump->um_devvp = devvp; | ||||
ump->um_bo = vp2bo(devvp); | ump->um_bo = vp2bo(devvp); | ||||
ump->um_cp = cp; | ump->um_cp = cp; | ||||
▲ Show 20 Lines • Show All 483 Lines • Show Last 20 Lines |