diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-08-14 14:57:27 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-08-26 13:15:23 +0200 |
commit | 65985d935ddd5657c66a8bb3ae9752ed842549b8 (patch) | |
tree | 5eea77933c96f3007cdc29b6fa06c313737003f6 /fs/f2fs/node.c | |
parent | f2fs: add the truncate_xattr_node function (diff) | |
download | linux-65985d935ddd5657c66a8bb3ae9752ed842549b8.tar.xz linux-65985d935ddd5657c66a8bb3ae9752ed842549b8.zip |
f2fs: support the inline xattrs
0. modified inode structure
--------------------------------------
metadata (e.g., i_mtime, i_ctime, etc)
--------------------------------------
direct pointers [0 ~ 873]
inline xattrs (200 bytes by default)
indirect pointers [0 ~ 4]
--------------------------------------
node footer
--------------------------------------
1. setxattr flow
- read_all_xattrs copies all the xattrs from inline and xattr node block.
- handle xattr entries
- write_all_xattrs copies modified xattrs into inline and xattr node block.
2. getxattr flow
- read_all_xattrs copies all the xattrs from inline and xattr node block.
- check target entries
3. Usage
# mount -t f2fs -o inline_xattr $DEV $MNT
Once mounted with the inline_xattr option, f2fs marks all the newly created
files to reserve an amount of inline xattr space explicitly inside the inode
block. Without the mount option, f2fs will not touch any existing files and
newly created files as well.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r-- | fs/f2fs/node.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 2a464a76602d..c3c03c975bd6 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -787,6 +787,10 @@ int truncate_xattr_node(struct inode *inode, struct page *page) return PTR_ERR(npage); F2FS_I(inode)->i_xattr_nid = 0; + + /* need to do checkpoint during fsync */ + F2FS_I(inode)->xattr_ver = cur_cp_version(F2FS_CKPT(sbi)); + set_new_dnode(&dn, inode, page, npage, nid); if (page) @@ -1464,6 +1468,9 @@ void alloc_nid_failed(struct f2fs_sb_info *sbi, nid_t nid) struct f2fs_nm_info *nm_i = NM_I(sbi); struct free_nid *i; + if (!nid) + return; + spin_lock(&nm_i->free_nid_list_lock); i = __lookup_free_nid_list(nid, &nm_i->free_nid_list); BUG_ON(!i || i->state != NID_ALLOC); |