]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
NFS: Remove BKL usage from open()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 11 Jun 2008 17:26:23 +0000 (13:26 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 15 Jul 2008 22:10:53 +0000 (18:10 -0400)
All the NFSv4 stateful operations are already protected by other locks (in
particular by the rpc_sequence locks.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/dir.c
fs/nfs/file.c
fs/nfs/nfs4proc.c

index 73e0f9740dd1ae35807055666f4ffa0a41aa2cbb..c68ec447ace11667cf7c019daa5c119b91eaeaad 100644 (file)
@@ -139,10 +139,8 @@ nfs_opendir(struct inode *inode, struct file *filp)
 
        nfs_inc_stats(inode, NFSIOS_VFSOPEN);
 
-       lock_kernel();
        /* Call generic open code in order to cache credentials */
        res = nfs_open(inode, filp);
-       unlock_kernel();
        return res;
 }
 
@@ -1019,9 +1017,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
        }
 
        /* Open the file on the server */
-       lock_kernel();
        res = nfs4_atomic_open(dir, dentry, nd);
-       unlock_kernel();
        if (IS_ERR(res)) {
                error = PTR_ERR(res);
                switch (error) {
@@ -1083,9 +1079,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
         * operations that change the directory. We therefore save the
         * change attribute *before* we do the RPC call.
         */
-       lock_kernel();
        ret = nfs4_open_revalidate(dir, dentry, openflags, nd);
-       unlock_kernel();
 out:
        dput(parent);
        if (!ret)
index f919d9a01a27210b1072eea7cccc168308a88c10..9f1bed944b2ec9478ca3f568f73fc21a6d2fbe66 100644 (file)
@@ -128,9 +128,7 @@ nfs_file_open(struct inode *inode, struct file *filp)
                return res;
 
        nfs_inc_stats(inode, NFSIOS_VFSOPEN);
-       lock_kernel();
        res = nfs_open(inode, filp);
-       unlock_kernel();
        return res;
 }
 
index 4451287a81d16aa4233c39459e6995d09916ae5d..c910413eaecafd80ff2c6012dda6baad388cc6dd 100644 (file)
@@ -451,9 +451,7 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
                /* Save the delegation */
                memcpy(stateid.data, delegation->stateid.data, sizeof(stateid.data));
                rcu_read_unlock();
-               lock_kernel();
                ret = nfs_may_open(state->inode, state->owner->so_cred, open_mode);
-               unlock_kernel();
                if (ret != 0)
                        goto out;
                ret = -EAGAIN;