diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-01 15:31:02 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-01 15:31:02 -0500 |
commit | c9fd43078f5007c6ca6b3a9cd04c51a8f0e44a20 (patch) | |
tree | 5a083b01e88afd591fdcce76ad14c4d7d028ac23 /fs/gfs2/inode.c | |
parent | e317ffcb7cc26c5e80cab97160a5e2761a4436ec (diff) | |
download | linux-c9fd43078f5007c6ca6b3a9cd04c51a8f0e44a20.tar.gz linux-c9fd43078f5007c6ca6b3a9cd04c51a8f0e44a20.tar.bz2 linux-c9fd43078f5007c6ca6b3a9cd04c51a8f0e44a20.zip |
[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>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index ea9e996f3673..cd1de61bff2f 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -288,7 +288,7 @@ int gfs2_inode_refresh(struct gfs2_inode *ip) * Returns: errno */ -static int inode_create(struct gfs2_glock *i_gl, struct gfs2_inum *inum, +static int inode_create(struct gfs2_glock *i_gl, const struct gfs2_inum *inum, struct gfs2_glock *io_gl, unsigned int io_state, struct gfs2_inode **ipp) { @@ -354,8 +354,8 @@ static int inode_create(struct gfs2_glock *i_gl, struct gfs2_inum *inum, * Returns: errno */ -int gfs2_inode_get(struct gfs2_glock *i_gl, struct gfs2_inum *inum, int create, - struct gfs2_inode **ipp) +int gfs2_inode_get(struct gfs2_glock *i_gl, const struct gfs2_inum *inum, + int create, struct gfs2_inode **ipp) { struct gfs2_sbd *sdp = i_gl->gl_sbd; struct gfs2_glock *io_gl; @@ -718,6 +718,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff) int gfs2_lookupi(struct inode *dir, struct qstr *name, int is_root, struct inode **inodep) { + struct super_block *sb = dir->i_sb; struct gfs2_inode *ipp; struct gfs2_inode *dip = dir->u.generic_ip; struct gfs2_sbd *sdp = dip->i_sbd; @@ -733,7 +734,7 @@ int gfs2_lookupi(struct inode *dir, struct qstr *name, int is_root, return -ENAMETOOLONG; if (gfs2_filecmp(name, ".", 1) || - (gfs2_filecmp(name, "..", 2) && dir == sdp->sd_root_dir)) { + (gfs2_filecmp(name, "..", 2) && dir == sb->s_root->d_inode)) { gfs2_inode_hold(dip); ipp = dip; goto done; @@ -1466,8 +1467,8 @@ int gfs2_unlink_ok(struct gfs2_inode *dip, struct qstr *name, int gfs2_ok_to_move(struct gfs2_inode *this, struct gfs2_inode *to) { - struct gfs2_sbd *sdp = this->i_sbd; struct inode *dir = to->i_vnode; + struct super_block *sb = dir->i_sb; struct inode *tmp; struct qstr dotdot; int error = 0; @@ -1483,7 +1484,7 @@ int gfs2_ok_to_move(struct gfs2_inode *this, struct gfs2_inode *to) error = -EINVAL; break; } - if (dir == sdp->sd_root_dir) { + if (dir == sb->s_root->d_inode) { error = 0; break; } |