aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/the_nilfs.h
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-08-15 12:54:52 -0400
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-22 20:24:36 -0400
commitf11459ad7dab9e9eb5a05b8bd3bec338ea8f485d (patch)
tree91808a1f88f6ad24f381473e1bde22f10cac49e6 /fs/nilfs2/the_nilfs.h
parentab4d8f7ebf33beff97e766d18db47f1ea9635769 (diff)
nilfs2: do not allocate multiple super block instances for a device
This stops allocating multiple super block instances for a device. All snapshots and a current mode mount (i.e. latest tree) will be controlled with nilfs_root objects that are kept within an sb instance. nilfs_get_sb() is rewritten so that it always has a root object for the latest tree and snapshots make additional root objects. The root dentry of the latest tree is binded to sb->s_root even if it isn't attached on a directory. Root dentries of snapshots or the latest tree are binded to mnt->mnt_root on which they are mounted. With this patch, nilfs_find_sbinfo() function, nilfs->ns_supers list, and nilfs->ns_current back pointer, are deleted. In addition, init_nilfs() and load_nilfs() are simplified since they will be called once for a device, not repeatedly called for mount points. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/the_nilfs.h')
-rw-r--r--fs/nilfs2/the_nilfs.h16
1 files changed, 0 insertions, 16 deletions
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h
index 0afede68a9e1..7b43693a69c5 100644
--- a/fs/nilfs2/the_nilfs.h
+++ b/fs/nilfs2/the_nilfs.h
@@ -52,16 +52,13 @@ enum {
52 * @ns_bdi: backing dev info 52 * @ns_bdi: backing dev info
53 * @ns_writer: back pointer to writable nilfs_sb_info 53 * @ns_writer: back pointer to writable nilfs_sb_info
54 * @ns_sem: semaphore for shared states 54 * @ns_sem: semaphore for shared states
55 * @ns_super_sem: semaphore for global operations across super block instances
56 * @ns_mount_mutex: mutex protecting mount process of nilfs 55 * @ns_mount_mutex: mutex protecting mount process of nilfs
57 * @ns_writer_sem: semaphore protecting ns_writer attach/detach 56 * @ns_writer_sem: semaphore protecting ns_writer attach/detach
58 * @ns_current: back pointer to current mount
59 * @ns_sbh: buffer heads of on-disk super blocks 57 * @ns_sbh: buffer heads of on-disk super blocks
60 * @ns_sbp: pointers to super block data 58 * @ns_sbp: pointers to super block data
61 * @ns_sbwtime: previous write time of super block 59 * @ns_sbwtime: previous write time of super block
62 * @ns_sbwcount: write count of super block 60 * @ns_sbwcount: write count of super block
63 * @ns_sbsize: size of valid data in super block 61 * @ns_sbsize: size of valid data in super block
64 * @ns_supers: list of nilfs super block structs
65 * @ns_seg_seq: segment sequence counter 62 * @ns_seg_seq: segment sequence counter
66 * @ns_segnum: index number of the latest full segment. 63 * @ns_segnum: index number of the latest full segment.
67 * @ns_nextnum: index number of the full segment index to be used next 64 * @ns_nextnum: index number of the full segment index to be used next
@@ -104,17 +101,10 @@ struct the_nilfs {
104 struct backing_dev_info *ns_bdi; 101 struct backing_dev_info *ns_bdi;
105 struct nilfs_sb_info *ns_writer; 102 struct nilfs_sb_info *ns_writer;
106 struct rw_semaphore ns_sem; 103 struct rw_semaphore ns_sem;
107 struct rw_semaphore ns_super_sem;
108 struct mutex ns_mount_mutex; 104 struct mutex ns_mount_mutex;
109 struct rw_semaphore ns_writer_sem; 105 struct rw_semaphore ns_writer_sem;
110 106
111 /* 107 /*
112 * components protected by ns_super_sem
113 */
114 struct nilfs_sb_info *ns_current;
115 struct list_head ns_supers;
116
117 /*
118 * used for 108 * used for
119 * - loading the latest checkpoint exclusively. 109 * - loading the latest checkpoint exclusively.
120 * - allocating a new full segment. 110 * - allocating a new full segment.
@@ -294,12 +284,6 @@ nilfs_detach_writer(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi)
294 up_write(&nilfs->ns_writer_sem); 284 up_write(&nilfs->ns_writer_sem);
295} 285}
296 286
297static inline void nilfs_put_sbinfo(struct nilfs_sb_info *sbi)
298{
299 if (atomic_dec_and_test(&sbi->s_count))
300 kfree(sbi);
301}
302
303static inline int nilfs_valid_fs(struct the_nilfs *nilfs) 287static inline int nilfs_valid_fs(struct the_nilfs *nilfs)
304{ 288{
305 unsigned valid_fs; 289 unsigned valid_fs;