diff options
Diffstat (limited to 'fs/nfs/filelayout')
| -rw-r--r-- | fs/nfs/filelayout/filelayout.c | 10 | ||||
| -rw-r--r-- | fs/nfs/filelayout/filelayoutdev.c | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 5c4551117c58..90a11afa5d05 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -694,15 +694,15 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo, goto out_err; if (fl->num_fh > 0) { - fl->fh_array = kcalloc(fl->num_fh, sizeof(fl->fh_array[0]), - gfp_flags); + fl->fh_array = kzalloc_objs(fl->fh_array[0], fl->num_fh, + gfp_flags); if (!fl->fh_array) goto out_err; } for (i = 0; i < fl->num_fh; i++) { /* Do we want to use a mempool here? */ - fl->fh_array[i] = kmalloc(sizeof(struct nfs_fh), gfp_flags); + fl->fh_array[i] = kmalloc_obj(struct nfs_fh, gfp_flags); if (!fl->fh_array[i]) goto out_err; @@ -763,7 +763,7 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid, int rc; dprintk("--> %s\n", __func__); - fl = kzalloc(sizeof(*fl), gfp_flags); + fl = kzalloc_obj(*fl, gfp_flags); if (!fl) return NULL; @@ -1049,7 +1049,7 @@ filelayout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags) { struct nfs4_filelayout *flo; - flo = kzalloc(sizeof(*flo), gfp_flags); + flo = kzalloc_obj(*flo, gfp_flags); if (flo == NULL) return NULL; pnfs_init_ds_commit_info(&flo->commit_info); diff --git a/fs/nfs/filelayout/filelayoutdev.c b/fs/nfs/filelayout/filelayoutdev.c index df79aeb68db4..7226989ee4d5 100644 --- a/fs/nfs/filelayout/filelayoutdev.c +++ b/fs/nfs/filelayout/filelayoutdev.c @@ -138,7 +138,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, goto out_err_free_stripe_indices; } - dsaddr = kzalloc(struct_size(dsaddr, ds_list, num), gfp_flags); + dsaddr = kzalloc_flex(*dsaddr, ds_list, num, gfp_flags); if (!dsaddr) goto out_err_free_stripe_indices; |
