From: Trond Myklebust Date: Wed, 15 Aug 2007 08:55:47 -0400 NFS: Optimise NFS permission calls. Signed-off-by: Trond Myklebust --- fs/nfs/dir.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index a5f6287..a2d9b63 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2035,19 +2035,16 @@ int nfs_permission(struct inode *inode, int mask, struct nameidata *nd) if (mask == 0) goto out; /* Is this sys_access() ? */ - if (nd != NULL && (nd->flags & LOOKUP_ACCESS)) - goto force_lookup; + if (nd != NULL) { + if (nd->flags & LOOKUP_ACCESS) + goto force_lookup; + if (nd->flags & LOOKUP_OPEN) + goto out; + } switch (inode->i_mode & S_IFMT) { case S_IFLNK: goto out; - case S_IFREG: - /* NFSv4 has atomic_open... */ - if (nfs_server_capable(inode, NFS_CAP_ATOMIC_OPEN) - && nd != NULL - && (nd->flags & LOOKUP_OPEN)) - goto out; - break; case S_IFDIR: /* * Optimize away all write operations, since the server