Commit 4fb547be authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.2/copyoffload: Convert GFP_NOFS to GFP_KERNEL

There doesn't seem to be any reason why the copy offload code can't use
GFP_KERNEL. It can't get called by direct reclaim.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 61345a42
...@@ -710,7 +710,7 @@ __be32 nfs4_callback_offload(void *data, void *dummy, ...@@ -710,7 +710,7 @@ __be32 nfs4_callback_offload(void *data, void *dummy,
struct nfs4_copy_state *copy, *tmp_copy; struct nfs4_copy_state *copy, *tmp_copy;
bool found = false; bool found = false;
copy = kzalloc(sizeof(struct nfs4_copy_state), GFP_NOFS); copy = kzalloc(sizeof(struct nfs4_copy_state), GFP_KERNEL);
if (!copy) if (!copy)
return htonl(NFS4ERR_SERVERFAULT); return htonl(NFS4ERR_SERVERFAULT);
......
...@@ -181,7 +181,7 @@ static int handle_async_copy(struct nfs42_copy_res *res, ...@@ -181,7 +181,7 @@ static int handle_async_copy(struct nfs42_copy_res *res,
struct nfs_open_context *dst_ctx = nfs_file_open_context(dst); struct nfs_open_context *dst_ctx = nfs_file_open_context(dst);
struct nfs_open_context *src_ctx = nfs_file_open_context(src); struct nfs_open_context *src_ctx = nfs_file_open_context(src);
copy = kzalloc(sizeof(struct nfs4_copy_state), GFP_NOFS); copy = kzalloc(sizeof(struct nfs4_copy_state), GFP_KERNEL);
if (!copy) if (!copy)
return -ENOMEM; return -ENOMEM;
...@@ -254,7 +254,7 @@ static int process_copy_commit(struct file *dst, loff_t pos_dst, ...@@ -254,7 +254,7 @@ static int process_copy_commit(struct file *dst, loff_t pos_dst,
struct nfs_commitres cres; struct nfs_commitres cres;
int status = -ENOMEM; int status = -ENOMEM;
cres.verf = kzalloc(sizeof(struct nfs_writeverf), GFP_NOFS); cres.verf = kzalloc(sizeof(struct nfs_writeverf), GFP_KERNEL);
if (!cres.verf) if (!cres.verf)
goto out; goto out;
...@@ -357,7 +357,7 @@ static ssize_t _nfs42_proc_copy(struct file *src, ...@@ -357,7 +357,7 @@ static ssize_t _nfs42_proc_copy(struct file *src,
res->commit_res.verf = NULL; res->commit_res.verf = NULL;
if (args->sync) { if (args->sync) {
res->commit_res.verf = res->commit_res.verf =
kzalloc(sizeof(struct nfs_writeverf), GFP_NOFS); kzalloc(sizeof(struct nfs_writeverf), GFP_KERNEL);
if (!res->commit_res.verf) if (!res->commit_res.verf)
return -ENOMEM; return -ENOMEM;
} }
...@@ -552,7 +552,7 @@ static int nfs42_do_offload_cancel_async(struct file *dst, ...@@ -552,7 +552,7 @@ static int nfs42_do_offload_cancel_async(struct file *dst,
if (!(dst_server->caps & NFS_CAP_OFFLOAD_CANCEL)) if (!(dst_server->caps & NFS_CAP_OFFLOAD_CANCEL))
return -EOPNOTSUPP; return -EOPNOTSUPP;
data = kzalloc(sizeof(struct nfs42_offloadcancel_data), GFP_NOFS); data = kzalloc(sizeof(struct nfs42_offloadcancel_data), GFP_KERNEL);
if (data == NULL) if (data == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -629,7 +629,7 @@ int nfs42_proc_copy_notify(struct file *src, struct file *dst, ...@@ -629,7 +629,7 @@ int nfs42_proc_copy_notify(struct file *src, struct file *dst,
if (!(src_server->caps & NFS_CAP_COPY_NOTIFY)) if (!(src_server->caps & NFS_CAP_COPY_NOTIFY))
return -EOPNOTSUPP; return -EOPNOTSUPP;
args = kzalloc(sizeof(struct nfs42_copy_notify_args), GFP_NOFS); args = kzalloc(sizeof(struct nfs42_copy_notify_args), GFP_KERNEL);
if (args == NULL) if (args == NULL)
return -ENOMEM; return -ENOMEM;
......
...@@ -165,7 +165,7 @@ static ssize_t __nfs4_copy_file_range(struct file *file_in, loff_t pos_in, ...@@ -165,7 +165,7 @@ static ssize_t __nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
if (sync) if (sync)
return -EOPNOTSUPP; return -EOPNOTSUPP;
cn_resp = kzalloc(sizeof(struct nfs42_copy_notify_res), cn_resp = kzalloc(sizeof(struct nfs42_copy_notify_res),
GFP_NOFS); GFP_KERNEL);
if (unlikely(cn_resp == NULL)) if (unlikely(cn_resp == NULL))
return -ENOMEM; return -ENOMEM;
...@@ -339,7 +339,7 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt, ...@@ -339,7 +339,7 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt,
res = ERR_PTR(-ENOMEM); res = ERR_PTR(-ENOMEM);
len = strlen(SSC_READ_NAME_BODY) + 16; len = strlen(SSC_READ_NAME_BODY) + 16;
read_name = kzalloc(len, GFP_NOFS); read_name = kzalloc(len, GFP_KERNEL);
if (read_name == NULL) if (read_name == NULL)
goto out; goto out;
snprintf(read_name, len, SSC_READ_NAME_BODY, read_name_gen++); snprintf(read_name, len, SSC_READ_NAME_BODY, read_name_gen++);
......
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