Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/ext2fs/ext2_vfsops.c
Show First 20 Lines • Show All 767 Lines • ▼ Show 20 Lines | MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { | ||||
error = bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), | error = bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), | ||||
(int)fs->e2fs_bsize, NOCRED, &bp); | (int)fs->e2fs_bsize, NOCRED, &bp); | ||||
if (error) { | if (error) { | ||||
VOP_UNLOCK(vp, 0); | VOP_UNLOCK(vp, 0); | ||||
vrele(vp); | vrele(vp); | ||||
MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); | MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); | ||||
return (error); | return (error); | ||||
} | } | ||||
ext2_ei2i((struct ext2fs_dinode *)((char *)bp->b_data + | |||||
error = ext2_ei2i((struct ext2fs_dinode *)((char *)bp->b_data + | |||||
EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)), ip); | EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)), ip); | ||||
brelse(bp); | brelse(bp); | ||||
VOP_UNLOCK(vp, 0); | VOP_UNLOCK(vp, 0); | ||||
vrele(vp); | vrele(vp); | ||||
if (error) { | |||||
MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); | |||||
return (error); | |||||
} | } | ||||
} | |||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Common code for mount and mountroot. | * Common code for mount and mountroot. | ||||
*/ | */ | ||||
static int | static int | ||||
ext2_mountfs(struct vnode *devvp, struct mount *mp) | ext2_mountfs(struct vnode *devvp, struct mount *mp) | ||||
▲ Show 20 Lines • Show All 413 Lines • ▼ Show 20 Lines | if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), | ||||
vput(vp); | vput(vp); | ||||
*vpp = NULL; | *vpp = NULL; | ||||
return (error); | return (error); | ||||
} | } | ||||
/* convert ext2 inode to dinode */ | /* convert ext2 inode to dinode */ | ||||
error = ext2_ei2i((struct ext2fs_dinode *)((char *)bp->b_data + | error = ext2_ei2i((struct ext2fs_dinode *)((char *)bp->b_data + | ||||
EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ino)), ip); | EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ino)), ip); | ||||
if (error) { | if (error) { | ||||
printf("ext2fs: Bad inode %lu csum - run fsck\n", | |||||
(unsigned long)ino); | |||||
brelse(bp); | brelse(bp); | ||||
vput(vp); | vput(vp); | ||||
*vpp = NULL; | *vpp = NULL; | ||||
return (error); | return (error); | ||||
} | } | ||||
ip->i_block_group = ino_to_cg(fs, ino); | ip->i_block_group = ino_to_cg(fs, ino); | ||||
ip->i_next_alloc_block = 0; | ip->i_next_alloc_block = 0; | ||||
ip->i_next_alloc_goal = 0; | ip->i_next_alloc_goal = 0; | ||||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |