Commit ce043ac8 authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd4: remove unused defer_free argument

28e05dd8 "knfsd: nfsd4: represent nfsv4 acl with array instead of
linked list" removed the last user that wanted a custom free function.
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 7fb84306
...@@ -182,16 +182,14 @@ static int zero_clientid(clientid_t *clid) ...@@ -182,16 +182,14 @@ static int zero_clientid(clientid_t *clid)
/** /**
* defer_free - mark an allocation as deferred freed * defer_free - mark an allocation as deferred freed
* @argp: NFSv4 compound argument structure to be freed with * @argp: NFSv4 compound argument structure
* @release: release callback to free @p, typically kfree() * @p: pointer to be freed (with kfree())
* @p: pointer to be freed
* *
* Marks @p to be freed when processing the compound operation * Marks @p to be freed when processing the compound operation
* described in @argp finishes. * described in @argp finishes.
*/ */
static int static int
defer_free(struct nfsd4_compoundargs *argp, defer_free(struct nfsd4_compoundargs *argp, void *p)
void (*release)(const void *), void *p)
{ {
struct tmpbuf *tb; struct tmpbuf *tb;
...@@ -199,7 +197,6 @@ defer_free(struct nfsd4_compoundargs *argp, ...@@ -199,7 +197,6 @@ defer_free(struct nfsd4_compoundargs *argp,
if (!tb) if (!tb)
return -ENOMEM; return -ENOMEM;
tb->buf = p; tb->buf = p;
tb->release = release;
tb->next = argp->to_free; tb->next = argp->to_free;
argp->to_free = tb; argp->to_free = tb;
return 0; return 0;
...@@ -225,7 +222,7 @@ static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes) ...@@ -225,7 +222,7 @@ static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes)
BUG_ON(p != argp->tmpp); BUG_ON(p != argp->tmpp);
argp->tmpp = NULL; argp->tmpp = NULL;
} }
if (defer_free(argp, kfree, p)) { if (defer_free(argp, p)) {
kfree(p); kfree(p);
return NULL; return NULL;
} else } else
...@@ -296,7 +293,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, ...@@ -296,7 +293,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
if (*acl == NULL) if (*acl == NULL)
return nfserr_jukebox; return nfserr_jukebox;
defer_free(argp, kfree, *acl); defer_free(argp, *acl);
(*acl)->naces = nace; (*acl)->naces = nace;
for (ace = (*acl)->aces; ace < (*acl)->aces + nace; ace++) { for (ace = (*acl)->aces; ace < (*acl)->aces + nace; ace++) {
...@@ -422,7 +419,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, ...@@ -422,7 +419,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
if (!label->data) if (!label->data)
return nfserr_jukebox; return nfserr_jukebox;
label->len = dummy32; label->len = dummy32;
defer_free(argp, kfree, label->data); defer_free(argp, label->data);
memcpy(label->data, buf, dummy32); memcpy(label->data, buf, dummy32);
} }
#endif #endif
...@@ -610,7 +607,7 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create ...@@ -610,7 +607,7 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create
return nfserr_jukebox; return nfserr_jukebox;
memcpy(create->cr_data, p, create->cr_datalen); memcpy(create->cr_data, p, create->cr_datalen);
create->cr_data[create->cr_datalen] = '\0'; create->cr_data[create->cr_datalen] = '\0';
defer_free(argp, kfree, create->cr_data); defer_free(argp, create->cr_data);
break; break;
case NF4BLK: case NF4BLK:
case NF4CHR: case NF4CHR:
...@@ -1486,7 +1483,7 @@ nfsd4_decode_test_stateid(struct nfsd4_compoundargs *argp, struct nfsd4_test_sta ...@@ -1486,7 +1483,7 @@ nfsd4_decode_test_stateid(struct nfsd4_compoundargs *argp, struct nfsd4_test_sta
goto out; goto out;
} }
defer_free(argp, kfree, stateid); defer_free(argp, stateid);
INIT_LIST_HEAD(&stateid->ts_id_list); INIT_LIST_HEAD(&stateid->ts_id_list);
list_add_tail(&stateid->ts_id_list, &test_stateid->ts_stateid_list); list_add_tail(&stateid->ts_id_list, &test_stateid->ts_stateid_list);
...@@ -3972,7 +3969,7 @@ int nfsd4_release_compoundargs(void *rq, __be32 *p, void *resp) ...@@ -3972,7 +3969,7 @@ int nfsd4_release_compoundargs(void *rq, __be32 *p, void *resp)
while (args->to_free) { while (args->to_free) {
struct tmpbuf *tb = args->to_free; struct tmpbuf *tb = args->to_free;
args->to_free = tb->next; args->to_free = tb->next;
tb->release(tb->buf); kfree(tb->buf);
kfree(tb); kfree(tb);
} }
return 1; return 1;
......
...@@ -488,7 +488,6 @@ struct nfsd4_compoundargs { ...@@ -488,7 +488,6 @@ struct nfsd4_compoundargs {
__be32 * tmpp; __be32 * tmpp;
struct tmpbuf { struct tmpbuf {
struct tmpbuf *next; struct tmpbuf *next;
void (*release)(const void *);
void *buf; void *buf;
} *to_free; } *to_free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment