summaryrefslogtreecommitdiffstats
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorTrond Myklebust2012-08-13 23:15:50 +0200
committerTrond Myklebust2012-09-28 22:03:03 +0200
commitb3c54de6f82d01637796bcc1f667a45f3b32e814 (patch)
tree9b0e87f60b2815ca20ef47eceed6da0f16b799ef /fs/nfs/inode.c
parentSUNRPC: Optimise away unnecessary data moves in xdr_align_pages (diff)
downloadkernel-qcow2-linux-b3c54de6f82d01637796bcc1f667a45f3b32e814.tar.gz
kernel-qcow2-linux-b3c54de6f82d01637796bcc1f667a45f3b32e814.tar.xz
kernel-qcow2-linux-b3c54de6f82d01637796bcc1f667a45f3b32e814.zip
NFS: Convert nfs_get_lock_context to return an ERR_PTR on failure
We want to be able to distinguish between allocation failures, and the case where the lock context is not needed (because there are no locks). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r--fs/nfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 9b47610338f5..b5e2913dff2d 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -578,7 +578,7 @@ struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx)
spin_unlock(&inode->i_lock);
new = kmalloc(sizeof(*new), GFP_KERNEL);
if (new == NULL)
- return NULL;
+ return ERR_PTR(-ENOMEM);
nfs_init_lock_context(new);
spin_lock(&inode->i_lock);
res = __nfs_find_lock_context(ctx);