summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-07-25 18:47:17 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-07-29 10:45:54 -0400
commit6451e041c8d39daf39c71eefe839641c2093713e (patch)
tree971f0c3ab382126d3d584c5fbe235a6d03cc8965 /fs/f2fs/f2fs.h
parent953e6cc6bcb615dfa373320ffa62b574c6be608a (diff)
f2fs: add infra for ino management
This patch changes the naming of orphan-related data structures to use as inode numbers managed globally. Later, we can use this facility for managing any inode number lists. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index e999eec200b7..b6fa6ec54f98 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -100,8 +100,13 @@ enum {
100 META_SSA 100 META_SSA
101}; 101};
102 102
103/* for the list of orphan inodes */ 103/* for the list of ino */
104struct orphan_inode_entry { 104enum {
105 ORPHAN_INO, /* for orphan ino list */
106 MAX_INO_ENTRY, /* max. list */
107};
108
109struct ino_entry {
105 struct list_head list; /* list head */ 110 struct list_head list; /* list head */
106 nid_t ino; /* inode number */ 111 nid_t ino; /* inode number */
107}; 112};
@@ -450,9 +455,11 @@ struct f2fs_sb_info {
450 bool por_doing; /* recovery is doing or not */ 455 bool por_doing; /* recovery is doing or not */
451 wait_queue_head_t cp_wait; 456 wait_queue_head_t cp_wait;
452 457
453 /* for orphan inode management */ 458 /* for inode management */
454 struct list_head orphan_inode_list; /* orphan inode list */ 459 spinlock_t ino_lock[MAX_INO_ENTRY]; /* for ino entry lock */
455 spinlock_t orphan_inode_lock; /* for orphan inode list */ 460 struct list_head ino_list[MAX_INO_ENTRY]; /* inode list head */
461
462 /* for orphan inode, use 0'th array */
456 unsigned int n_orphans; /* # of orphan inodes */ 463 unsigned int n_orphans; /* # of orphan inodes */
457 unsigned int max_orphans; /* max orphan inodes */ 464 unsigned int max_orphans; /* max orphan inodes */
458 465
@@ -1255,7 +1262,7 @@ void add_dirty_dir_inode(struct inode *);
1255void remove_dirty_dir_inode(struct inode *); 1262void remove_dirty_dir_inode(struct inode *);
1256void sync_dirty_dir_inodes(struct f2fs_sb_info *); 1263void sync_dirty_dir_inodes(struct f2fs_sb_info *);
1257void write_checkpoint(struct f2fs_sb_info *, bool); 1264void write_checkpoint(struct f2fs_sb_info *, bool);
1258void init_orphan_info(struct f2fs_sb_info *); 1265void init_ino_entry_info(struct f2fs_sb_info *);
1259int __init create_checkpoint_caches(void); 1266int __init create_checkpoint_caches(void);
1260void destroy_checkpoint_caches(void); 1267void destroy_checkpoint_caches(void);
1261 1268