use can_lookup() instead of direct checks of ->i_op->lookup
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 6 Jun 2013 23:33:47 +0000 (19:33 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 15 Jun 2013 01:41:45 +0000 (05:41 +0400)
a couple of places got missed back when Linus has introduced that one...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 85e40d1c0a8fd64b358447ee09b26f906102ee1d..9ed9361223c08f30ebbcca48e165588adeb31378 100644 (file)
@@ -1976,7 +1976,7 @@ static int path_lookupat(int dfd, const char *name,
                err = complete_walk(nd);
 
        if (!err && nd->flags & LOOKUP_DIRECTORY) {
-               if (!nd->inode->i_op->lookup) {
+               if (!can_lookup(nd->inode)) {
                        path_put(&nd->path);
                        err = -ENOTDIR;
                }
@@ -2850,7 +2850,7 @@ finish_lookup:
        if ((open_flag & O_CREAT) && S_ISDIR(nd->inode->i_mode))
                goto out;
        error = -ENOTDIR;
-       if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup)
+       if ((nd->flags & LOOKUP_DIRECTORY) && !can_lookup(nd->inode))
                goto out;
        audit_inode(name, nd->path.dentry, 0);
 finish_open: