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>
This commit is contained in:
Trond Myklebust
2015-01-23 18:48:00 -05:00
parent f95549cf24
commit badc76dd0d
2 changed files with 10 additions and 10 deletions

View File

@@ -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;
}