summaryrefslogtreecommitdiff
path: root/fs/nfsd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/export.c7
-rw-r--r--fs/nfsd/nfs4callback.c4
-rw-r--r--fs/nfsd/nfs4state.c7
-rw-r--r--fs/nfsd/nfsctl.c2
4 files changed, 10 insertions, 10 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index a47c90f40422..a7ebce53faec 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -358,7 +358,7 @@ int nfsd_nl_expkey_get_reqs_dumpit(struct sk_buff *skb,
goto out_unlock;
}
- items = kcalloc(cnt, sizeof(*items), GFP_KERNEL);
+ items = kzalloc_objs(*items, cnt);
seqnos = kcalloc(cnt, sizeof(*seqnos), GFP_KERNEL);
if (!items || !seqnos) {
ret = -ENOMEM;
@@ -685,7 +685,7 @@ int nfsd_nl_svc_export_get_reqs_dumpit(struct sk_buff *skb,
goto out_unlock;
}
- items = kcalloc(cnt, sizeof(*items), GFP_KERNEL);
+ items = kzalloc_objs(*items, cnt);
seqnos = kcalloc(cnt, sizeof(*seqnos), GFP_KERNEL);
pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
if (!items || !seqnos || !pathbuf) {
@@ -786,8 +786,7 @@ static int nfsd_nl_parse_fslocations(struct nlattr *attr,
if (!count)
return 0;
- fsloc->locations = kcalloc(count, sizeof(struct nfsd4_fs_location),
- GFP_KERNEL);
+ fsloc->locations = kzalloc_objs(struct nfsd4_fs_location, count);
if (!fsloc->locations)
return -ENOMEM;
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index a901bbe67e03..19dc337502ca 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -1981,12 +1981,12 @@ int nfsd_net_cb_init(struct nfsd_net *nn)
{
struct nfsd_net_cb *cb;
- cb = kzalloc(sizeof(*cb), GFP_KERNEL);
+ cb = kzalloc_obj(*cb);
if (!cb)
return -ENOMEM;
cb->version4.counts = kzalloc_objs(unsigned int,
- ARRAY_SIZE(nfs4_cb_procedures), GFP_KERNEL);
+ ARRAY_SIZE(nfs4_cb_procedures));
if (!cb->version4.counts) {
kfree(cb);
return -ENOMEM;
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 18e17232cf94..9c4adf3110ae 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1341,7 +1341,7 @@ alloc_init_dir_deleg(struct nfs4_client *clp, struct nfs4_file *fp)
return NULL;
}
- ncn->ncn_nf = kcalloc(NOTIFY4_EVENT_QUEUE_SIZE, sizeof(*ncn->ncn_nf), GFP_KERNEL);
+ ncn->ncn_nf = kzalloc_objs(*ncn->ncn_nf, NOTIFY4_EVENT_QUEUE_SIZE);
if (!ncn->ncn_nf) {
nfs4_put_stid(&dp->dl_stid);
return NULL;
@@ -10419,8 +10419,9 @@ alloc_nfsd_notify_event(u32 mask, const struct qstr *q, struct dentry *dentry,
newnamelen = newname.name.len;
}
- ne = kmalloc(struct_size(ne, ne_name, q->len + 1 +
- (newnamelen ? newnamelen + 1 : 0)), GFP_NOFS);
+ ne = kmalloc_flex(*ne, ne_name,
+ q->len + 1 + (newnamelen ? newnamelen + 1 : 0),
+ GFP_NOFS);
if (!ne)
goto out;
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index adb032b7311a..5abb2d4274c9 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1647,7 +1647,7 @@ static int nfsd_nl_fh_key_set(const struct nlattr *attr, struct nfsd_net *nn)
k1 = get_unaligned_le64(nla_data(attr) + 8);
if (!fh_key) {
- fh_key = kmalloc(sizeof(siphash_key_t), GFP_KERNEL);
+ fh_key = kmalloc_obj(siphash_key_t);
if (!fh_key) {
trace_nfsd_ctl_fh_key_set(false, -ENOMEM);
return -ENOMEM;