aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@www.linux.org.uk>2005-06-06 16:36:10 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-06 17:42:26 -0400
commit4b7b9772e4c3d87e649d4c419d2487aacf1235aa (patch)
tree943427ad8ef5ed51ab0802cf81f5c0e721fb36c6 /fs
parentba7a4c1a76f56c607560f1676680ff491747bdae (diff)
[PATCH] namei fixes (14/19)
shifted conditional mntput() into do_follow_link() - all callers were doing the same thing. Obviously equivalent transformation. Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 5153f57ee6b3..411bb3243c36 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -543,11 +543,15 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd)
543 current->link_count++; 543 current->link_count++;
544 current->total_link_count++; 544 current->total_link_count++;
545 nd->depth++; 545 nd->depth++;
546 if (path->mnt != nd->mnt)
547 mntput(nd->mnt);
546 err = __do_follow_link(path, nd); 548 err = __do_follow_link(path, nd);
547 current->link_count--; 549 current->link_count--;
548 nd->depth--; 550 nd->depth--;
549 return err; 551 return err;
550loop: 552loop:
553 if (path->mnt != nd->mnt)
554 mntput(nd->mnt);
551 dput(path->dentry); 555 dput(path->dentry);
552 path_release(nd); 556 path_release(nd);
553 return err; 557 return err;
@@ -801,8 +805,6 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
801 goto out_dput; 805 goto out_dput;
802 806
803 if (inode->i_op->follow_link) { 807 if (inode->i_op->follow_link) {
804 if (nd->mnt != next.mnt)
805 mntput(nd->mnt);
806 err = do_follow_link(&next, nd); 808 err = do_follow_link(&next, nd);
807 if (err) 809 if (err)
808 goto return_err; 810 goto return_err;
@@ -856,8 +858,6 @@ last_component:
856 inode = next.dentry->d_inode; 858 inode = next.dentry->d_inode;
857 if ((lookup_flags & LOOKUP_FOLLOW) 859 if ((lookup_flags & LOOKUP_FOLLOW)
858 && inode && inode->i_op && inode->i_op->follow_link) { 860 && inode && inode->i_op && inode->i_op->follow_link) {
859 if (next.mnt != nd->mnt)
860 mntput(nd->mnt);
861 err = do_follow_link(&next, nd); 861 err = do_follow_link(&next, nd);
862 if (err) 862 if (err)
863 goto return_err; 863 goto return_err;