third_party_f2fs-tools/fsck
Chao Yu dad33a1ee7 f2fs-tools: enhance on-disk inode structure scalability
This patch adds an option 'extra_attr' in mkfs for enabling v2 f2fs
inode format in kernel codes.

Also this patch makes fsck to support recognize v2 inode format,
below is v2 format description:

Original one:

struct f2fs_inode {
	...
	struct f2fs_extent i_ext;
	__le32 i_addr[DEF_ADDRS_PER_INODE];
	__le32 i_nid[DEF_NIDS_PER_INODE];
}

Extended one:

struct f2fs_inode {
        ...
        struct f2fs_extent i_ext;
	union {
		struct {
			__le16 i_extra_isize;
			__le16 i_padding;
			__le32 i_extra_end[0];
		};
		__le32 i_addr[DEF_ADDRS_PER_INODE];
	};
        __le32 i_nid[DEF_NIDS_PER_INODE];
}

Once F2FS_EXTRA_ATTR is set, we will steal four bytes in the head of
i_addr field for storing i_extra_isize and i_padding. with i_extra_isize,
we can calculate actual size of reserved space in i_addr, available
attribute fields included in total extra attribute fields for current
inode can be described as below:

  +--------------------+
  | .i_mode            |
  | ...                |
  | .i_ext             |
  +--------------------+
  | .i_extra_isize     |-----+
  | .i_padding         |     |
  | .i_prjid           |     |
  | .i_atime_extra     |     |
  | .i_ctime_extra     |     |
  | .i_mtime_extra     |<----+
  | .i_inode_cs        |<----- store blkaddr/inline from here
  | .i_xattr_cs        |
  | ...                |
  +--------------------+
  |                    |
  |    block address   |
  |                    |
  +--------------------+
  | .i_nid             |
  +--------------------+
  |   node_footer      |
  | (nid, ino, offset) |
  +--------------------+

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2017-07-26 11:42:49 -07:00
..
defrag.c defrag.f2fs: return error for no space case 2016-11-02 18:01:55 -07:00
dir.c f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
dump.c f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
f2fs.h f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
fsck.c f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
fsck.h f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
main.c f2fs-tools: avoid build warnings 2017-06-05 13:58:50 -07:00
Makefile.am sload.f2fs: support loading files into partition directly 2016-04-18 21:11:26 -04:00
mount.c f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
node.c f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
node.h f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
resize.c mkfs.f2fs: support nat_bits feature 2017-02-23 10:11:41 -08:00
segment.c f2fs-tools: enhance on-disk inode structure scalability 2017-07-26 11:42:49 -07:00
sload.c sload.f2fs: allow to build without libselinux 2016-10-23 14:36:49 -07:00
xattr.c sload.f2fs: support loading files into partition directly 2016-04-18 21:11:26 -04:00
xattr.h fsck.f2fs: remove duplicated header files 2016-11-28 21:26:15 -08:00