aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-04-14 22:19:28 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-05-06 21:21:54 -0400
commited57c27f736f6d8a51e442610c800ee0c3d83977 (patch)
treef1d453fae0ba5b9d5ca938fb0d57aedd762a5c58 /fs/f2fs/f2fs.h
parent15c6e3aae68d6167cba063387a59968f811c8268 (diff)
f2fs: remove costly dirty_dir_inode operations
This patch removes list opeations in handling dirty dir inodes. Previously, F2FS traverses whole the list of dirty dir inodes to check whether there is an existing inode or not, resulting in heavy CPU overheads. So this patch removes such the traverse operations by adding FI_DIRTY_DIR to indicate the inode lies on the list or not. Through this simple flag, we can remove redundant operations gracefully. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 2c5a5dadae65..d3180f8c0f97 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -218,6 +218,7 @@ struct f2fs_inode_info {
218 nid_t i_xattr_nid; /* node id that contains xattrs */ 218 nid_t i_xattr_nid; /* node id that contains xattrs */
219 unsigned long long xattr_ver; /* cp version of xattr modification */ 219 unsigned long long xattr_ver; /* cp version of xattr modification */
220 struct extent_info ext; /* in-memory extent cache entry */ 220 struct extent_info ext; /* in-memory extent cache entry */
221 struct dir_inode_entry *dirty_dir; /* the pointer of dirty dir */
221}; 222};
222 223
223static inline void get_extent_info(struct extent_info *ext, 224static inline void get_extent_info(struct extent_info *ext,
@@ -958,6 +959,7 @@ static inline int f2fs_clear_bit(unsigned int nr, char *addr)
958enum { 959enum {
959 FI_NEW_INODE, /* indicate newly allocated inode */ 960 FI_NEW_INODE, /* indicate newly allocated inode */
960 FI_DIRTY_INODE, /* indicate inode is dirty or not */ 961 FI_DIRTY_INODE, /* indicate inode is dirty or not */
962 FI_DIRTY_DIR, /* indicate directory has dirty pages */
961 FI_INC_LINK, /* need to increment i_nlink */ 963 FI_INC_LINK, /* need to increment i_nlink */
962 FI_ACL_MODE, /* indicate acl mode */ 964 FI_ACL_MODE, /* indicate acl mode */
963 FI_NO_ALLOC, /* should not allocate any blocks */ 965 FI_NO_ALLOC, /* should not allocate any blocks */
@@ -1222,7 +1224,6 @@ int get_valid_checkpoint(struct f2fs_sb_info *);
1222void set_dirty_dir_page(struct inode *, struct page *); 1224void set_dirty_dir_page(struct inode *, struct page *);
1223void add_dirty_dir_inode(struct inode *); 1225void add_dirty_dir_inode(struct inode *);
1224void remove_dirty_dir_inode(struct inode *); 1226void remove_dirty_dir_inode(struct inode *);
1225struct inode *check_dirty_dir_inode(struct f2fs_sb_info *, nid_t);
1226void sync_dirty_dir_inodes(struct f2fs_sb_info *); 1227void sync_dirty_dir_inodes(struct f2fs_sb_info *);
1227void write_checkpoint(struct f2fs_sb_info *, bool); 1228void write_checkpoint(struct f2fs_sb_info *, bool);
1228void init_orphan_info(struct f2fs_sb_info *); 1229void init_orphan_info(struct f2fs_sb_info *);