diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-07-25 18:47:17 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-07-29 10:45:54 -0400 |
commit | 6451e041c8d39daf39c71eefe839641c2093713e (patch) | |
tree | 971f0c3ab382126d3d584c5fbe235a6d03cc8965 /fs/f2fs/f2fs.h | |
parent | 953e6cc6bcb615dfa373320ffa62b574c6be608a (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.h | 19 |
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 */ |
104 | struct orphan_inode_entry { | 104 | enum { |
105 | ORPHAN_INO, /* for orphan ino list */ | ||
106 | MAX_INO_ENTRY, /* max. list */ | ||
107 | }; | ||
108 | |||
109 | struct 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 *); | |||
1255 | void remove_dirty_dir_inode(struct inode *); | 1262 | void remove_dirty_dir_inode(struct inode *); |
1256 | void sync_dirty_dir_inodes(struct f2fs_sb_info *); | 1263 | void sync_dirty_dir_inodes(struct f2fs_sb_info *); |
1257 | void write_checkpoint(struct f2fs_sb_info *, bool); | 1264 | void write_checkpoint(struct f2fs_sb_info *, bool); |
1258 | void init_orphan_info(struct f2fs_sb_info *); | 1265 | void init_ino_entry_info(struct f2fs_sb_info *); |
1259 | int __init create_checkpoint_caches(void); | 1266 | int __init create_checkpoint_caches(void); |
1260 | void destroy_checkpoint_caches(void); | 1267 | void destroy_checkpoint_caches(void); |
1261 | 1268 | ||