]> git.hungrycats.org Git - linux/commitdiff
[PATCH] misc cleanup in symlink-handling part of namei.c
authorAlexander Viro <viro@www.linux.org.uk>
Tue, 31 Aug 2004 14:46:37 +0000 (07:46 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 31 Aug 2004 14:46:37 +0000 (07:46 -0700)
page_follow_link_light() should just call nd_set_link() - error handling will
come for free.

Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/namei.c

index be20763fcd795b787e5587720a77b2e0ee8e6900..f794a406dbacddaa386cd72142f16c7b000f2359 100644 (file)
@@ -945,8 +945,7 @@ int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata
                }
                nd->mnt = mntget(current->fs->rootmnt);
                nd->dentry = dget(current->fs->root);
-       }
-       else{
+       } else {
                nd->mnt = mntget(current->fs->pwdmnt);
                nd->dentry = dget(current->fs->pwd);
        }
@@ -2305,12 +2304,8 @@ int page_readlink(struct dentry *dentry, char __user *buffer, int buflen)
 int page_follow_link_light(struct dentry *dentry, struct nameidata *nd)
 {
        struct page *page;
-       char *s = page_getlink(dentry, &page);
-       if (!IS_ERR(s)) {
-               nd_set_link(nd, s);
-               s = NULL;
-       }
-       return PTR_ERR(s);
+       nd_set_link(nd, page_getlink(dentry, &page));
+       return 0;
 }
 
 void page_put_link(struct dentry *dentry, struct nameidata *nd)