Skip to content

Commit

Permalink
nilfs2: do not allocate multiple super block instances for a device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ryusuke Konishi committed Oct 23, 2010
1 parent ab4d8f7 commit f11459a
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 225 deletions.
5 changes: 0 additions & 5 deletions fs/nilfs2/sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ struct nilfs_sc_info;
* NILFS super-block data in memory
*/
struct nilfs_sb_info {
/* Snapshot status */
__u64 s_snapshot_cno; /* Checkpoint number */

/* Mount options */
unsigned long s_mount_opt;
uid_t s_resuid;
Expand All @@ -57,8 +54,6 @@ struct nilfs_sb_info {
/* Fundamental members */
struct super_block *s_super; /* reverse pointer to super_block */
struct the_nilfs *s_nilfs;
struct list_head s_list; /* list head for nilfs->ns_supers */
atomic_t s_count; /* reference count */

/* Segment constructor */
struct list_head s_dirty_files; /* dirty files list */
Expand Down
Loading

0 comments on commit f11459a

Please sign in to comment.