diff options
author | NeilBrown <neilb@suse.com> | 2018-02-20 13:23:37 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-22 15:06:36 +0100 |
commit | c90e17185722edb75ada5775f560279ab1d32b70 (patch) | |
tree | fc42eafee068a8cac070d14bac6a01b45d3aee45 /drivers/staging/lustre/lustre/ptlrpc/service.c | |
parent | 033085ff96a1615b08e80fd4327f2608ff7408cb (diff) |
staging: lustre: discard libcfs_kvzalloc and linux-mem.c
The only interesting difference between libcfs_kvzalloc()
and kvzalloc() is that the former appears to work
with GFP_NOFS, which the latter gives a WARN_ON_ONCE()
when that is attempted.
Each libcfs_kvzalloc() should really be analysed
and either converted to a kzalloc() call if the size is never
more than a page, or to use GFP_KERNEL if no locks are held.
If there is ever a case where locks are held and a large allocation
is needed, then some other technique should be used.
It might be nice to not always blindly zero pages too...
For now, just convert libcfs_kvzalloc() calls to
kvzalloc(), and let the warning remind us that there is work to do.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/ptlrpc/service.c')
-rw-r--r-- | drivers/staging/lustre/lustre/ptlrpc/service.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index 57e41e2cd30a..79d9f3860022 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -1068,7 +1068,7 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req) reqcopy = ptlrpc_request_cache_alloc(GFP_NOFS); if (!reqcopy) return -ENOMEM; - reqmsg = libcfs_kvzalloc(req->rq_reqlen, GFP_NOFS); + reqmsg = kvzalloc(req->rq_reqlen, GFP_NOFS); if (!reqmsg) { rc = -ENOMEM; goto out_free; @@ -2077,7 +2077,7 @@ static int ptlrpc_main(void *arg) } /* Alloc reply state structure for this one */ - rs = libcfs_kvzalloc(svc->srv_max_reply_size, GFP_NOFS); + rs = kvzalloc(svc->srv_max_reply_size, GFP_NOFS); if (!rs) { rc = -ENOMEM; goto out_srv_fini; |