PERFORCE change 181362 for review
Zheng Liu
lz at FreeBSD.org
Fri Jul 23 11:52:34 UTC 2010
http://p4web.freebsd.org/@@181362?ac=10
Change 181362 by lz at gnehzuil-freebsd on 2010/07/23 11:51:52
Make ext2fs support EXTRA_ISIZE feature.
* support feautres:
+ HAS_JOURNAL (Not support this feautre. It just can read
data when file system is with this feature.)
+ FILETYPE
+ SPARSE_SUPER
+ HUGE_FILE
+ EXTENTS (Now it just can read data from ext4 extents.)
+ DIR_NLINK
+ UNINIT_BG (It don't be required in read-only mode.)
+ FLEX_BG (It don't be required in read-only mode.)
+ EXTRA_ISIZE (It don't be required in read-only mode.)
Affected files ...
.. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_vfsops.c#9 edit
.. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2fs.h#5 edit
Differences ...
==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_vfsops.c#9 (text+ko) ====
@@ -64,6 +64,7 @@
#include <fs/ext2fs/fs.h>
#include <fs/ext2fs/ext2_extern.h>
#include <fs/ext2fs/ext2fs.h>
+#include <fs/ext2fs/ext2_dinode.h>
static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td);
static int ext2_mountfs(struct vnode *, struct mount *);
@@ -404,6 +405,27 @@
fs->e2fs_maxfilesize = 0x7fffffff;
else
fs->e2fs_maxfilesize = 0x7fffffffffffffff;
+
+ /* check inode size */
+ if (fs->e2fs_isize > E2FS_REV0_INODE_SIZE) {
+ fs->e2fs_want_extra_isize = sizeof(struct ext2fs_dinode) -
+ E2FS_REV0_INODE_SIZE;
+
+ if (es->e2fs_features_rocompat & EXT4F_ROCOMPAT_EXTRA_ISIZE) {
+ if (fs->e2fs_want_extra_isize < es->e2fs_want_extra_isize)
+ fs->e2fs_want_extra_isize = es->e2fs_want_extra_isize;
+ if (fs->e2fs_want_extra_isize < es->e2fs_min_extra_isize)
+ fs->e2fs_want_extra_isize = es->e2fs_min_extra_isize;
+ }
+ }
+
+ if (E2FS_REV0_INODE_SIZE + fs->e2fs_want_extra_isize >
+ fs->e2fs_isize) {
+ printf("EXT2-fs: no space for extra inode.\n");
+ return (EIO);
+ }
+
+
return (0);
}
==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2fs.h#5 (text+ko) ====
@@ -221,6 +221,9 @@
u_int8_t e2fs_log_gpf; /* FLEX_BG group size */
int e2fs_descpbbits;
struct ext4_flex_groups *e2fs_fg;
+
+ u_int16_t e2fs_min_extra_isize; /* all inodes have at least some bytes */
+ u_int16_t e2fs_want_extra_isize; /* new inodes should reserve some bytes */
};
/*
More information about the p4-projects
mailing list