diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-08-12 21:08:03 +0900 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2015-05-02 14:35:03 +0200 |
commit | 5195be67bd41fae65dbbf474729ea197613f25f1 (patch) | |
tree | d0e2e58b8cf8217327adb21080f34053ca09d347 /include/linux | |
parent | 0a98755405a938675b4d79514f9225020e3751ef (diff) | |
download | kernel_samsung_tuna-5195be67bd41fae65dbbf474729ea197613f25f1.zip kernel_samsung_tuna-5195be67bd41fae65dbbf474729ea197613f25f1.tar.gz kernel_samsung_tuna-5195be67bd41fae65dbbf474729ea197613f25f1.tar.bz2 |
f2fs: reserve the xattr space dynamically
This patch enables the number of direct pointers inside on-disk inode block to
be changed dynamically according to the size of inline xattr space.
The number of direct pointers, ADDRS_PER_INODE, can be changed only if the file
has inline xattr flag.
The number of direct pointers that will be used by inline xattrs is defined as
F2FS_INLINE_XATTR_ADDRS.
Current patch assigns F2FS_INLINE_XATTR_ADDRS to 0 temporarily.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/f2fs_fs.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index 10ab11f..93e7020 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h @@ -140,9 +140,17 @@ struct f2fs_extent { } __packed; #define F2FS_NAME_LEN 255 -#define ADDRS_PER_INODE 923 /* Address Pointers in an Inode */ -#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */ -#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */ +#define F2FS_INLINE_XATTR_ADDRS 0 /* 0 bytes for inline xattrs */ +#define DEF_ADDRS_PER_INODE 923 /* Address Pointers in an Inode */ +#define ADDRS_PER_INODE(fi) addrs_per_inode(fi) +#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */ +#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */ + +#define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1) +#define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2) +#define NODE_IND1_BLOCK (DEF_ADDRS_PER_INODE + 3) +#define NODE_IND2_BLOCK (DEF_ADDRS_PER_INODE + 4) +#define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) #define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ @@ -172,7 +180,7 @@ struct f2fs_inode { struct f2fs_extent i_ext; /* caching a largest extent */ - __le32 i_addr[ADDRS_PER_INODE]; /* Pointers to data blocks */ + __le32 i_addr[DEF_ADDRS_PER_INODE]; /* Pointers to data blocks */ __le32 i_nid[5]; /* direct(2), indirect(2), double_indirect(1) node id */ |