diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-01-24 00:48:00 +0100 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-01-24 05:06:44 +0100 |
commit | badc76dd0dc6d55a86c79e952f19d3af24708058 (patch) | |
tree | 25bf3106a91cd9b8e9d4c7f69202b622033c29d1 /fs/nfs/nfs4state.c | |
parent | NFSv4: More CLOSE/OPEN races (diff) | |
download | linux-badc76dd0dc6d55a86c79e952f19d3af24708058.tar.xz linux-badc76dd0dc6d55a86c79e952f19d3af24708058.zip |
NFSv4: Convert nfs_alloc_seqid() to return an ERR_PTR() if allocation fails
When we relax the sequencing on the NFSv4.1 OPEN/CLOSE code, we will want
to use the value NULL to indicate that no sequencing is needed.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 5194933ed419..b922e43d69b8 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1003,11 +1003,11 @@ struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter, gfp_t gfp_m struct nfs_seqid *new; new = kmalloc(sizeof(*new), gfp_mask); - if (new != NULL) { - new->sequence = counter; - INIT_LIST_HEAD(&new->list); - new->task = NULL; - } + if (new == NULL) + return ERR_PTR(-ENOMEM); + new->sequence = counter; + INIT_LIST_HEAD(&new->list); + new->task = NULL; return new; } |