diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-08-13 17:15:50 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-28 16:03:03 -0400 |
commit | b3c54de6f82d01637796bcc1f667a45f3b32e814 (patch) | |
tree | 9b0e87f60b2815ca20ef47eceed6da0f16b799ef /fs/nfs/inode.c | |
parent | a11a2bf4de5679fa0b63474c7d39bea2dac7d061 (diff) | |
download | linux-b3c54de6f82d01637796bcc1f667a45f3b32e814.tar.gz linux-b3c54de6f82d01637796bcc1f667a45f3b32e814.tar.bz2 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.c | 2 |
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); |