aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-09-03 13:10:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-09-03 13:10:28 -0400
commit70c8038dd698b44daf7c8fc7e2eca142bec694c4 (patch)
treeb1bbdfe2396d67e7862019512f3e5b436c360e7c /include/linux
parent5a147c9f57bab06183b2bdde78aa49f3e332a557 (diff)
parentb73e52824c8920a5ff754e3c8ff68466a7dd61f9 (diff)
Merge tag 'for-f2fs-3.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
Pull f2fs bug fixes from Jaegeuk Kim: "This series includes patches to: - fix recovery routines - fix bugs related to inline_data/xattr - fix when casting the dentry names - handle EIO or ENOMEM correctly - fix memory leak - fix lock coverage" * tag 'for-f2fs-3.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (28 commits) f2fs: reposition unlock_new_inode to prevent accessing invalid inode f2fs: fix wrong casting for dentry name f2fs: simplify by using a literal f2fs: truncate stale block for inline_data f2fs: use macro for code readability f2fs: introduce need_do_checkpoint for readability f2fs: fix incorrect calculation with total/free inode num f2fs: remove rename and use rename2 f2fs: skip if inline_data was converted already f2fs: remove rewrite_node_page f2fs: avoid double lock in truncate_blocks f2fs: prevent checkpoint during roll-forward f2fs: add WARN_ON in f2fs_bug_on f2fs: handle EIO not to break fs consistency f2fs: check s_dirty under cp_mutex f2fs: unlock_page when node page is redirtied out f2fs: introduce f2fs_cp_error for readability f2fs: give a chance to mount again when encountering errors f2fs: trigger release_dirty_inode in f2fs_put_super f2fs: don't skip checkpoint if there is no dirty node pages ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/f2fs_fs.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index 6ff0b0b42d47..08ed2b0a96e6 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -24,6 +24,9 @@
24#define NULL_ADDR ((block_t)0) /* used as block_t addresses */ 24#define NULL_ADDR ((block_t)0) /* used as block_t addresses */
25#define NEW_ADDR ((block_t)-1) /* used as block_t addresses */ 25#define NEW_ADDR ((block_t)-1) /* used as block_t addresses */
26 26
27/* 0, 1(node nid), 2(meta nid) are reserved node id */
28#define F2FS_RESERVED_NODE_NUM 3
29
27#define F2FS_ROOT_INO(sbi) (sbi->root_ino_num) 30#define F2FS_ROOT_INO(sbi) (sbi->root_ino_num)
28#define F2FS_NODE_INO(sbi) (sbi->node_ino_num) 31#define F2FS_NODE_INO(sbi) (sbi->node_ino_num)
29#define F2FS_META_INO(sbi) (sbi->meta_ino_num) 32#define F2FS_META_INO(sbi) (sbi->meta_ino_num)
@@ -87,6 +90,8 @@ struct f2fs_super_block {
87#define CP_ORPHAN_PRESENT_FLAG 0x00000002 90#define CP_ORPHAN_PRESENT_FLAG 0x00000002
88#define CP_UMOUNT_FLAG 0x00000001 91#define CP_UMOUNT_FLAG 0x00000001
89 92
93#define F2FS_CP_PACKS 2 /* # of checkpoint packs */
94
90struct f2fs_checkpoint { 95struct f2fs_checkpoint {
91 __le64 checkpoint_ver; /* checkpoint block version number */ 96 __le64 checkpoint_ver; /* checkpoint block version number */
92 __le64 user_block_count; /* # of user blocks */ 97 __le64 user_block_count; /* # of user blocks */
@@ -123,6 +128,9 @@ struct f2fs_checkpoint {
123 */ 128 */
124#define F2FS_ORPHANS_PER_BLOCK 1020 129#define F2FS_ORPHANS_PER_BLOCK 1020
125 130
131#define GET_ORPHAN_BLOCKS(n) ((n + F2FS_ORPHANS_PER_BLOCK - 1) / \
132 F2FS_ORPHANS_PER_BLOCK)
133
126struct f2fs_orphan_block { 134struct f2fs_orphan_block {
127 __le32 ino[F2FS_ORPHANS_PER_BLOCK]; /* inode numbers */ 135 __le32 ino[F2FS_ORPHANS_PER_BLOCK]; /* inode numbers */
128 __le32 reserved; /* reserved */ 136 __le32 reserved; /* reserved */
@@ -144,6 +152,7 @@ struct f2fs_extent {
144#define F2FS_NAME_LEN 255 152#define F2FS_NAME_LEN 255
145#define F2FS_INLINE_XATTR_ADDRS 50 /* 200 bytes for inline xattrs */ 153#define F2FS_INLINE_XATTR_ADDRS 50 /* 200 bytes for inline xattrs */
146#define DEF_ADDRS_PER_INODE 923 /* Address Pointers in an Inode */ 154#define DEF_ADDRS_PER_INODE 923 /* Address Pointers in an Inode */
155#define DEF_NIDS_PER_INODE 5 /* Node IDs in an Inode */
147#define ADDRS_PER_INODE(fi) addrs_per_inode(fi) 156#define ADDRS_PER_INODE(fi) addrs_per_inode(fi)
148#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */ 157#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */
149#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */ 158#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */
@@ -163,8 +172,9 @@ struct f2fs_extent {
163#define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \ 172#define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \
164 F2FS_INLINE_XATTR_ADDRS - 1)) 173 F2FS_INLINE_XATTR_ADDRS - 1))
165 174
166#define INLINE_DATA_OFFSET (PAGE_CACHE_SIZE - sizeof(struct node_footer) \ 175#define INLINE_DATA_OFFSET (PAGE_CACHE_SIZE - sizeof(struct node_footer) -\
167 - sizeof(__le32) * (DEF_ADDRS_PER_INODE + 5 - 1)) 176 sizeof(__le32) * (DEF_ADDRS_PER_INODE + \
177 DEF_NIDS_PER_INODE - 1))
168 178
169struct f2fs_inode { 179struct f2fs_inode {
170 __le16 i_mode; /* file mode */ 180 __le16 i_mode; /* file mode */
@@ -194,7 +204,7 @@ struct f2fs_inode {
194 204
195 __le32 i_addr[DEF_ADDRS_PER_INODE]; /* Pointers to data blocks */ 205 __le32 i_addr[DEF_ADDRS_PER_INODE]; /* Pointers to data blocks */
196 206
197 __le32 i_nid[5]; /* direct(2), indirect(2), 207 __le32 i_nid[DEF_NIDS_PER_INODE]; /* direct(2), indirect(2),
198 double_indirect(1) node id */ 208 double_indirect(1) node id */
199} __packed; 209} __packed;
200 210