[GFS2] Tidy up mount code.

We no longer lookup ".gfs2_admin" in the root directory in order to
find it, but instead use the inode number given in the superblock.
Both the root directory and the admin directory are now looked up using
the same routine, so the redundant code is removed.

Also, there is no longer a reference to the root inode in the
GFS2 super block. When required this can be retreived via
sb->s_root->d_inode instead.

Assuming that we introduce a metadata filesystem type for GFS, then
this is a first step towards that goal.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
Steven Whitehouse
2006-03-01 15:31:02 -05:00
parent e317ffcb7c
commit c9fd43078f
8 changed files with 27 additions and 54 deletions

View File

@@ -64,8 +64,8 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
int connectable)
{
struct inode *inode = dentry->d_inode;
struct super_block *sb = inode->i_sb;
struct gfs2_inode *ip = inode->u.generic_ip;
struct gfs2_sbd *sdp = ip->i_sbd;
if (*len < 4 || (connectable && *len < 8))
return 255;
@@ -80,7 +80,7 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
fh[3] = cpu_to_be32(fh[3]);
*len = 4;
if (!connectable || ip == sdp->sd_root_dir->u.generic_ip)
if (!connectable || inode == sb->s_root->d_inode)
return *len;
spin_lock(&dentry->d_lock);