aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-01-09 12:19:38 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-09 15:39:28 +0100
commit3c88bdbbf919c1181d6ae14afa6c3a9b0de57b34 (patch)
treebe363ec739afc9b09338fc260f33ef94418efa50 /drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
parentstaging: pi433: replace shifting with BIT macro (diff)
downloadlinux-dev-3c88bdbbf919c1181d6ae14afa6c3a9b0de57b34.tar.xz
linux-dev-3c88bdbbf919c1181d6ae14afa6c3a9b0de57b34.zip
staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc.
All usages of the form LIBCFS_ALLOC(variable, sizeof(variable)) or LIBCFS_ALLOC(variable, sizeof(variable's-type)) are changed to variable = kzalloc(sizeof(...), GFP_NOFS); Similarly, all LIBCFS_FREE(variable, sizeof(variable)) become kfree(variable); None of these need the vmalloc option, or any of the other minor benefits of LIBCFS_ALLOC(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c')
-rw-r--r--drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
index d827f770e831..05982dac781c 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
@@ -467,7 +467,7 @@ ksocknal_send_hello_v1(struct ksock_conn *conn, struct ksock_hello_msg *hello)
BUILD_BUG_ON(sizeof(struct lnet_magicversion) != offsetof(struct lnet_hdr, src_nid));
- LIBCFS_ALLOC(hdr, sizeof(*hdr));
+ hdr = kzalloc(sizeof(*hdr), GFP_NOFS);
if (!hdr) {
CERROR("Can't allocate struct lnet_hdr\n");
return -ENOMEM;
@@ -526,7 +526,7 @@ ksocknal_send_hello_v1(struct ksock_conn *conn, struct ksock_hello_msg *hello)
&conn->ksnc_ipaddr, conn->ksnc_port);
}
out:
- LIBCFS_FREE(hdr, sizeof(*hdr));
+ kfree(hdr);
return rc;
}
@@ -582,7 +582,7 @@ ksocknal_recv_hello_v1(struct ksock_conn *conn, struct ksock_hello_msg *hello,
int rc;
int i;
- LIBCFS_ALLOC(hdr, sizeof(*hdr));
+ hdr = kzalloc(sizeof(*hdr), GFP_NOFS);
if (!hdr) {
CERROR("Can't allocate struct lnet_hdr\n");
return -ENOMEM;
@@ -644,7 +644,7 @@ ksocknal_recv_hello_v1(struct ksock_conn *conn, struct ksock_hello_msg *hello,
}
}
out:
- LIBCFS_FREE(hdr, sizeof(*hdr));
+ kfree(hdr);
return rc;
}