lkml.org 
[lkml]   [2018]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 10/14] staging: lustre: use kmalloc for allocating ksock_tx
The size of the data structure is primarily controlled
by the iovec size, which is limited to 256.
Entries in this vector are 12 bytes, so the whole
will always fit in a page.
So it is safe to use kmalloc (kvmalloc not needed).
So replace LIBCFS_ALLOC with kmalloc.

Signed-off-by: NeilBrown <neilb@suse.com>
---
.../staging/lustre/lnet/klnds/socklnd/socklnd.c | 2 +-
.../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
index dc63ed2ceb97..7dba949a95a7 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
@@ -2282,7 +2282,7 @@ ksocknal_free_buffers(void)

list_for_each_entry_safe(tx, temp, &zlist, tx_list) {
list_del(&tx->tx_list);
- LIBCFS_FREE(tx, tx->tx_desc_size);
+ kfree(tx);
}
} else {
spin_unlock(&ksocknal_data.ksnd_tx_lock);
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 994b6693c6b7..11fd3a36424f 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -46,7 +46,7 @@ ksocknal_alloc_tx(int type, int size)
}

if (!tx)
- LIBCFS_ALLOC(tx, size);
+ tx = kzalloc(size, GFP_NOFS);

if (!tx)
return NULL;
@@ -102,7 +102,7 @@ ksocknal_free_tx(struct ksock_tx *tx)

spin_unlock(&ksocknal_data.ksnd_tx_lock);
} else {
- LIBCFS_FREE(tx, tx->tx_desc_size);
+ kfree(tx);
}
}


\
 
 \ /
  Last update: 2018-01-14 23:18    [W:0.226 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site