aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-01-08 20:19:38 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-09 09:41:57 -0500
commitdc31f99be6822a16b119a1f145555757c6761b36 (patch)
tree93b225533971fb961f1368edaa10d4084893d113
parentdb1e7806d39ec0d6486aa7114e9d0a3a4e7f3399 (diff)
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c2
-rw-r--r--drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c4
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)
2282 2282
2283 list_for_each_entry_safe(tx, temp, &zlist, tx_list) { 2283 list_for_each_entry_safe(tx, temp, &zlist, tx_list) {
2284 list_del(&tx->tx_list); 2284 list_del(&tx->tx_list);
2285 LIBCFS_FREE(tx, tx->tx_desc_size); 2285 kfree(tx);
2286 } 2286 }
2287 } else { 2287 } else {
2288 spin_unlock(&ksocknal_data.ksnd_tx_lock); 2288 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)
46 } 46 }
47 47
48 if (!tx) 48 if (!tx)
49 LIBCFS_ALLOC(tx, size); 49 tx = kzalloc(size, GFP_NOFS);
50 50
51 if (!tx) 51 if (!tx)
52 return NULL; 52 return NULL;
@@ -102,7 +102,7 @@ ksocknal_free_tx(struct ksock_tx *tx)
102 102
103 spin_unlock(&ksocknal_data.ksnd_tx_lock); 103 spin_unlock(&ksocknal_data.ksnd_tx_lock);
104 } else { 104 } else {
105 LIBCFS_FREE(tx, tx->tx_desc_size); 105 kfree(tx);
106 } 106 }
107} 107}
108 108