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) |
[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) | |||
288 | * Returns: errno | 288 | * Returns: errno |
289 | */ | 289 | */ |
290 | 290 | ||
291 | static int inode_create(struct gfs2_glock *i_gl, struct gfs2_inum *inum, | 291 | static int inode_create(struct gfs2_glock *i_gl, const struct gfs2_inum *inum, |
292 | struct gfs2_glock *io_gl, unsigned int io_state, | 292 | struct gfs2_glock *io_gl, unsigned int io_state, |
293 | struct gfs2_inode **ipp) | 293 | struct gfs2_inode **ipp) |
294 | { | 294 | { |
@@ -354,8 +354,8 @@ static int inode_create(struct gfs2_glock *i_gl, struct gfs2_inum *inum, | |||
354 | * Returns: errno | 354 | * Returns: errno |
355 | */ | 355 | */ |
356 | 356 | ||
357 | int gfs2_inode_get(struct gfs2_glock *i_gl, struct gfs2_inum *inum, int create, | 357 | int gfs2_inode_get(struct gfs2_glock *i_gl, const struct gfs2_inum *inum, |
358 | struct gfs2_inode **ipp) | 358 | int create, struct gfs2_inode **ipp) |
359 | { | 359 | { |
360 | struct gfs2_sbd *sdp = i_gl->gl_sbd; | 360 | struct gfs2_sbd *sdp = i_gl->gl_sbd; |
361 | struct gfs2_glock *io_gl; | 361 | struct gfs2_glock *io_gl; |
@@ -718,6 +718,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff) | |||
718 | int gfs2_lookupi(struct inode *dir, struct qstr *name, int is_root, | 718 | int gfs2_lookupi(struct inode *dir, struct qstr *name, int is_root, |
719 | struct inode **inodep) | 719 | struct inode **inodep) |
720 | { | 720 | { |
721 | struct super_block *sb = dir->i_sb; | ||
721 | struct gfs2_inode *ipp; | 722 | struct gfs2_inode *ipp; |
722 | struct gfs2_inode *dip = dir->u.generic_ip; | 723 | struct gfs2_inode *dip = dir->u.generic_ip; |
723 | struct gfs2_sbd *sdp = dip->i_sbd; | 724 | struct gfs2_sbd *sdp = dip->i_sbd; |
@@ -733,7 +734,7 @@ int gfs2_lookupi(struct inode *dir, struct qstr *name, int is_root, | |||
733 | return -ENAMETOOLONG; | 734 | return -ENAMETOOLONG; |
734 | 735 | ||
735 | if (gfs2_filecmp(name, ".", 1) || | 736 | if (gfs2_filecmp(name, ".", 1) || |
736 | (gfs2_filecmp(name, "..", 2) && dir == sdp->sd_root_dir)) { | 737 | (gfs2_filecmp(name, "..", 2) && dir == sb->s_root->d_inode)) { |
737 | gfs2_inode_hold(dip); | 738 | gfs2_inode_hold(dip); |
738 | ipp = dip; | 739 | ipp = dip; |
739 | goto done; | 740 | goto done; |
@@ -1466,8 +1467,8 @@ int gfs2_unlink_ok(struct gfs2_inode *dip, struct qstr *name, | |||
1466 | 1467 | ||
1467 | int gfs2_ok_to_move(struct gfs2_inode *this, struct gfs2_inode *to) | 1468 | int gfs2_ok_to_move(struct gfs2_inode *this, struct gfs2_inode *to) |
1468 | { | 1469 | { |
1469 | struct gfs2_sbd *sdp = this->i_sbd; | ||
1470 | struct inode *dir = to->i_vnode; | 1470 | struct inode *dir = to->i_vnode; |
1471 | struct super_block *sb = dir->i_sb; | ||
1471 | struct inode *tmp; | 1472 | struct inode *tmp; |
1472 | struct qstr dotdot; | 1473 | struct qstr dotdot; |
1473 | int error = 0; | 1474 | int error = 0; |
@@ -1483,7 +1484,7 @@ int gfs2_ok_to_move(struct gfs2_inode *this, struct gfs2_inode *to) | |||
1483 | error = -EINVAL; | 1484 | error = -EINVAL; |
1484 | break; | 1485 | break; |
1485 | } | 1486 | } |
1486 | if (dir == sdp->sd_root_dir) { | 1487 | if (dir == sb->s_root->d_inode) { |
1487 | error = 0; | 1488 | error = 0; |
1488 | break; | 1489 | break; |
1489 | } | 1490 | } |