diff options
author | pfg <pfg@FreeBSD.org> | 2013-02-02 22:23:45 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-02-02 22:23:45 +0000 |
commit | e94b41487b15810ca86ef4cf9a1cacddd428846d (patch) | |
tree | fae557b6c70ee080d74d079cff333d22b4435bb8 /sys/fs/ext2fs/ext2_vfsops.c | |
parent | fb83414a6ee4316b1c8a79da870c9c6e453535a6 (diff) | |
download | FreeBSD-src-e94b41487b15810ca86ef4cf9a1cacddd428846d.zip FreeBSD-src-e94b41487b15810ca86ef4cf9a1cacddd428846d.tar.gz |
ext2fs: general cleanup.
- Remove unused extern declarations in fs.h
- Correct comments in ext2_dir.h
- Several panic() messages showed wrong function names.
- Remove commented out stray line in ext2_alloc.c.
- Remove the unused macro EXT2_BLOCK_SIZE_BITS() and the then
write-only member e2fs_blocksize_bits from struct m_ext2fs.
- Remove the unused macro EXT2_FIRST_INO() and the then write-only
member e2fs_first_inode from struct m_ext2fs.
- Remove EXT2_DESC_PER_BLOCK() and the member e2fs_descpb from
struct m_ext2fs.
- Remove the unused members e2fs_bmask, e2fs_dbpg and
e2fs_mount_opt from struct m_ext2fs
- Correct harmless off-by-one error for fspath in ext2_vfsops.c.
- Remove the unused and broken macros EXT2_ADDR_PER_BLOCK_BITS()
and EXT2_DESC_PER_BLOCK_BITS().
- Remove the !_KERNEL versions of the EXT2_* macros.
Submitted by: Christoph Mallon
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/ext2fs/ext2_vfsops.c')
-rw-r--r-- | sys/fs/ext2fs/ext2_vfsops.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index 3f181fd..136f01c 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -127,7 +127,7 @@ ext2_mount(struct mount *mp) vfs_getopt(opts, "fspath", (void **)&path, NULL); /* Double-check the length of path.. */ - if (strlen(path) >= MAXMNTLEN - 1) + if (strlen(path) >= MAXMNTLEN) return (ENAMETOOLONG); fspec = NULL; @@ -318,12 +318,12 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es, int i; int logic_sb_block = 1; /* XXX for now */ struct buf *bp; + uint32_t e2fs_descpb; fs->e2fs_bsize = EXT2_MIN_BLOCK_SIZE << es->e2fs_log_bsize; fs->e2fs_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->e2fs_log_bsize; fs->e2fs_fsbtodb = es->e2fs_log_bsize + 1; fs->e2fs_qbmask = fs->e2fs_bsize - 1; - fs->e2fs_blocksize_bits = es->e2fs_log_bsize + 10; fs->e2fs_fsize = EXT2_MIN_FRAG_SIZE << es->e2fs_log_fsize; if (fs->e2fs_fsize) fs->e2fs_fpb = fs->e2fs_bsize / fs->e2fs_fsize; @@ -331,10 +331,8 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es, fs->e2fs_fpg = es->e2fs_fpg; fs->e2fs_ipg = es->e2fs_ipg; if (es->e2fs_rev == E2FS_REV0) { - fs->e2fs_first_inode = EXT2_FIRSTINO; fs->e2fs_isize = E2FS_REV0_INODE_SIZE ; } else { - fs->e2fs_first_inode = es->e2fs_first_ino; fs->e2fs_isize = es->e2fs_inode_size; /* @@ -357,12 +355,11 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es, fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); fs->e2fs_itpg = fs->e2fs_ipg /fs->e2fs_ipb; - fs->e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); /* s_resuid / s_resgid ? */ fs->e2fs_gcount = (es->e2fs_bcount - es->e2fs_first_dblock + EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); - db_count = (fs->e2fs_gcount + EXT2_DESC_PER_BLOCK(fs) - 1) / - EXT2_DESC_PER_BLOCK(fs); + e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); + db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb; fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, M_EXT2MNT, M_WAITOK); @@ -766,7 +763,7 @@ ext2_statfs(struct mount *mp, struct statfs *sbp) ump = VFSTOEXT2(mp); fs = ump->um_e2fs; if (fs->e2fs->e2fs_magic != E2FS_MAGIC) - panic("ext2fs_statfs"); + panic("ext2_statfs"); /* * Compute the overhead (FS structures) |