/**
* defer_free - mark an allocation as deferred freed
- * @argp: NFSv4 compound argument structure to be freed with
- * @release: release callback to free @p, typically kfree()
- * @p: pointer to be freed
+ * @argp: NFSv4 compound argument structure
+ * @p: pointer to be freed (with kfree())
*
* Marks @p to be freed when processing the compound operation
* described in @argp finishes.
*/
static int
-defer_free(struct nfsd4_compoundargs *argp,
- void (*release)(const void *), void *p)
+defer_free(struct nfsd4_compoundargs *argp, void *p)
{
struct tmpbuf *tb;
if (!tb)
return -ENOMEM;
tb->buf = p;
- tb->release = release;
tb->next = argp->to_free;
argp->to_free = tb;
return 0;
BUG_ON(p != argp->tmpp);
argp->tmpp = NULL;
}
- if (defer_free(argp, kfree, p)) {
+ if (defer_free(argp, p)) {
kfree(p);
return NULL;
} else
if (*acl == NULL)
return nfserr_jukebox;
- defer_free(argp, kfree, *acl);
+ defer_free(argp, *acl);
(*acl)->naces = nace;
for (ace = (*acl)->aces; ace < (*acl)->aces + nace; ace++) {
if (!label->data)
return nfserr_jukebox;
label->len = dummy32;
- defer_free(argp, kfree, label->data);
+ defer_free(argp, label->data);
memcpy(label->data, buf, dummy32);
}
#endif
return nfserr_jukebox;
memcpy(create->cr_data, p, create->cr_datalen);
create->cr_data[create->cr_datalen] = '\0';
- defer_free(argp, kfree, create->cr_data);
+ defer_free(argp, create->cr_data);
break;
case NF4BLK:
case NF4CHR:
goto out;
}
- defer_free(argp, kfree, stateid);
+ defer_free(argp, stateid);
INIT_LIST_HEAD(&stateid->ts_id_list);
list_add_tail(&stateid->ts_id_list, &test_stateid->ts_stateid_list);
while (args->to_free) {
struct tmpbuf *tb = args->to_free;
args->to_free = tb->next;
- tb->release(tb->buf);
+ kfree(tb->buf);
kfree(tb);
}
return 1;