Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1588431 > unrolled thread
| Started by | James Simmons <jsimmons@infradead.org> |
|---|---|
| First post | 2017-02-27 01:50 +0100 |
| Last post | 2017-02-27 03:40 +0100 |
| Articles | 20 on this page of 33 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 00/34] staging: lustre: lnet: remove most of typedefs from LNet headers James Simmons <jsimmons@infradead.org> - 2017-02-27 01:50 +0100
[PATCH 01/34] staging: lustre: socklnd: change UAPI typedefs to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 01:50 +0100
[PATCH 12/34] staging: lustre: lnet: change lnd_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 09/34] staging: lustre: lnet: change lnet_me_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 11/34] staging: lustre: lnet: change lnet_test_peer_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 06/34] staging: lustre: lnet: change lnet_msg_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 16/34] staging: lustre: lnet: change lnet_route_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 07/34] staging: lustre: lnet: change lnet_libhandle_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 10/34] staging: lustre: lnet: change lnet_libmd_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 05/34] staging: lustre: lnet: remove generic lnet_handle_any_t James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 17/34] staging: lustre: lnet: change lnet_remotenet_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 15/34] staging: lustre: lnet: change lnet_peer_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 08/34] staging: lustre: lnet: change lnet_eq_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:00 +0100
[PATCH 27/34] staging: lustre: lnet: change lnet_msg_type_t to proper enum James Simmons <jsimmons@infradead.org> - 2017-02-27 02:10 +0100
[PATCH 23/34] staging: lustre: lnet: change lnet_counter_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:10 +0100
[PATCH 19/34] staging: lustre: lnet: change lnet_rtrbuf_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:10 +0100
[PATCH 21/34] staging: lustre: lnet: change lnet_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:10 +0100
[PATCH 18/34] staging: lustre: lnet: change lnet_rtrbufpool_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:10 +0100
[PATCH 31/34] staging: lustre: lnet: change lnet_ack_req_t to proper enum James Simmons <jsimmons@infradead.org> - 2017-02-27 02:20 +0100
[PATCH 02/34] staging: lustre: lnet: change lnet_handle_eq_t to proper struct James Simmons <jsimmons@infradead.org> - 2017-02-27 02:20 +0100
[PATCH 03/34] staging: lustre: lnet: change lnet_handle_md_t to proper struct James Simmons <jsimmons@infradead.org> - 2017-02-27 02:20 +0100
[PATCH 04/34] staging: lustre: lnet: change lnet_handle_me_t to proper struct James Simmons <jsimmons@infradead.org> - 2017-02-27 02:20 +0100
[PATCH 32/34] staging: lustre: lnet: remove LNET_SEQ_BASETYPE James Simmons <jsimmons@infradead.org> - 2017-02-27 02:20 +0100
[PATCH 14/34] staging: lustre: lnet: change lnet_rc_data_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:20 +0100
[PATCH 28/34] staging: lustre: lnet: change lnet_unlink_t to proper enum James Simmons <jsimmons@infradead.org> - 2017-02-27 02:20 +0100
[PATCH 34/34] staging: lustre: lnet: use struct bio_vec instead of typedef James Simmons <jsimmons@infradead.org> - 2017-02-27 02:20 +0100
[PATCH 33/34] staging: lustre: lnet: remove unused lnet_md_iovec_t James Simmons <jsimmons@infradead.org> - 2017-02-27 02:20 +0100
[PATCH 20/34] staging: lustre: lnet: change lnet_portal_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:30 +0100
[PATCH 24/34] staging: lustre: lnet: change lnet_md_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 02:40 +0100
[PATCH 29/34] staging: lustre: lnet: change lnet_ins_pos_t to proper enum James Simmons <jsimmons@infradead.org> - 2017-02-27 02:50 +0100
[PATCH 30/34] staging: lustre: lnet: change lnet_event_kind_t to proper enum James Simmons <jsimmons@infradead.org> - 2017-02-27 02:50 +0100
[PATCH 22/34] staging: lustre: lnet: give LNET_MATCH* enum a name James Simmons <jsimmons@infradead.org> - 2017-02-27 03:30 +0100
[PATCH 25/34] staging: lustre: lnet: change lnet_event_t to proper structure James Simmons <jsimmons@infradead.org> - 2017-02-27 03:40 +0100
Page 1 of 2 [1] 2 Next page →
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 01:50 +0100 |
| Subject | [PATCH 00/34] staging: lustre: lnet: remove most of typedefs from LNet headers |
| Message-ID | <tfhFL-675-3@gated-at.bofh.it> |
Remove the majority of typedefs from the LNet headers. Change them into structures or enums instead. Currently only lnet_nid_t are lnet_pid_t are left. Removed the rest of the typedefs in socklnd.h as well James Simmons (34): staging: lustre: socklnd: change UAPI typedefs to proper structure staging: lustre: lnet: change lnet_handle_eq_t to proper struct staging: lustre: lnet: change lnet_handle_md_t to proper struct staging: lustre: lnet: change lnet_handle_me_t to proper struct staging: lustre: lnet: remove generic lnet_handle_any_t staging: lustre: lnet: change lnet_msg_t to proper structure staging: lustre: lnet: change lnet_libhandle_t to proper structure staging: lustre: lnet: change lnet_eq_t to proper structure staging: lustre: lnet: change lnet_me_t to proper structure staging: lustre: lnet: change lnet_libmd_t to proper structure staging: lustre: lnet: change lnet_test_peer_t to proper structure staging: lustre: lnet: change lnd_t to proper structure staging: lustre: lnet: change lnet_ni_t to proper structure staging: lustre: lnet: change lnet_rc_data_t to proper structure staging: lustre: lnet: change lnet_peer_t to proper structure staging: lustre: lnet: change lnet_route_t to proper structure staging: lustre: lnet: change lnet_remotenet_t to proper structure staging: lustre: lnet: change lnet_rtrbufpool_t to proper structure staging: lustre: lnet: change lnet_rtrbuf_t to proper structure staging: lustre: lnet: change lnet_portal_t to proper structure staging: lustre: lnet: change lnet_t to proper structure staging: lustre: lnet: give LNET_MATCH* enum a name staging: lustre: lnet: change lnet_counter_t to proper structure staging: lustre: lnet: change lnet_md_t to proper structure staging: lustre: lnet: change lnet_event_t to proper structure staging: lustre: lnet: change lnet_process_id_t to proper structure staging: lustre: lnet: change lnet_msg_type_t to proper enum staging: lustre: lnet: change lnet_unlink_t to proper enum staging: lustre: lnet: change lnet_ins_pos_t to proper enum staging: lustre: lnet: change lnet_event_kind_t to proper enum staging: lustre: lnet: change lnet_ack_req_t to proper enum staging: lustre: lnet: remove LNET_SEQ_BASETYPE staging: lustre: lnet: remove unused lnet_md_iovec_t staging: lustre: lnet: use struct bio_vec instead of typedef drivers/staging/lustre/include/linux/lnet/api.h | 65 +++--- .../staging/lustre/include/linux/lnet/lib-lnet.h | 232 +++++++++++---------- .../staging/lustre/include/linux/lnet/lib-types.h | 137 ++++++------ drivers/staging/lustre/include/linux/lnet/lnetst.h | 12 +- drivers/staging/lustre/include/linux/lnet/nidstr.h | 2 +- .../staging/lustre/include/linux/lnet/socklnd.h | 14 +- drivers/staging/lustre/include/linux/lnet/types.h | 155 +++++++------- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 30 +-- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 21 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 65 +++--- .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 2 +- .../staging/lustre/lnet/klnds/socklnd/socklnd.c | 69 +++--- .../staging/lustre/lnet/klnds/socklnd/socklnd.h | 76 +++---- .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 54 ++--- .../lustre/lnet/klnds/socklnd/socklnd_lib.c | 4 +- .../lustre/lnet/klnds/socklnd/socklnd_proto.c | 38 ++-- drivers/staging/lustre/lnet/lnet/acceptor.c | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 151 +++++++------- drivers/staging/lustre/lnet/lnet/config.c | 8 +- drivers/staging/lustre/lnet/lnet/lib-eq.c | 26 +-- drivers/staging/lustre/lnet/lnet/lib-md.c | 29 +-- drivers/staging/lustre/lnet/lnet/lib-me.c | 28 +-- drivers/staging/lustre/lnet/lnet/lib-move.c | 195 ++++++++--------- drivers/staging/lustre/lnet/lnet/lib-msg.c | 41 ++-- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 30 +-- drivers/staging/lustre/lnet/lnet/lo.c | 12 +- drivers/staging/lustre/lnet/lnet/nidstrings.c | 2 +- drivers/staging/lustre/lnet/lnet/peer.c | 38 ++-- drivers/staging/lustre/lnet/lnet/router.c | 164 ++++++++------- drivers/staging/lustre/lnet/lnet/router_proc.c | 34 +-- drivers/staging/lustre/lnet/selftest/brw_test.c | 4 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 6 +- drivers/staging/lustre/lnet/selftest/console.c | 39 ++-- drivers/staging/lustre/lnet/selftest/console.h | 14 +- drivers/staging/lustre/lnet/selftest/framework.c | 4 +- drivers/staging/lustre/lnet/selftest/ping_test.c | 2 +- drivers/staging/lustre/lnet/selftest/rpc.c | 31 +-- drivers/staging/lustre/lnet/selftest/rpc.h | 2 +- drivers/staging/lustre/lnet/selftest/selftest.h | 42 ++-- drivers/staging/lustre/lustre/include/lustre_net.h | 32 +-- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/llite/super25.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 5 +- drivers/staging/lustre/lustre/ptlrpc/client.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/connection.c | 6 +- drivers/staging/lustre/lustre/ptlrpc/events.c | 18 +- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 24 +-- drivers/staging/lustre/lustre/ptlrpc/pers.c | 2 +- .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 2 +- 49 files changed, 1004 insertions(+), 973 deletions(-) -- 1.8.3.1
[toc] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 01:50 +0100 |
| Subject | [PATCH 01/34] staging: lustre: socklnd: change UAPI typedefs to proper structure |
| Message-ID | <tfhFM-675-7@gated-at.bofh.it> |
| In reply to | #1588431 |
The upstream kernel requires proper structures so
convert all the UAPI typedefs in socklnd.h.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/18506
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
.../staging/lustre/include/linux/lnet/socklnd.h | 14 ++++----
.../staging/lustre/lnet/klnds/socklnd/socklnd.c | 8 ++---
.../staging/lustre/lnet/klnds/socklnd/socklnd.h | 14 ++++----
.../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 22 ++++++-------
.../lustre/lnet/klnds/socklnd/socklnd_proto.c | 38 +++++++++++-----------
5 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h b/drivers/staging/lustre/include/linux/lnet/socklnd.h
index acf20ce..dd5bc0e 100644
--- a/drivers/staging/lustre/include/linux/lnet/socklnd.h
+++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h
@@ -45,7 +45,7 @@
#define SOCKLND_CONN_ACK SOCKLND_CONN_BULK_IN
-typedef struct {
+struct ksock_hello_msg {
__u32 kshm_magic; /* magic number of socklnd message */
__u32 kshm_version; /* version of socklnd message */
lnet_nid_t kshm_src_nid; /* sender's nid */
@@ -57,9 +57,9 @@
__u32 kshm_ctype; /* connection type */
__u32 kshm_nips; /* # IP addrs */
__u32 kshm_ips[0]; /* IP addrs */
-} WIRE_ATTR ksock_hello_msg_t;
+} WIRE_ATTR;
-typedef struct {
+struct ksock_lnet_msg {
struct lnet_hdr ksnm_hdr; /* lnet hdr */
/*
@@ -68,17 +68,17 @@
* structure definitions. lnet payload will be stored just after
* the body of structure ksock_lnet_msg_t
*/
-} WIRE_ATTR ksock_lnet_msg_t;
+} WIRE_ATTR;
-typedef struct {
+struct ksock_msg {
__u32 ksm_type; /* type of socklnd message */
__u32 ksm_csum; /* checksum if != 0 */
__u64 ksm_zc_cookies[2]; /* Zero-Copy request/ACK cookie */
union {
- ksock_lnet_msg_t lnetmsg;/* lnet message, it's empty if
+ struct ksock_lnet_msg lnetmsg; /* lnet message, it's empty if
* it's NOOP */
} WIRE_ATTR ksm_u;
-} WIRE_ATTR ksock_msg_t;
+} WIRE_ATTR;
#define KSOCK_MSG_NOOP 0xC0 /* ksm_u empty */
#define KSOCK_MSG_LNET 0xC1 /* lnet msg */
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
index f25de3d..3b08aff 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
@@ -1038,7 +1038,7 @@ struct ksock_peer *
struct ksock_peer *peer = NULL;
struct ksock_peer *peer2;
struct ksock_sched *sched;
- ksock_hello_msg_t *hello;
+ struct ksock_hello_msg *hello;
int cpt;
struct ksock_tx *tx;
struct ksock_tx *txtmp;
@@ -1077,7 +1077,7 @@ struct ksock_peer *
conn->ksnc_tx_carrier = NULL;
atomic_set(&conn->ksnc_tx_nob, 0);
- LIBCFS_ALLOC(hello, offsetof(ksock_hello_msg_t,
+ LIBCFS_ALLOC(hello, offsetof(struct ksock_hello_msg,
kshm_ips[LNET_MAX_INTERFACES]));
if (!hello) {
rc = -ENOMEM;
@@ -1341,7 +1341,7 @@ struct ksock_peer *
rc = ksocknal_send_hello(ni, conn, peerid.nid, hello);
}
- LIBCFS_FREE(hello, offsetof(ksock_hello_msg_t,
+ LIBCFS_FREE(hello, offsetof(struct ksock_hello_msg,
kshm_ips[LNET_MAX_INTERFACES]));
/*
@@ -1423,7 +1423,7 @@ struct ksock_peer *
failed_1:
if (hello)
- LIBCFS_FREE(hello, offsetof(ksock_hello_msg_t,
+ LIBCFS_FREE(hello, offsetof(struct ksock_hello_msg,
kshm_ips[LNET_MAX_INTERFACES]));
LIBCFS_FREE(conn, sizeof(*conn));
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
index 9e86563..3631998 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
@@ -287,7 +287,7 @@ struct ksock_tx { /* transmit packet */
lnet_msg_t *tx_lnetmsg; /* lnet message for lnet_finalize()
*/
unsigned long tx_deadline; /* when (in jiffies) tx times out */
- ksock_msg_t tx_msg; /* socklnd message buffer */
+ struct ksock_msg tx_msg; /* socklnd message buffer */
int tx_desc_size; /* size of this descriptor */
union {
struct {
@@ -369,7 +369,7 @@ struct ksock_conn {
*/
void *ksnc_cookie; /* rx lnet_finalize passthru arg
*/
- ksock_msg_t ksnc_msg; /* incoming message buffer:
+ struct ksock_msg ksnc_msg; /* incoming message buffer:
* V2.x message takes the
* whole struct
* V1.x message is a bare
@@ -474,16 +474,16 @@ struct ksock_proto {
int pro_version;
/* handshake function */
- int (*pro_send_hello)(struct ksock_conn *, ksock_hello_msg_t *);
+ int (*pro_send_hello)(struct ksock_conn *, struct ksock_hello_msg *);
/* handshake function */
- int (*pro_recv_hello)(struct ksock_conn *, ksock_hello_msg_t *, int);
+ int (*pro_recv_hello)(struct ksock_conn *, struct ksock_hello_msg *, int);
/* message pack */
void (*pro_pack)(struct ksock_tx *);
/* message unpack */
- void (*pro_unpack)(ksock_msg_t *);
+ void (*pro_unpack)(struct ksock_msg *);
/* queue tx on the connection */
struct ksock_tx *(*pro_queue_tx_msg)(struct ksock_conn *, struct ksock_tx *);
@@ -691,9 +691,9 @@ int ksocknal_launch_packet(lnet_ni_t *ni, struct ksock_tx *tx,
int ksocknal_connd(void *arg);
int ksocknal_reaper(void *arg);
int ksocknal_send_hello(lnet_ni_t *ni, struct ksock_conn *conn,
- lnet_nid_t peer_nid, ksock_hello_msg_t *hello);
+ lnet_nid_t peer_nid, struct ksock_hello_msg *hello);
int ksocknal_recv_hello(lnet_ni_t *ni, struct ksock_conn *conn,
- ksock_hello_msg_t *hello, lnet_process_id_t *id,
+ struct ksock_hello_msg *hello, lnet_process_id_t *id,
__u64 *incarnation);
void ksocknal_read_callback(struct ksock_conn *conn);
void ksocknal_write_callback(struct ksock_conn *conn);
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 4c9f927..9fbae62 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -695,7 +695,7 @@ struct ksock_conn *
ksocknal_queue_tx_locked(struct ksock_tx *tx, struct ksock_conn *conn)
{
struct ksock_sched *sched = conn->ksnc_scheduler;
- ksock_msg_t *msg = &tx->tx_msg;
+ struct ksock_msg *msg = &tx->tx_msg;
struct ksock_tx *ztx = NULL;
int bufnob = 0;
@@ -1072,9 +1072,9 @@ struct ksock_route *
conn->ksnc_rx_iov = (struct kvec *)&conn->ksnc_rx_iov_space;
conn->ksnc_rx_iov[0].iov_base = &conn->ksnc_msg;
- conn->ksnc_rx_nob_wanted = offsetof(ksock_msg_t, ksm_u);
- conn->ksnc_rx_nob_left = offsetof(ksock_msg_t, ksm_u);
- conn->ksnc_rx_iov[0].iov_len = offsetof(ksock_msg_t, ksm_u);
+ conn->ksnc_rx_nob_wanted = offsetof(struct ksock_msg, ksm_u);
+ conn->ksnc_rx_nob_left = offsetof(struct ksock_msg, ksm_u);
+ conn->ksnc_rx_iov[0].iov_len = offsetof(struct ksock_msg, ksm_u);
break;
case KSOCK_PROTO_V1:
@@ -1232,12 +1232,12 @@ struct ksock_route *
}
conn->ksnc_rx_state = SOCKNAL_RX_LNET_HEADER;
- conn->ksnc_rx_nob_wanted = sizeof(ksock_lnet_msg_t);
- conn->ksnc_rx_nob_left = sizeof(ksock_lnet_msg_t);
+ conn->ksnc_rx_nob_wanted = sizeof(struct ksock_lnet_msg);
+ conn->ksnc_rx_nob_left = sizeof(struct ksock_lnet_msg);
conn->ksnc_rx_iov = (struct kvec *)&conn->ksnc_rx_iov_space;
conn->ksnc_rx_iov[0].iov_base = &conn->ksnc_msg.ksm_u.lnetmsg;
- conn->ksnc_rx_iov[0].iov_len = sizeof(ksock_lnet_msg_t);
+ conn->ksnc_rx_iov[0].iov_len = sizeof(struct ksock_lnet_msg);
conn->ksnc_rx_niov = 1;
conn->ksnc_rx_kiov = NULL;
@@ -1633,7 +1633,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)
}
static struct ksock_proto *
-ksocknal_parse_proto_version(ksock_hello_msg_t *hello)
+ksocknal_parse_proto_version(struct ksock_hello_msg *hello)
{
__u32 version = 0;
@@ -1664,7 +1664,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)
struct lnet_magicversion *hmv = (struct lnet_magicversion *)hello;
BUILD_BUG_ON(sizeof(struct lnet_magicversion) !=
- offsetof(ksock_hello_msg_t, kshm_src_nid));
+ offsetof(struct ksock_hello_msg, kshm_src_nid));
if (hmv->version_major == cpu_to_le16(KSOCK_PROTO_V1_MAJOR) &&
hmv->version_minor == cpu_to_le16(KSOCK_PROTO_V1_MINOR))
@@ -1676,7 +1676,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)
int
ksocknal_send_hello(lnet_ni_t *ni, struct ksock_conn *conn,
- lnet_nid_t peer_nid, ksock_hello_msg_t *hello)
+ lnet_nid_t peer_nid, struct ksock_hello_msg *hello)
{
/* CAVEAT EMPTOR: this byte flips 'ipaddrs' */
struct ksock_net *net = (struct ksock_net *)ni->ni_data;
@@ -1714,7 +1714,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)
int
ksocknal_recv_hello(lnet_ni_t *ni, struct ksock_conn *conn,
- ksock_hello_msg_t *hello, lnet_process_id_t *peerid,
+ struct ksock_hello_msg *hello, lnet_process_id_t *peerid,
__u64 *incarnation)
{
/* Return < 0 fatal error
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
index d367e74..84be9a5 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
@@ -287,11 +287,11 @@
if (!tx || !tx->tx_lnetmsg) {
/* noop packet */
- nob = offsetof(ksock_msg_t, ksm_u);
+ nob = offsetof(struct ksock_msg, ksm_u);
} else {
nob = tx->tx_lnetmsg->msg_len +
((conn->ksnc_proto == &ksocknal_protocol_v1x) ?
- sizeof(struct lnet_hdr) : sizeof(ksock_msg_t));
+ sizeof(struct lnet_hdr) : sizeof(struct ksock_msg));
}
/* default checking for typed connection */
@@ -325,9 +325,9 @@
int nob;
if (!tx || !tx->tx_lnetmsg)
- nob = offsetof(ksock_msg_t, ksm_u);
+ nob = offsetof(struct ksock_msg, ksm_u);
else
- nob = tx->tx_lnetmsg->msg_len + sizeof(ksock_msg_t);
+ nob = tx->tx_lnetmsg->msg_len + sizeof(struct ksock_msg);
switch (conn->ksnc_type) {
default:
@@ -456,7 +456,7 @@
}
static int
-ksocknal_send_hello_v1(struct ksock_conn *conn, ksock_hello_msg_t *hello)
+ksocknal_send_hello_v1(struct ksock_conn *conn, struct ksock_hello_msg *hello)
{
struct socket *sock = conn->ksnc_sock;
struct lnet_hdr *hdr;
@@ -531,7 +531,7 @@
}
static int
-ksocknal_send_hello_v2(struct ksock_conn *conn, ksock_hello_msg_t *hello)
+ksocknal_send_hello_v2(struct ksock_conn *conn, struct ksock_hello_msg *hello)
{
struct socket *sock = conn->ksnc_sock;
int rc;
@@ -549,7 +549,7 @@
LNET_UNLOCK();
}
- rc = lnet_sock_write(sock, hello, offsetof(ksock_hello_msg_t, kshm_ips),
+ rc = lnet_sock_write(sock, hello, offsetof(struct ksock_hello_msg, kshm_ips),
lnet_acceptor_timeout());
if (rc) {
CNETERR("Error %d sending HELLO hdr to %pI4h/%d\n",
@@ -573,7 +573,7 @@
}
static int
-ksocknal_recv_hello_v1(struct ksock_conn *conn, ksock_hello_msg_t *hello,
+ksocknal_recv_hello_v1(struct ksock_conn *conn, struct ksock_hello_msg *hello,
int timeout)
{
struct socket *sock = conn->ksnc_sock;
@@ -649,7 +649,7 @@
}
static int
-ksocknal_recv_hello_v2(struct ksock_conn *conn, ksock_hello_msg_t *hello,
+ksocknal_recv_hello_v2(struct ksock_conn *conn, struct ksock_hello_msg *hello,
int timeout)
{
struct socket *sock = conn->ksnc_sock;
@@ -662,8 +662,8 @@
conn->ksnc_flip = 1;
rc = lnet_sock_read(sock, &hello->kshm_src_nid,
- offsetof(ksock_hello_msg_t, kshm_ips) -
- offsetof(ksock_hello_msg_t, kshm_src_nid),
+ offsetof(struct ksock_hello_msg, kshm_ips) -
+ offsetof(struct ksock_hello_msg, kshm_src_nid),
timeout);
if (rc) {
CERROR("Error %d reading HELLO from %pI4h\n",
@@ -738,15 +738,15 @@
LASSERT(tx->tx_msg.ksm_type != KSOCK_MSG_NOOP);
tx->tx_msg.ksm_u.lnetmsg.ksnm_hdr = tx->tx_lnetmsg->msg_hdr;
- tx->tx_iov[0].iov_len = sizeof(ksock_msg_t);
- tx->tx_nob = sizeof(ksock_msg_t) + tx->tx_lnetmsg->msg_len;
- tx->tx_resid = sizeof(ksock_msg_t) + tx->tx_lnetmsg->msg_len;
+ tx->tx_iov[0].iov_len = sizeof(struct ksock_msg);
+ tx->tx_nob = sizeof(struct ksock_msg) + tx->tx_lnetmsg->msg_len;
+ tx->tx_resid = sizeof(struct ksock_msg) + tx->tx_lnetmsg->msg_len;
} else {
LASSERT(tx->tx_msg.ksm_type == KSOCK_MSG_NOOP);
- tx->tx_iov[0].iov_len = offsetof(ksock_msg_t, ksm_u.lnetmsg.ksnm_hdr);
- tx->tx_nob = offsetof(ksock_msg_t, ksm_u.lnetmsg.ksnm_hdr);
- tx->tx_resid = offsetof(ksock_msg_t, ksm_u.lnetmsg.ksnm_hdr);
+ tx->tx_iov[0].iov_len = offsetof(struct ksock_msg, ksm_u.lnetmsg.ksnm_hdr);
+ tx->tx_nob = offsetof(struct ksock_msg, ksm_u.lnetmsg.ksnm_hdr);
+ tx->tx_resid = offsetof(struct ksock_msg, ksm_u.lnetmsg.ksnm_hdr);
}
/*
* Don't checksum before start sending, because packet can be
@@ -755,7 +755,7 @@
}
static void
-ksocknal_unpack_msg_v1(ksock_msg_t *msg)
+ksocknal_unpack_msg_v1(struct ksock_msg *msg)
{
msg->ksm_csum = 0;
msg->ksm_type = KSOCK_MSG_LNET;
@@ -764,7 +764,7 @@
}
static void
-ksocknal_unpack_msg_v2(ksock_msg_t *msg)
+ksocknal_unpack_msg_v2(struct ksock_msg *msg)
{
return; /* Do nothing */
}
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 12/34] staging: lustre: lnet: change lnd_t to proper structure |
| Message-ID | <tfhPr-6aG-1@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnd_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 6 +++---
drivers/staging/lustre/include/linux/lnet/lib-types.h | 6 +++---
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 4 ++--
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c | 2 +-
drivers/staging/lustre/lnet/lnet/api-ni.c | 14 +++++++-------
drivers/staging/lustre/lnet/lnet/lo.c | 2 +-
6 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 685c5d4..9a29769 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -439,7 +439,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
((1U << the_lnet.ln_remote_nets_hbits) - 1)];
}
-extern lnd_t the_lolnd;
+extern struct lnet_lnd the_lolnd;
extern int avoid_asym_router_failure;
int lnet_cpt_of_nid_locked(lnet_nid_t nid);
@@ -628,8 +628,8 @@ void lnet_copy_kiov2iter(struct iov_iter *to,
void lnet_md_unlink(struct lnet_libmd *md);
void lnet_md_deconstruct(struct lnet_libmd *lmd, lnet_md_t *umd);
-void lnet_register_lnd(lnd_t *lnd);
-void lnet_unregister_lnd(lnd_t *lnd);
+void lnet_register_lnd(struct lnet_lnd *lnd);
+void lnet_unregister_lnd(struct lnet_lnd *lnd);
int lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
__u32 local_ip, __u32 peer_ip, int peer_port);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 59d7143..8a65db2 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -179,7 +179,7 @@ struct lnet_test_peer {
struct lnet_ni; /* forward ref */
-typedef struct lnet_lnd {
+struct lnet_lnd {
/* fields managed by portals */
struct list_head lnd_list; /* stash in the LND table */
int lnd_refcount; /* # active instances */
@@ -243,7 +243,7 @@ struct lnet_test_peer {
/* accept a new connection */
int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock);
-} lnd_t;
+};
struct lnet_tx_queue {
int tq_credits; /* # tx credits free */
@@ -267,7 +267,7 @@ struct lnet_tx_queue {
__u32 *ni_cpts; /* bond NI on some CPTs */
lnet_nid_t ni_nid; /* interface's NID */
void *ni_data; /* instance-specific data */
- lnd_t *ni_lnd; /* procedural interface */
+ struct lnet_lnd *ni_lnd; /* procedural interface */
struct lnet_tx_queue **ni_tx_queues; /* percpt TX queues */
int **ni_refs; /* percpt reference count */
time64_t ni_last_alive;/* when I was last alive */
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index 6f73454..29a5263 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -38,7 +38,7 @@
#include <asm/page.h>
#include "o2iblnd.h"
-static lnd_t the_o2iblnd;
+static struct lnet_lnd the_o2iblnd;
struct kib_data kiblnd_data;
@@ -2938,7 +2938,7 @@ static int kiblnd_startup(lnet_ni_t *ni)
return -ENETDOWN;
}
-static lnd_t the_o2iblnd = {
+static struct lnet_lnd the_o2iblnd = {
.lnd_type = O2IBLND,
.lnd_startup = kiblnd_startup,
.lnd_shutdown = kiblnd_shutdown,
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
index 3b08aff..258507f 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
@@ -39,7 +39,7 @@
#include "socklnd.h"
-static lnd_t the_ksocklnd;
+static struct lnet_lnd the_ksocklnd;
struct ksock_nal_data ksocknal_data;
static struct ksock_interface *
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index aeb9e6f..d31a50b 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -265,15 +265,15 @@ static void lnet_assert_wire_constants(void)
BUILD_BUG_ON((int)sizeof(((struct lnet_hdr *)0)->msg.hello.type) != 4);
}
-static lnd_t *
+static struct lnet_lnd *
lnet_find_lnd_by_type(__u32 type)
{
- lnd_t *lnd;
+ struct lnet_lnd *lnd;
struct list_head *tmp;
/* holding lnd mutex */
list_for_each(tmp, &the_lnet.ln_lnds) {
- lnd = list_entry(tmp, lnd_t, lnd_list);
+ lnd = list_entry(tmp, struct lnet_lnd, lnd_list);
if (lnd->lnd_type == type)
return lnd;
@@ -283,7 +283,7 @@ static void lnet_assert_wire_constants(void)
}
void
-lnet_register_lnd(lnd_t *lnd)
+lnet_register_lnd(struct lnet_lnd *lnd)
{
mutex_lock(&the_lnet.ln_lnd_mutex);
@@ -300,7 +300,7 @@ static void lnet_assert_wire_constants(void)
EXPORT_SYMBOL(lnet_register_lnd);
void
-lnet_unregister_lnd(lnd_t *lnd)
+lnet_unregister_lnd(struct lnet_lnd *lnd)
{
mutex_lock(&the_lnet.ln_lnd_mutex);
@@ -1220,7 +1220,7 @@ struct lnet_libhandle *
struct lnet_ioctl_config_lnd_tunables *lnd_tunables = NULL;
int rc = -EINVAL;
int lnd_type;
- lnd_t *lnd;
+ struct lnet_lnd *lnd;
struct lnet_tx_queue *tq;
int i;
@@ -1475,7 +1475,7 @@ void lnet_lib_exit(void)
while (!list_empty(&the_lnet.ln_lnds))
lnet_unregister_lnd(list_entry(the_lnet.ln_lnds.next,
- lnd_t, lnd_list));
+ struct lnet_lnd, lnd_list));
lnet_destroy_locks();
}
diff --git a/drivers/staging/lustre/lnet/lnet/lo.c b/drivers/staging/lustre/lnet/lnet/lo.c
index 12b6b3a..d11b4f9 100644
--- a/drivers/staging/lustre/lnet/lnet/lo.c
+++ b/drivers/staging/lustre/lnet/lnet/lo.c
@@ -88,7 +88,7 @@
return 0;
}
-lnd_t the_lolnd = {
+struct lnet_lnd the_lolnd = {
/* .lnd_list = */ {&the_lolnd.lnd_list, &the_lolnd.lnd_list},
/* .lnd_refcount = */ 0,
/* .lnd_type = */ LOLND,
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 09/34] staging: lustre: lnet: change lnet_me_t to proper structure |
| Message-ID | <tfhPw-6aG-3@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_me_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 18 +++++++++---------
drivers/staging/lustre/include/linux/lnet/lib-types.h | 6 +++---
drivers/staging/lustre/lnet/lnet/lib-md.c | 2 +-
drivers/staging/lustre/lnet/lnet/lib-me.c | 4 ++--
drivers/staging/lustre/lnet/lnet/lib-ptl.c | 14 +++++++-------
5 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 9e33d0a..a82bb3c 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -233,17 +233,17 @@ static inline int lnet_md_unlinkable(lnet_libmd_t *md)
LIBCFS_FREE(md, size);
}
-static inline lnet_me_t *
+static inline struct lnet_me *
lnet_me_alloc(void)
{
- lnet_me_t *me;
+ struct lnet_me *me;
LIBCFS_ALLOC(me, sizeof(*me));
return me;
}
static inline void
-lnet_me_free(lnet_me_t *me)
+lnet_me_free(struct lnet_me *me)
{
LIBCFS_FREE(me, sizeof(*me));
}
@@ -342,12 +342,12 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
}
static inline void
-lnet_me2handle(struct lnet_handle_me *handle, lnet_me_t *me)
+lnet_me2handle(struct lnet_handle_me *handle, struct lnet_me *me)
{
handle->cookie = me->me_lh.lh_cookie;
}
-static inline lnet_me_t *
+static inline struct lnet_me *
lnet_handle2me(struct lnet_handle_me *handle)
{
/* ALWAYS called with resource lock held */
@@ -360,7 +360,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
if (!lh)
return NULL;
- return lh_entry(lh, lnet_me_t, me_lh);
+ return lh_entry(lh, struct lnet_me, me_lh);
}
static inline void
@@ -542,9 +542,9 @@ int lnet_mt_match_md(struct lnet_match_table *mtable,
struct lnet_match_info *info, struct lnet_msg *msg);
/* portals match/attach functions */
-void lnet_ptl_attach_md(lnet_me_t *me, lnet_libmd_t *md,
+void lnet_ptl_attach_md(struct lnet_me *me, lnet_libmd_t *md,
struct list_head *matches, struct list_head *drops);
-void lnet_ptl_detach_md(lnet_me_t *me, lnet_libmd_t *md);
+void lnet_ptl_detach_md(struct lnet_me *me, lnet_libmd_t *md);
int lnet_ptl_match_md(struct lnet_match_info *info, struct lnet_msg *msg);
/* initialized and finalize portals */
@@ -623,7 +623,7 @@ void lnet_copy_kiov2iter(struct iov_iter *to,
unsigned int nkiov, const lnet_kiov_t *kiov,
unsigned int kiovoffset, unsigned int nob);
-void lnet_me_unlink(lnet_me_t *me);
+void lnet_me_unlink(struct lnet_me *me);
void lnet_md_unlink(lnet_libmd_t *md);
void lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 19e01cc..3384860 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -127,7 +127,7 @@ struct lnet_eq {
int **eq_refs; /* percpt refcount for EQ */
};
-typedef struct lnet_me {
+struct lnet_me {
struct list_head me_list;
struct lnet_libhandle me_lh;
lnet_process_id_t me_match_id;
@@ -137,12 +137,12 @@ struct lnet_eq {
__u64 me_ignore_bits;
lnet_unlink_t me_unlink;
struct lnet_libmd *me_md;
-} lnet_me_t;
+};
typedef struct lnet_libmd {
struct list_head md_list;
struct lnet_libhandle md_lh;
- lnet_me_t *md_me;
+ struct lnet_me *md_me;
char *md_start;
unsigned int md_offset;
unsigned int md_length;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c
index 4f2700e..dd3cdda 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -44,7 +44,7 @@
{
if (!(md->md_flags & LNET_MD_FLAG_ZOMBIE)) {
/* first unlink attempt... */
- lnet_me_t *me = md->md_me;
+ struct lnet_me *me = md->md_me;
md->md_flags |= LNET_MD_FLAG_ZOMBIE;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-me.c b/drivers/staging/lustre/lnet/lnet/lib-me.c
index 0ea64f6..20cc8f8 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-me.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-me.c
@@ -222,7 +222,7 @@
int
LNetMEUnlink(struct lnet_handle_me meh)
{
- lnet_me_t *me;
+ struct lnet_me *me;
lnet_libmd_t *md;
lnet_event_t ev;
int cpt;
@@ -256,7 +256,7 @@
/* call with lnet_res_lock please */
void
-lnet_me_unlink(lnet_me_t *me)
+lnet_me_unlink(struct lnet_me *me)
{
list_del(&me->me_list);
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index 891d028..b538939 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -140,7 +140,7 @@
*/
unsigned int offset;
unsigned int mlength;
- lnet_me_t *me = md->md_me;
+ struct lnet_me *me = md->md_me;
/* MD exhausted */
if (lnet_md_exhausted(md))
@@ -376,8 +376,8 @@ struct list_head *
struct lnet_match_info *info, struct lnet_msg *msg)
{
struct list_head *head;
- lnet_me_t *me;
- lnet_me_t *tmp;
+ struct lnet_me *me;
+ struct lnet_me *tmp;
int exhausted = 0;
int rc;
@@ -641,7 +641,7 @@ struct list_head *
}
void
-lnet_ptl_detach_md(lnet_me_t *me, lnet_libmd_t *md)
+lnet_ptl_detach_md(struct lnet_me *me, lnet_libmd_t *md)
{
LASSERT(me->me_md == md && md->md_me == me);
@@ -651,7 +651,7 @@ struct list_head *
/* called with lnet_res_lock held */
void
-lnet_ptl_attach_md(lnet_me_t *me, lnet_libmd_t *md,
+lnet_ptl_attach_md(struct lnet_me *me, lnet_libmd_t *md,
struct list_head *matches, struct list_head *drops)
{
struct lnet_portal *ptl = the_lnet.ln_portals[me->me_portal];
@@ -756,7 +756,7 @@ struct list_head *
LASSERT(list_empty(&ptl->ptl_msg_stealing));
cfs_percpt_for_each(mtable, i, ptl->ptl_mtables) {
struct list_head *mhash;
- lnet_me_t *me;
+ struct lnet_me *me;
int j;
if (!mtable->mt_mhash) /* uninitialized match-table */
@@ -767,7 +767,7 @@ struct list_head *
for (j = 0; j < LNET_MT_HASH_SIZE + 1; j++) {
while (!list_empty(&mhash[j])) {
me = list_entry(mhash[j].next,
- lnet_me_t, me_list);
+ struct lnet_me, me_list);
CERROR("Active ME %p on exit\n", me);
list_del(&me->me_list);
lnet_me_free(me);
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 11/34] staging: lustre: lnet: change lnet_test_peer_t to proper structure |
| Message-ID | <tfhPx-6aG-7@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_test_peer_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/lib-types.h | 4 ++--
drivers/staging/lustre/lnet/lnet/lib-move.c | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 6dd7edd..59d7143 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -164,12 +164,12 @@ struct lnet_libmd {
#define LNET_MD_FLAG_AUTO_UNLINK (1 << 1)
#define LNET_MD_FLAG_ABORTED (1 << 2)
-typedef struct {
+struct lnet_test_peer {
/* info about peers we are trying to fail */
struct list_head tp_list; /* ln_test_peers */
lnet_nid_t tp_nid; /* matching nid */
unsigned int tp_threshold; /* # failures to simulate */
-} lnet_test_peer_t;
+};
#define LNET_COOKIE_TYPE_MD 1
#define LNET_COOKIE_TYPE_ME 2
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index a55b58e..f919732 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -47,8 +47,8 @@
int
lnet_fail_nid(lnet_nid_t nid, unsigned int threshold)
{
- lnet_test_peer_t *tp;
- lnet_test_peer_t *temp;
+ struct lnet_test_peer *tp;
+ struct lnet_test_peer *temp;
struct list_head *el;
struct list_head *next;
struct list_head cull;
@@ -75,7 +75,7 @@
lnet_net_lock(0);
list_for_each_safe(el, next, &the_lnet.ln_test_peers) {
- tp = list_entry(el, lnet_test_peer_t, tp_list);
+ tp = list_entry(el, struct lnet_test_peer, tp_list);
if (!tp->tp_threshold || /* needs culling anyway */
nid == LNET_NID_ANY || /* removing all entries */
@@ -97,8 +97,8 @@
static int
fail_peer(lnet_nid_t nid, int outgoing)
{
- lnet_test_peer_t *tp;
- lnet_test_peer_t *temp;
+ struct lnet_test_peer *tp;
+ struct lnet_test_peer *temp;
struct list_head *el;
struct list_head *next;
struct list_head cull;
@@ -110,7 +110,7 @@
lnet_net_lock(0);
list_for_each_safe(el, next, &the_lnet.ln_test_peers) {
- tp = list_entry(el, lnet_test_peer_t, tp_list);
+ tp = list_entry(el, struct lnet_test_peer, tp_list);
if (!tp->tp_threshold) {
/* zombie entry */
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 06/34] staging: lustre: lnet: change lnet_msg_t to proper structure |
| Message-ID | <tfhPw-6aG-5@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_msg_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
.../staging/lustre/include/linux/lnet/lib-lnet.h | 43 +++++++------
.../staging/lustre/include/linux/lnet/lib-types.h | 11 ++--
.../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 8 +--
.../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 10 +--
.../staging/lustre/lnet/klnds/socklnd/socklnd.h | 6 +-
.../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 8 +--
drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +-
drivers/staging/lustre/lnet/lnet/lib-move.c | 75 +++++++++++-----------
drivers/staging/lustre/lnet/lnet/lib-msg.c | 25 ++++----
drivers/staging/lustre/lnet/lnet/lib-ptl.c | 4 +-
drivers/staging/lustre/lnet/lnet/lo.c | 6 +-
11 files changed, 102 insertions(+), 96 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index bd8d117..e894990 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -248,10 +248,10 @@ static inline int lnet_md_unlinkable(lnet_libmd_t *md)
LIBCFS_FREE(me, sizeof(*me));
}
-static inline lnet_msg_t *
+static inline struct lnet_msg *
lnet_msg_alloc(void)
{
- lnet_msg_t *msg;
+ struct lnet_msg *msg;
LIBCFS_ALLOC(msg, sizeof(*msg));
@@ -260,7 +260,7 @@ static inline int lnet_md_unlinkable(lnet_libmd_t *md)
}
static inline void
-lnet_msg_free(lnet_msg_t *msg)
+lnet_msg_free(struct lnet_msg *msg)
{
LASSERT(!msg->msg_onactivelist);
LIBCFS_FREE(msg, sizeof(*msg));
@@ -482,20 +482,20 @@ int lnet_dyn_add_ni(lnet_pid_t requested_pid,
int lnet_islocalnid(lnet_nid_t nid);
int lnet_islocalnet(__u32 net);
-void lnet_msg_attach_md(lnet_msg_t *msg, lnet_libmd_t *md,
+void lnet_msg_attach_md(struct lnet_msg *msg, lnet_libmd_t *md,
unsigned int offset, unsigned int mlen);
-void lnet_msg_detach_md(lnet_msg_t *msg, int status);
+void lnet_msg_detach_md(struct lnet_msg *msg, int status);
void lnet_build_unlink_event(lnet_libmd_t *md, lnet_event_t *ev);
-void lnet_build_msg_event(lnet_msg_t *msg, lnet_event_kind_t ev_type);
-void lnet_msg_commit(lnet_msg_t *msg, int cpt);
-void lnet_msg_decommit(lnet_msg_t *msg, int cpt, int status);
+void lnet_build_msg_event(struct lnet_msg *msg, lnet_event_kind_t ev_type);
+void lnet_msg_commit(struct lnet_msg *msg, int cpt);
+void lnet_msg_decommit(struct lnet_msg *msg, int cpt, int status);
void lnet_eq_enqueue_event(lnet_eq_t *eq, lnet_event_t *ev);
-void lnet_prep_send(lnet_msg_t *msg, int type, lnet_process_id_t target,
+void lnet_prep_send(struct lnet_msg *msg, int type, lnet_process_id_t target,
unsigned int offset, unsigned int len);
-int lnet_send(lnet_nid_t nid, lnet_msg_t *msg, lnet_nid_t rtr_nid);
-void lnet_return_tx_credits_locked(lnet_msg_t *msg);
-void lnet_return_rx_credits_locked(lnet_msg_t *msg);
+int lnet_send(lnet_nid_t nid, struct lnet_msg *msg, lnet_nid_t rtr_nid);
+void lnet_return_tx_credits_locked(struct lnet_msg *msg);
+void lnet_return_rx_credits_locked(struct lnet_msg *msg);
void lnet_schedule_blocked_locked(lnet_rtrbufpool_t *rbp);
void lnet_drop_routed_msgs_locked(struct list_head *list, int cpt);
@@ -554,19 +554,22 @@ void lnet_ptl_attach_md(lnet_me_t *me, lnet_libmd_t *md,
/* message functions */
int lnet_parse(lnet_ni_t *ni, struct lnet_hdr *hdr,
lnet_nid_t fromnid, void *private, int rdma_req);
-int lnet_parse_local(lnet_ni_t *ni, lnet_msg_t *msg);
-int lnet_parse_forward_locked(lnet_ni_t *ni, lnet_msg_t *msg);
+int lnet_parse_local(lnet_ni_t *ni, struct lnet_msg *msg);
+int lnet_parse_forward_locked(lnet_ni_t *ni, struct lnet_msg *msg);
-void lnet_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
- unsigned int offset, unsigned int mlen, unsigned int rlen);
-void lnet_ni_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg,
+void lnet_recv(lnet_ni_t *ni, void *private, struct lnet_msg *msg,
+ int delayed, unsigned int offset, unsigned int mlen,
+ unsigned int rlen);
+void lnet_ni_recv(lnet_ni_t *ni, void *private, struct lnet_msg *msg,
int delayed, unsigned int offset,
unsigned int mlen, unsigned int rlen);
-lnet_msg_t *lnet_create_reply_msg(lnet_ni_t *ni, lnet_msg_t *get_msg);
-void lnet_set_reply_msg_len(lnet_ni_t *ni, lnet_msg_t *msg, unsigned int len);
+struct lnet_msg *lnet_create_reply_msg(lnet_ni_t *ni,
+ struct lnet_msg *get_msg);
+void lnet_set_reply_msg_len(lnet_ni_t *ni, struct lnet_msg *msg,
+ unsigned int len);
-void lnet_finalize(lnet_ni_t *ni, lnet_msg_t *msg, int rc);
+void lnet_finalize(lnet_ni_t *ni, struct lnet_msg *msg, int rc);
void lnet_drop_message(lnet_ni_t *ni, int cpt, void *private,
unsigned int nob);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 7ce0091..e3cb795 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -54,7 +54,7 @@
/* forward refs */
struct lnet_libmd;
-typedef struct lnet_msg {
+struct lnet_msg {
struct list_head msg_activelist;
struct list_head msg_list; /* Q for credits/MD */
@@ -106,7 +106,7 @@
lnet_event_t msg_ev;
struct lnet_hdr msg_hdr;
-} lnet_msg_t;
+};
typedef struct lnet_libhandle {
struct list_head lh_hash_chain;
@@ -210,7 +210,8 @@
* non-zero for immediate failure, otherwise complete later with
* lnet_finalize()
*/
- int (*lnd_send)(struct lnet_ni *ni, void *private, lnet_msg_t *msg);
+ int (*lnd_send)(struct lnet_ni *ni, void *private,
+ struct lnet_msg *msg);
/*
* Start receiving 'mlen' bytes of payload data, skipping the following
@@ -219,7 +220,7 @@
* complete later with lnet_finalize(). This also gives back a receive
* credit if the LND does flow control.
*/
- int (*lnd_recv)(struct lnet_ni *ni, void *private, lnet_msg_t *msg,
+ int (*lnd_recv)(struct lnet_ni *ni, void *private, struct lnet_msg *msg,
int delayed, struct iov_iter *to, unsigned int rlen);
/*
@@ -231,7 +232,7 @@
* release resources; lnd_recv() will not be called.
*/
int (*lnd_eager_recv)(struct lnet_ni *ni, void *private,
- lnet_msg_t *msg, void **new_privatep);
+ struct lnet_msg *msg, void **new_privatep);
/* notification of peer health */
void (*lnd_notify)(struct lnet_ni *ni, lnet_nid_t peer, int alive);
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
index 366372d..dbd3b8e 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
@@ -490,7 +490,7 @@ struct kib_tx { /* transmit message */
int tx_status; /* LNET completion status */
unsigned long tx_deadline; /* completion deadline */
__u64 tx_cookie; /* completion cookie */
- lnet_msg_t *tx_lntmsg[2]; /* lnet msgs to finalize on completion */
+ struct lnet_msg *tx_lntmsg[2]; /* lnet msgs to finalize on completion */
struct kib_msg *tx_msg; /* message buffer (host vaddr) */
__u64 tx_msgaddr; /* message buffer (I/O addr) */
DECLARE_PCI_UNMAP_ADDR(tx_msgunmap); /* for dma_unmap_single() */
@@ -1032,6 +1032,6 @@ void kiblnd_pack_msg(lnet_ni_t *ni, struct kib_msg *msg, int version,
int kiblnd_unpack_msg(struct kib_msg *msg, int nob);
int kiblnd_post_rx(struct kib_rx *rx, int credit);
-int kiblnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg);
-int kiblnd_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed,
- struct iov_iter *to, unsigned int rlen);
+int kiblnd_send(lnet_ni_t *ni, void *private, struct lnet_msg *lntmsg);
+int kiblnd_recv(lnet_ni_t *ni, void *private, struct lnet_msg *lntmsg,
+ int delayed, struct iov_iter *to, unsigned int rlen);
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 6eaa548..021e6ac 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -53,7 +53,7 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
static void
kiblnd_tx_done(lnet_ni_t *ni, struct kib_tx *tx)
{
- lnet_msg_t *lntmsg[2];
+ struct lnet_msg *lntmsg[2];
struct kib_net *net = ni->ni_data;
int rc;
int i;
@@ -1475,7 +1475,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
}
int
-kiblnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
+kiblnd_send(lnet_ni_t *ni, void *private, struct lnet_msg *lntmsg)
{
struct lnet_hdr *hdr = &lntmsg->msg_hdr;
int type = lntmsg->msg_type;
@@ -1648,7 +1648,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
}
static void
-kiblnd_reply(lnet_ni_t *ni, struct kib_rx *rx, lnet_msg_t *lntmsg)
+kiblnd_reply(lnet_ni_t *ni, struct kib_rx *rx, struct lnet_msg *lntmsg)
{
lnet_process_id_t target = lntmsg->msg_target;
unsigned int niov = lntmsg->msg_niov;
@@ -1709,8 +1709,8 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
}
int
-kiblnd_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed,
- struct iov_iter *to, unsigned int rlen)
+kiblnd_recv(lnet_ni_t *ni, void *private, struct lnet_msg *lntmsg,
+ int delayed, struct iov_iter *to, unsigned int rlen)
{
struct kib_rx *rx = private;
struct kib_msg *rxmsg = rx->rx_msg;
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
index 3631998..d03a029 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
@@ -284,7 +284,7 @@ struct ksock_tx { /* transmit packet */
unsigned short tx_nonblk:1; /* it's a non-blocking ACK */
lnet_kiov_t *tx_kiov; /* packet page frags */
struct ksock_conn *tx_conn; /* owning conn */
- lnet_msg_t *tx_lnetmsg; /* lnet message for lnet_finalize()
+ struct lnet_msg *tx_lnetmsg; /* lnet message for lnet_finalize()
*/
unsigned long tx_deadline; /* when (in jiffies) tx times out */
struct ksock_msg tx_msg; /* socklnd message buffer */
@@ -650,8 +650,8 @@ static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len)
int ksocknal_startup(lnet_ni_t *ni);
void ksocknal_shutdown(lnet_ni_t *ni);
int ksocknal_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg);
-int ksocknal_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg);
-int ksocknal_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg,
+int ksocknal_send(lnet_ni_t *ni, void *private, struct lnet_msg *lntmsg);
+int ksocknal_recv(lnet_ni_t *ni, void *private, struct lnet_msg *lntmsg,
int delayed, struct iov_iter *to, unsigned int rlen);
int ksocknal_accept(lnet_ni_t *ni, struct socket *sock);
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 9fbae62..66827f2 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -395,7 +395,7 @@ struct ksock_tx *
void
ksocknal_tx_done(lnet_ni_t *ni, struct ksock_tx *tx)
{
- lnet_msg_t *lnetmsg = tx->tx_lnetmsg;
+ struct lnet_msg *lnetmsg = tx->tx_lnetmsg;
int rc = (!tx->tx_resid && !tx->tx_zc_aborted) ? 0 : -EIO;
LASSERT(ni || tx->tx_conn);
@@ -938,7 +938,7 @@ struct ksock_route *
}
int
-ksocknal_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
+ksocknal_send(lnet_ni_t *ni, void *private, struct lnet_msg *lntmsg)
{
int mpflag = 1;
int type = lntmsg->msg_type;
@@ -1333,8 +1333,8 @@ struct ksock_route *
}
int
-ksocknal_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
- struct iov_iter *to, unsigned int rlen)
+ksocknal_recv(lnet_ni_t *ni, void *private, struct lnet_msg *msg,
+ int delayed, struct iov_iter *to, unsigned int rlen)
{
struct ksock_conn *conn = private;
struct ksock_sched *sched = conn->ksnc_scheduler;
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index efafd42..5161b8a 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1173,7 +1173,7 @@ static void lnet_assert_wire_constants(void)
/*
* Clear lazy portals and drop delayed messages which hold refs
- * on their lnet_msg_t::msg_rxpeer
+ * on their lnet_msg::msg_rxpeer
*/
for (i = 0; i < the_lnet.ln_nportals; i++)
LNetClearLazyPortal(i);
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 88d87eb..a789d7e 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -364,8 +364,9 @@
EXPORT_SYMBOL(lnet_extract_kiov);
void
-lnet_ni_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
- unsigned int offset, unsigned int mlen, unsigned int rlen)
+lnet_ni_recv(lnet_ni_t *ni, void *private, struct lnet_msg *msg,
+ int delayed, unsigned int offset, unsigned int mlen,
+ unsigned int rlen)
{
unsigned int niov = 0;
struct kvec *iov = NULL;
@@ -409,7 +410,7 @@
}
static void
-lnet_setpayloadbuffer(lnet_msg_t *msg)
+lnet_setpayloadbuffer(struct lnet_msg *msg)
{
lnet_libmd_t *md = msg->msg_md;
@@ -428,7 +429,7 @@
}
void
-lnet_prep_send(lnet_msg_t *msg, int type, lnet_process_id_t target,
+lnet_prep_send(struct lnet_msg *msg, int type, lnet_process_id_t target,
unsigned int offset, unsigned int len)
{
msg->msg_type = type;
@@ -449,7 +450,7 @@
}
static void
-lnet_ni_send(lnet_ni_t *ni, lnet_msg_t *msg)
+lnet_ni_send(lnet_ni_t *ni, struct lnet_msg *msg)
{
void *priv = msg->msg_private;
int rc;
@@ -464,7 +465,7 @@
}
static int
-lnet_ni_eager_recv(lnet_ni_t *ni, lnet_msg_t *msg)
+lnet_ni_eager_recv(lnet_ni_t *ni, struct lnet_msg *msg)
{
int rc;
@@ -595,7 +596,7 @@
* \retval -ECANCELED If the MD of the message has been unlinked.
*/
static int
-lnet_post_send_locked(lnet_msg_t *msg, int do_send)
+lnet_post_send_locked(struct lnet_msg *msg, int do_send)
{
lnet_peer_t *lp = msg->msg_txpeer;
lnet_ni_t *ni = lp->lp_ni;
@@ -680,7 +681,7 @@
}
static lnet_rtrbufpool_t *
-lnet_msg2bufpool(lnet_msg_t *msg)
+lnet_msg2bufpool(struct lnet_msg *msg)
{
lnet_rtrbufpool_t *rbp;
int cpt;
@@ -700,7 +701,7 @@
}
static int
-lnet_post_routed_recv_locked(lnet_msg_t *msg, int do_recv)
+lnet_post_routed_recv_locked(struct lnet_msg *msg, int do_recv)
{
/*
* lnet_parse is going to lnet_net_unlock immediately after this, so it
@@ -776,10 +777,10 @@
}
void
-lnet_return_tx_credits_locked(lnet_msg_t *msg)
+lnet_return_tx_credits_locked(struct lnet_msg *msg)
{
lnet_peer_t *txpeer = msg->msg_txpeer;
- lnet_msg_t *msg2;
+ struct lnet_msg *msg2;
if (msg->msg_txcredit) {
struct lnet_ni *ni = txpeer->lp_ni;
@@ -794,7 +795,7 @@
tq->tq_credits++;
if (tq->tq_credits <= 0) {
msg2 = list_entry(tq->tq_delayed.next,
- lnet_msg_t, msg_list);
+ struct lnet_msg, msg_list);
list_del(&msg2->msg_list);
LASSERT(msg2->msg_txpeer->lp_ni == ni);
@@ -817,7 +818,7 @@
txpeer->lp_txcredits++;
if (txpeer->lp_txcredits <= 0) {
msg2 = list_entry(txpeer->lp_txq.next,
- lnet_msg_t, msg_list);
+ struct lnet_msg, msg_list);
list_del(&msg2->msg_list);
LASSERT(msg2->msg_txpeer == txpeer);
@@ -836,12 +837,12 @@
void
lnet_schedule_blocked_locked(lnet_rtrbufpool_t *rbp)
{
- lnet_msg_t *msg;
+ struct lnet_msg *msg;
if (list_empty(&rbp->rbp_msgs))
return;
msg = list_entry(rbp->rbp_msgs.next,
- lnet_msg_t, msg_list);
+ struct lnet_msg, msg_list);
list_del(&msg->msg_list);
(void)lnet_post_routed_recv_locked(msg, 1);
@@ -851,8 +852,8 @@
lnet_drop_routed_msgs_locked(struct list_head *list, int cpt)
{
struct list_head drop;
- lnet_msg_t *msg;
- lnet_msg_t *tmp;
+ struct lnet_msg *msg;
+ struct lnet_msg *tmp;
INIT_LIST_HEAD(&drop);
@@ -871,10 +872,10 @@
}
void
-lnet_return_rx_credits_locked(lnet_msg_t *msg)
+lnet_return_rx_credits_locked(struct lnet_msg *msg)
{
lnet_peer_t *rxpeer = msg->msg_rxpeer;
- lnet_msg_t *msg2;
+ struct lnet_msg *msg2;
if (msg->msg_rtrcredit) {
/* give back global router credits */
@@ -943,7 +944,7 @@
msg->msg_rx_cpt);
} else if (rxpeer->lp_rtrcredits <= 0) {
msg2 = list_entry(rxpeer->lp_rtrq.next,
- lnet_msg_t, msg_list);
+ struct lnet_msg, msg_list);
list_del(&msg2->msg_list);
(void)lnet_post_routed_recv_locked(msg2, 1);
@@ -1057,7 +1058,7 @@
}
int
-lnet_send(lnet_nid_t src_nid, lnet_msg_t *msg, lnet_nid_t rtr_nid)
+lnet_send(lnet_nid_t src_nid, struct lnet_msg *msg, lnet_nid_t rtr_nid)
{
lnet_nid_t dst_nid = msg->msg_target.nid;
struct lnet_ni *src_ni;
@@ -1243,7 +1244,7 @@
}
static void
-lnet_recv_put(lnet_ni_t *ni, lnet_msg_t *msg)
+lnet_recv_put(lnet_ni_t *ni, struct lnet_msg *msg)
{
struct lnet_hdr *hdr = &msg->msg_hdr;
@@ -1264,7 +1265,7 @@
}
static int
-lnet_parse_put(lnet_ni_t *ni, lnet_msg_t *msg)
+lnet_parse_put(lnet_ni_t *ni, struct lnet_msg *msg)
{
struct lnet_hdr *hdr = &msg->msg_hdr;
struct lnet_match_info info;
@@ -1322,7 +1323,7 @@
}
static int
-lnet_parse_get(lnet_ni_t *ni, lnet_msg_t *msg, int rdma_get)
+lnet_parse_get(lnet_ni_t *ni, struct lnet_msg *msg, int rdma_get)
{
struct lnet_match_info info;
struct lnet_hdr *hdr = &msg->msg_hdr;
@@ -1386,7 +1387,7 @@
}
static int
-lnet_parse_reply(lnet_ni_t *ni, lnet_msg_t *msg)
+lnet_parse_reply(lnet_ni_t *ni, struct lnet_msg *msg)
{
void *private = msg->msg_private;
struct lnet_hdr *hdr = &msg->msg_hdr;
@@ -1451,7 +1452,7 @@
}
static int
-lnet_parse_ack(lnet_ni_t *ni, lnet_msg_t *msg)
+lnet_parse_ack(lnet_ni_t *ni, struct lnet_msg *msg)
{
struct lnet_hdr *hdr = &msg->msg_hdr;
lnet_process_id_t src = {0};
@@ -1506,7 +1507,7 @@
* \retval -ve error code
*/
int
-lnet_parse_forward_locked(lnet_ni_t *ni, lnet_msg_t *msg)
+lnet_parse_forward_locked(lnet_ni_t *ni, struct lnet_msg *msg)
{
int rc = 0;
@@ -1530,7 +1531,7 @@
}
int
-lnet_parse_local(lnet_ni_t *ni, lnet_msg_t *msg)
+lnet_parse_local(lnet_ni_t *ni, struct lnet_msg *msg)
{
int rc;
@@ -1874,9 +1875,9 @@
{
while (!list_empty(head)) {
lnet_process_id_t id = {0};
- lnet_msg_t *msg;
+ struct lnet_msg *msg;
- msg = list_entry(head->next, lnet_msg_t, msg_list);
+ msg = list_entry(head->next, struct lnet_msg, msg_list);
list_del(&msg->msg_list);
id.nid = msg->msg_hdr.src_nid;
@@ -1915,10 +1916,10 @@
lnet_recv_delayed_msg_list(struct list_head *head)
{
while (!list_empty(head)) {
- lnet_msg_t *msg;
+ struct lnet_msg *msg;
lnet_process_id_t id;
- msg = list_entry(head->next, lnet_msg_t, msg_list);
+ msg = list_entry(head->next, struct lnet_msg, msg_list);
list_del(&msg->msg_list);
/*
@@ -2009,7 +2010,7 @@
msg = lnet_msg_alloc();
if (!msg) {
- CERROR("Dropping PUT to %s: ENOMEM on lnet_msg_t\n",
+ CERROR("Dropping PUT to %s: ENOMEM on struct lnet_msg\n",
libcfs_id2str(target));
return -ENOMEM;
}
@@ -2072,8 +2073,8 @@
}
EXPORT_SYMBOL(LNetPut);
-lnet_msg_t *
-lnet_create_reply_msg(lnet_ni_t *ni, lnet_msg_t *getmsg)
+struct lnet_msg *
+lnet_create_reply_msg(lnet_ni_t *ni, struct lnet_msg *getmsg)
{
/*
* The LND can DMA direct to the GET md (i.e. no REPLY msg). This
@@ -2151,7 +2152,7 @@
EXPORT_SYMBOL(lnet_create_reply_msg);
void
-lnet_set_reply_msg_len(lnet_ni_t *ni, lnet_msg_t *reply, unsigned int len)
+lnet_set_reply_msg_len(lnet_ni_t *ni, struct lnet_msg *reply, unsigned int len)
{
/*
* Set the REPLY length, now the RDMA that elides the REPLY message has
@@ -2213,7 +2214,7 @@
msg = lnet_msg_alloc();
if (!msg) {
- CERROR("Dropping GET to %s: ENOMEM on lnet_msg_t\n",
+ CERROR("Dropping GET to %s: ENOMEM on struct lnet_msg\n",
libcfs_id2str(target));
return -ENOMEM;
}
diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c
index 7ee164e..d35d28b 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-msg.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c
@@ -54,7 +54,7 @@
* Don't need any lock, must be called after lnet_commit_md
*/
void
-lnet_build_msg_event(lnet_msg_t *msg, lnet_event_kind_t ev_type)
+lnet_build_msg_event(struct lnet_msg *msg, lnet_event_kind_t ev_type)
{
struct lnet_hdr *hdr = &msg->msg_hdr;
lnet_event_t *ev = &msg->msg_ev;
@@ -129,7 +129,7 @@
}
void
-lnet_msg_commit(lnet_msg_t *msg, int cpt)
+lnet_msg_commit(struct lnet_msg *msg, int cpt)
{
struct lnet_msg_container *container = the_lnet.ln_msg_containers[cpt];
lnet_counters_t *counters = the_lnet.ln_counters[cpt];
@@ -162,7 +162,7 @@
}
static void
-lnet_msg_decommit_tx(lnet_msg_t *msg, int status)
+lnet_msg_decommit_tx(struct lnet_msg *msg, int status)
{
lnet_counters_t *counters;
lnet_event_t *ev = &msg->msg_ev;
@@ -214,7 +214,7 @@
}
static void
-lnet_msg_decommit_rx(lnet_msg_t *msg, int status)
+lnet_msg_decommit_rx(struct lnet_msg *msg, int status)
{
lnet_counters_t *counters;
lnet_event_t *ev = &msg->msg_ev;
@@ -272,7 +272,7 @@
}
void
-lnet_msg_decommit(lnet_msg_t *msg, int cpt, int status)
+lnet_msg_decommit(struct lnet_msg *msg, int cpt, int status)
{
int cpt2 = cpt;
@@ -306,7 +306,7 @@
}
void
-lnet_msg_attach_md(lnet_msg_t *msg, lnet_libmd_t *md,
+lnet_msg_attach_md(struct lnet_msg *msg, lnet_libmd_t *md,
unsigned int offset, unsigned int mlen)
{
/* NB: @offset and @len are only useful for receiving */
@@ -336,7 +336,7 @@
}
void
-lnet_msg_detach_md(lnet_msg_t *msg, int status)
+lnet_msg_detach_md(struct lnet_msg *msg, int status)
{
lnet_libmd_t *md = msg->msg_md;
int unlink;
@@ -359,7 +359,7 @@
}
static int
-lnet_complete_msg_locked(lnet_msg_t *msg, int cpt)
+lnet_complete_msg_locked(struct lnet_msg *msg, int cpt)
{
struct lnet_handle_wire ack_wmd;
int rc;
@@ -437,7 +437,7 @@
}
void
-lnet_finalize(lnet_ni_t *ni, lnet_msg_t *msg, int status)
+lnet_finalize(lnet_ni_t *ni, struct lnet_msg *msg, int status)
{
struct lnet_msg_container *container;
int my_slot;
@@ -502,7 +502,7 @@
while (!list_empty(&container->msc_finalizing)) {
msg = list_entry(container->msc_finalizing.next,
- lnet_msg_t, msg_list);
+ struct lnet_msg, msg_list);
list_del(&msg->msg_list);
@@ -538,9 +538,10 @@
return;
while (!list_empty(&container->msc_active)) {
- lnet_msg_t *msg = list_entry(container->msc_active.next,
- lnet_msg_t, msg_activelist);
+ struct lnet_msg *msg;
+ msg = list_entry(container->msc_active.next,
+ struct lnet_msg, msg_activelist);
LASSERT(msg->msg_onactivelist);
msg->msg_onactivelist = 0;
list_del(&msg->msg_activelist);
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index fa515af..891d028 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -657,8 +657,8 @@ struct list_head *
struct lnet_portal *ptl = the_lnet.ln_portals[me->me_portal];
struct lnet_match_table *mtable;
struct list_head *head;
- lnet_msg_t *tmp;
- lnet_msg_t *msg;
+ struct lnet_msg *tmp;
+ struct lnet_msg *msg;
int exhausted = 0;
int cpt;
diff --git a/drivers/staging/lustre/lnet/lnet/lo.c b/drivers/staging/lustre/lnet/lnet/lo.c
index cb213b8..12b6b3a 100644
--- a/drivers/staging/lustre/lnet/lnet/lo.c
+++ b/drivers/staging/lustre/lnet/lnet/lo.c
@@ -32,7 +32,7 @@
#include "../../include/linux/lnet/lib-lnet.h"
static int
-lolnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
+lolnd_send(lnet_ni_t *ni, void *private, struct lnet_msg *lntmsg)
{
LASSERT(!lntmsg->msg_routing);
LASSERT(!lntmsg->msg_target_is_router);
@@ -41,10 +41,10 @@
}
static int
-lolnd_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg,
+lolnd_recv(lnet_ni_t *ni, void *private, struct lnet_msg *lntmsg,
int delayed, struct iov_iter *to, unsigned int rlen)
{
- lnet_msg_t *sendmsg = private;
+ struct lnet_msg *sendmsg = private;
if (lntmsg) { /* not discarding */
if (sendmsg->msg_iov)
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 16/34] staging: lustre: lnet: change lnet_route_t to proper structure |
| Message-ID | <tfhPx-6aG-11@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_route_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
.../staging/lustre/include/linux/lnet/lib-lnet.h | 2 +-
.../staging/lustre/include/linux/lnet/lib-types.h | 6 ++---
drivers/staging/lustre/lnet/lnet/lib-move.c | 12 +++++-----
drivers/staging/lustre/lnet/lnet/router.c | 26 ++++++++++++----------
drivers/staging/lustre/lnet/lnet/router_proc.c | 11 ++++-----
5 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index bcfbed1..93e6830 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -65,7 +65,7 @@
/** exclusive lock */
#define LNET_LOCK_EX CFS_PERCPT_LOCK_EX
-static inline int lnet_is_route_alive(lnet_route_t *route)
+static inline int lnet_is_route_alive(struct lnet_route *route)
{
/* gateway is down */
if (!route->lr_gateway->lp_alive)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 2cfc1bf..a0d9cad 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -340,7 +340,7 @@ struct lnet_peer {
lnet_nid_t lp_nid; /* peer's NID */
int lp_refcount; /* # refs */
int lp_cpt; /* CPT this peer attached on */
- /* # refs from lnet_route_t::lr_gateway */
+ /* # refs from lnet_route::lr_gateway */
int lp_rtr_refcount;
/* returned RC ping features */
unsigned int lp_ping_feats;
@@ -369,7 +369,7 @@ struct lnet_peer_table {
#define lnet_peer_aliveness_enabled(lp) (the_lnet.ln_routing && \
(lp)->lp_ni->ni_peertimeout > 0)
-typedef struct {
+struct lnet_route {
struct list_head lr_list; /* chain on net */
struct list_head lr_gwlist; /* chain on gateway */
struct lnet_peer *lr_gateway; /* router node */
@@ -378,7 +378,7 @@ struct lnet_peer_table {
unsigned int lr_downis; /* number of down NIs */
__u32 lr_hops; /* how far I am */
unsigned int lr_priority; /* route priority */
-} lnet_route_t;
+};
#define LNET_REMOTE_NETS_HASH_DEFAULT (1U << 7)
#define LNET_REMOTE_NETS_HASH_MAX (1U << 16)
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 9615dcd..9d1ab1f 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -957,7 +957,7 @@
}
static int
-lnet_compare_routes(lnet_route_t *r1, lnet_route_t *r2)
+lnet_compare_routes(struct lnet_route *r1, struct lnet_route *r2)
{
struct lnet_peer *p1 = r1->lr_gateway;
struct lnet_peer *p2 = r2->lr_gateway;
@@ -999,9 +999,9 @@
lnet_nid_t rtr_nid)
{
lnet_remotenet_t *rnet;
- lnet_route_t *route;
- lnet_route_t *best_route;
- lnet_route_t *last_route;
+ struct lnet_route *route;
+ struct lnet_route *best_route;
+ struct lnet_route *last_route;
struct lnet_peer *lp_best;
struct lnet_peer *lp;
int rc;
@@ -2351,8 +2351,8 @@ struct lnet_msg *
rnet = list_entry(e, lnet_remotenet_t, lrn_list);
if (rnet->lrn_net == dstnet) {
- lnet_route_t *route;
- lnet_route_t *shortest = NULL;
+ struct lnet_route *route;
+ struct lnet_route *shortest = NULL;
__u32 shortest_hops = LNET_UNDEFINED_HOPS;
__u32 route_hops;
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c
index eda829a..8e5af05 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -268,7 +268,7 @@ static void lnet_shuffle_seed(void)
/* NB expects LNET_LOCK held */
static void
-lnet_add_route_to_rnet(lnet_remotenet_t *rnet, lnet_route_t *route)
+lnet_add_route_to_rnet(lnet_remotenet_t *rnet, struct lnet_route *route)
{
unsigned int len = 0;
unsigned int offset = 0;
@@ -301,7 +301,7 @@ static void lnet_shuffle_seed(void)
struct list_head *e;
lnet_remotenet_t *rnet;
lnet_remotenet_t *rnet2;
- lnet_route_t *route;
+ struct lnet_route *route;
struct lnet_ni *ni;
int add_route;
int rc;
@@ -368,8 +368,9 @@ static void lnet_shuffle_seed(void)
/* Search for a duplicate route (it's a NOOP if it is) */
add_route = 1;
list_for_each(e, &rnet2->lrn_routes) {
- lnet_route_t *route2 = list_entry(e, lnet_route_t, lr_list);
+ struct lnet_route *route2;
+ route2 = list_entry(e, struct lnet_route, lr_list);
if (route2->lr_gateway == route->lr_gateway) {
add_route = 0;
break;
@@ -416,8 +417,8 @@ static void lnet_shuffle_seed(void)
lnet_check_routes(void)
{
lnet_remotenet_t *rnet;
- lnet_route_t *route;
- lnet_route_t *route2;
+ struct lnet_route *route;
+ struct lnet_route *route2;
struct list_head *e1;
struct list_head *e2;
int cpt;
@@ -437,7 +438,7 @@ static void lnet_shuffle_seed(void)
lnet_nid_t nid2;
int net;
- route = list_entry(e2, lnet_route_t, lr_list);
+ route = list_entry(e2, struct lnet_route, lr_list);
if (!route2) {
route2 = route;
@@ -472,7 +473,7 @@ static void lnet_shuffle_seed(void)
{
struct lnet_peer *gateway;
lnet_remotenet_t *rnet;
- lnet_route_t *route;
+ struct lnet_route *route;
struct list_head *e1;
struct list_head *e2;
int rc = -ENOENT;
@@ -501,7 +502,7 @@ static void lnet_shuffle_seed(void)
continue;
list_for_each(e2, &rnet->lrn_routes) {
- route = list_entry(e2, lnet_route_t, lr_list);
+ route = list_entry(e2, struct lnet_route, lr_list);
gateway = route->lr_gateway;
if (!(gw_nid == LNET_NID_ANY ||
@@ -588,7 +589,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
struct list_head *e1;
struct list_head *e2;
lnet_remotenet_t *rnet;
- lnet_route_t *route;
+ struct lnet_route *route;
int cpt;
int i;
struct list_head *rn_list;
@@ -601,7 +602,8 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
rnet = list_entry(e1, lnet_remotenet_t, lrn_list);
list_for_each(e2, &rnet->lrn_routes) {
- route = list_entry(e2, lnet_route_t, lr_list);
+ route = list_entry(e2, struct lnet_route,
+ lr_list);
if (!idx--) {
*net = rnet->lrn_net;
@@ -646,7 +648,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
{
struct lnet_ping_info *info = rcd->rcd_pinginfo;
struct lnet_peer *gw = rcd->rcd_gateway;
- lnet_route_t *rte;
+ struct lnet_route *rte;
if (!gw->lp_alive)
return;
@@ -823,7 +825,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
void
lnet_router_ni_update_locked(struct lnet_peer *gw, __u32 net)
{
- lnet_route_t *rte;
+ struct lnet_route *rte;
if ((gw->lp_ping_feats & LNET_PING_FEAT_NI_STATUS)) {
list_for_each_entry(rte, &gw->lp_routes, lr_gwlist) {
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c
index e672148..1b2817c 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -171,7 +171,7 @@ static int proc_lnet_routes(struct ctl_table *table, int write,
} else {
struct list_head *n;
struct list_head *r;
- lnet_route_t *route = NULL;
+ struct lnet_route *route = NULL;
lnet_remotenet_t *rnet = NULL;
int skip = off - 1;
struct list_head *rn_list;
@@ -197,9 +197,10 @@ static int proc_lnet_routes(struct ctl_table *table, int write,
r = rnet->lrn_routes.next;
while (r != &rnet->lrn_routes) {
- lnet_route_t *re =
- list_entry(r, lnet_route_t,
- lr_list);
+ struct lnet_route *re;
+
+ re = list_entry(r, struct lnet_route,
+ lr_list);
if (!skip) {
route = re;
break;
@@ -331,7 +332,7 @@ static int proc_lnet_routers(struct ctl_table *table, int write,
int last_ping = cfs_duration_sec(cfs_time_sub(now,
peer->lp_ping_timestamp));
int down_ni = 0;
- lnet_route_t *rtr;
+ struct lnet_route *rtr;
if ((peer->lp_ping_feats &
LNET_PING_FEAT_NI_STATUS)) {
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 07/34] staging: lustre: lnet: change lnet_libhandle_t to proper structure |
| Message-ID | <tfhPx-6aG-9@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_libhandle_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 16 ++++++++--------
drivers/staging/lustre/include/linux/lnet/lib-types.h | 10 +++++-----
drivers/staging/lustre/lnet/lnet/api-ni.c | 7 ++++---
3 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index e894990..1c147b3 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -266,12 +266,12 @@ static inline int lnet_md_unlinkable(lnet_libmd_t *md)
LIBCFS_FREE(msg, sizeof(*msg));
}
-lnet_libhandle_t *lnet_res_lh_lookup(struct lnet_res_container *rec,
- __u64 cookie);
+struct lnet_libhandle *lnet_res_lh_lookup(struct lnet_res_container *rec,
+ __u64 cookie);
void lnet_res_lh_initialize(struct lnet_res_container *rec,
- lnet_libhandle_t *lh);
+ struct lnet_libhandle *lh);
static inline void
-lnet_res_lh_invalidate(lnet_libhandle_t *lh)
+lnet_res_lh_invalidate(struct lnet_libhandle *lh)
{
/* NB: cookie is still useful, don't reset it */
list_del(&lh->lh_hash_chain);
@@ -291,7 +291,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
static inline lnet_eq_t *
lnet_handle2eq(struct lnet_handle_eq *handle)
{
- lnet_libhandle_t *lh;
+ struct lnet_libhandle *lh;
lh = lnet_res_lh_lookup(&the_lnet.ln_eq_container, handle->cookie);
if (!lh)
@@ -310,7 +310,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
lnet_handle2md(struct lnet_handle_md *handle)
{
/* ALWAYS called with resource lock held */
- lnet_libhandle_t *lh;
+ struct lnet_libhandle *lh;
int cpt;
cpt = lnet_cpt_of_cookie(handle->cookie);
@@ -326,7 +326,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
lnet_wire_handle2md(struct lnet_handle_wire *wh)
{
/* ALWAYS called with resource lock held */
- lnet_libhandle_t *lh;
+ struct lnet_libhandle *lh;
int cpt;
if (wh->wh_interface_cookie != the_lnet.ln_interface_cookie)
@@ -351,7 +351,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
lnet_handle2me(struct lnet_handle_me *handle)
{
/* ALWAYS called with resource lock held */
- lnet_libhandle_t *lh;
+ struct lnet_libhandle *lh;
int cpt;
cpt = lnet_cpt_of_cookie(handle->cookie);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index e3cb795..9f301f4 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -108,17 +108,17 @@ struct lnet_msg {
struct lnet_hdr msg_hdr;
};
-typedef struct lnet_libhandle {
+struct lnet_libhandle {
struct list_head lh_hash_chain;
__u64 lh_cookie;
-} lnet_libhandle_t;
+};
#define lh_entry(ptr, type, member) \
((type *)((char *)(ptr) - (char *)(&((type *)0)->member)))
typedef struct lnet_eq {
struct list_head eq_list;
- lnet_libhandle_t eq_lh;
+ struct lnet_libhandle eq_lh;
lnet_seq_t eq_enq_seq;
lnet_seq_t eq_deq_seq;
unsigned int eq_size;
@@ -129,7 +129,7 @@ struct lnet_msg {
typedef struct lnet_me {
struct list_head me_list;
- lnet_libhandle_t me_lh;
+ struct lnet_libhandle me_lh;
lnet_process_id_t me_match_id;
unsigned int me_portal;
unsigned int me_pos; /* hash offset in mt_hash */
@@ -141,7 +141,7 @@ struct lnet_msg {
typedef struct lnet_libmd {
struct list_head md_list;
- lnet_libhandle_t md_lh;
+ struct lnet_libhandle md_lh;
lnet_me_t *md_me;
char *md_start;
unsigned int md_offset;
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 5161b8a..4c9a064 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -483,12 +483,12 @@ static void lnet_assert_wire_constants(void)
return recs;
}
-lnet_libhandle_t *
+struct lnet_libhandle *
lnet_res_lh_lookup(struct lnet_res_container *rec, __u64 cookie)
{
/* ALWAYS called with lnet_res_lock held */
struct list_head *head;
- lnet_libhandle_t *lh;
+ struct lnet_libhandle *lh;
unsigned int hash;
if ((cookie & LNET_COOKIE_MASK) != rec->rec_type)
@@ -506,7 +506,8 @@ static void lnet_assert_wire_constants(void)
}
void
-lnet_res_lh_initialize(struct lnet_res_container *rec, lnet_libhandle_t *lh)
+lnet_res_lh_initialize(struct lnet_res_container *rec,
+ struct lnet_libhandle *lh)
{
/* ALWAYS called with lnet_res_lock held */
unsigned int ibits = LNET_COOKIE_TYPE_BITS + LNET_CPT_BITS;
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 10/34] staging: lustre: lnet: change lnet_libmd_t to proper structure |
| Message-ID | <tfhPx-6aG-13@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_libmd_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
.../staging/lustre/include/linux/lnet/lib-lnet.h | 40 +++++++++++-----------
.../staging/lustre/include/linux/lnet/lib-types.h | 4 +--
drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +-
drivers/staging/lustre/lnet/lnet/lib-md.c | 12 +++----
drivers/staging/lustre/lnet/lnet/lib-me.c | 4 +--
drivers/staging/lustre/lnet/lnet/lib-move.c | 6 ++--
drivers/staging/lustre/lnet/lnet/lib-msg.c | 6 ++--
drivers/staging/lustre/lnet/lnet/lib-ptl.c | 6 ++--
8 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index a82bb3c..685c5d4 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -84,14 +84,14 @@ static inline int lnet_is_wire_handle_none(struct lnet_handle_wire *wh)
wh->wh_object_cookie == LNET_WIRE_HANDLE_COOKIE_NONE);
}
-static inline int lnet_md_exhausted(lnet_libmd_t *md)
+static inline int lnet_md_exhausted(struct lnet_libmd *md)
{
return (!md->md_threshold ||
((md->md_options & LNET_MD_MAX_SIZE) &&
md->md_offset + md->md_max_size > md->md_length));
}
-static inline int lnet_md_unlinkable(lnet_libmd_t *md)
+static inline int lnet_md_unlinkable(struct lnet_libmd *md)
{
/*
* Should unlink md when its refcount is 0 and either:
@@ -193,19 +193,19 @@ static inline int lnet_md_unlinkable(lnet_libmd_t *md)
LIBCFS_FREE(eq, sizeof(*eq));
}
-static inline lnet_libmd_t *
+static inline struct lnet_libmd *
lnet_md_alloc(lnet_md_t *umd)
{
- lnet_libmd_t *md;
+ struct lnet_libmd *md;
unsigned int size;
unsigned int niov;
if (umd->options & LNET_MD_KIOV) {
niov = umd->length;
- size = offsetof(lnet_libmd_t, md_iov.kiov[niov]);
+ size = offsetof(struct lnet_libmd, md_iov.kiov[niov]);
} else {
niov = umd->options & LNET_MD_IOVEC ? umd->length : 1;
- size = offsetof(lnet_libmd_t, md_iov.iov[niov]);
+ size = offsetof(struct lnet_libmd, md_iov.iov[niov]);
}
LIBCFS_ALLOC(md, size);
@@ -221,14 +221,14 @@ static inline int lnet_md_unlinkable(lnet_libmd_t *md)
}
static inline void
-lnet_md_free(lnet_libmd_t *md)
+lnet_md_free(struct lnet_libmd *md)
{
unsigned int size;
if (md->md_options & LNET_MD_KIOV)
- size = offsetof(lnet_libmd_t, md_iov.kiov[md->md_niov]);
+ size = offsetof(struct lnet_libmd, md_iov.kiov[md->md_niov]);
else
- size = offsetof(lnet_libmd_t, md_iov.iov[md->md_niov]);
+ size = offsetof(struct lnet_libmd, md_iov.iov[md->md_niov]);
LIBCFS_FREE(md, size);
}
@@ -301,12 +301,12 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
}
static inline void
-lnet_md2handle(struct lnet_handle_md *handle, lnet_libmd_t *md)
+lnet_md2handle(struct lnet_handle_md *handle, struct lnet_libmd *md)
{
handle->cookie = md->md_lh.lh_cookie;
}
-static inline lnet_libmd_t *
+static inline struct lnet_libmd *
lnet_handle2md(struct lnet_handle_md *handle)
{
/* ALWAYS called with resource lock held */
@@ -319,10 +319,10 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
if (!lh)
return NULL;
- return lh_entry(lh, lnet_libmd_t, md_lh);
+ return lh_entry(lh, struct lnet_libmd, md_lh);
}
-static inline lnet_libmd_t *
+static inline struct lnet_libmd *
lnet_wire_handle2md(struct lnet_handle_wire *wh)
{
/* ALWAYS called with resource lock held */
@@ -338,7 +338,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
if (!lh)
return NULL;
- return lh_entry(lh, lnet_libmd_t, md_lh);
+ return lh_entry(lh, struct lnet_libmd, md_lh);
}
static inline void
@@ -482,10 +482,10 @@ int lnet_dyn_add_ni(lnet_pid_t requested_pid,
int lnet_islocalnid(lnet_nid_t nid);
int lnet_islocalnet(__u32 net);
-void lnet_msg_attach_md(struct lnet_msg *msg, lnet_libmd_t *md,
+void lnet_msg_attach_md(struct lnet_msg *msg, struct lnet_libmd *md,
unsigned int offset, unsigned int mlen);
void lnet_msg_detach_md(struct lnet_msg *msg, int status);
-void lnet_build_unlink_event(lnet_libmd_t *md, lnet_event_t *ev);
+void lnet_build_unlink_event(struct lnet_libmd *md, lnet_event_t *ev);
void lnet_build_msg_event(struct lnet_msg *msg, lnet_event_kind_t ev_type);
void lnet_msg_commit(struct lnet_msg *msg, int cpt);
void lnet_msg_decommit(struct lnet_msg *msg, int cpt, int status);
@@ -542,9 +542,9 @@ int lnet_mt_match_md(struct lnet_match_table *mtable,
struct lnet_match_info *info, struct lnet_msg *msg);
/* portals match/attach functions */
-void lnet_ptl_attach_md(struct lnet_me *me, lnet_libmd_t *md,
+void lnet_ptl_attach_md(struct lnet_me *me, struct lnet_libmd *md,
struct list_head *matches, struct list_head *drops);
-void lnet_ptl_detach_md(struct lnet_me *me, lnet_libmd_t *md);
+void lnet_ptl_detach_md(struct lnet_me *me, struct lnet_libmd *md);
int lnet_ptl_match_md(struct lnet_match_info *info, struct lnet_msg *msg);
/* initialized and finalize portals */
@@ -625,8 +625,8 @@ void lnet_copy_kiov2iter(struct iov_iter *to,
void lnet_me_unlink(struct lnet_me *me);
-void lnet_md_unlink(lnet_libmd_t *md);
-void lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd);
+void lnet_md_unlink(struct lnet_libmd *md);
+void lnet_md_deconstruct(struct lnet_libmd *lmd, lnet_md_t *umd);
void lnet_register_lnd(lnd_t *lnd);
void lnet_unregister_lnd(lnd_t *lnd);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 3384860..6dd7edd 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -139,7 +139,7 @@ struct lnet_me {
struct lnet_libmd *me_md;
};
-typedef struct lnet_libmd {
+struct lnet_libmd {
struct list_head md_list;
struct lnet_libhandle md_lh;
struct lnet_me *md_me;
@@ -158,7 +158,7 @@ struct lnet_me {
struct kvec iov[LNET_MAX_IOV];
lnet_kiov_t kiov[LNET_MAX_IOV];
} md_iov;
-} lnet_libmd_t;
+};
#define LNET_MD_FLAG_ZOMBIE (1 << 0)
#define LNET_MD_FLAG_AUTO_UNLINK (1 << 1)
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index ee47ba9..aeb9e6f 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -386,7 +386,7 @@ static void lnet_assert_wire_constants(void)
lnet_eq_free(list_entry(e, struct lnet_eq, eq_list));
} else if (rec->rec_type == LNET_COOKIE_TYPE_MD) {
- lnet_md_free(list_entry(e, lnet_libmd_t, md_list));
+ lnet_md_free(list_entry(e, struct lnet_libmd, md_list));
} else { /* NB: Active MEs should be attached on portals */
LBUG();
diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c
index dd3cdda..bb832c5 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -40,7 +40,7 @@
/* must be called with lnet_res_lock held */
void
-lnet_md_unlink(lnet_libmd_t *md)
+lnet_md_unlink(struct lnet_libmd *md)
{
if (!(md->md_flags & LNET_MD_FLAG_ZOMBIE)) {
/* first unlink attempt... */
@@ -84,7 +84,7 @@
}
static int
-lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
+lnet_md_build(struct lnet_libmd *lmd, lnet_md_t *umd, int unlink)
{
int i;
unsigned int niov;
@@ -165,7 +165,7 @@
/* must be called with resource lock held */
static int
-lnet_md_link(lnet_libmd_t *md, struct lnet_handle_eq eq_handle, int cpt)
+lnet_md_link(struct lnet_libmd *md, struct lnet_handle_eq eq_handle, int cpt)
{
struct lnet_res_container *container = the_lnet.ln_md_containers[cpt];
@@ -204,7 +204,7 @@
/* must be called with lnet_res_lock held */
void
-lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd)
+lnet_md_deconstruct(struct lnet_libmd *lmd, lnet_md_t *umd)
{
/* NB this doesn't copy out all the iov entries so when a
* discontiguous MD is copied out, the target gets to know the
@@ -353,7 +353,7 @@
LNetMDBind(lnet_md_t umd, lnet_unlink_t unlink,
struct lnet_handle_md *handle)
{
- lnet_libmd_t *md;
+ struct lnet_libmd *md;
int cpt;
int rc;
@@ -429,7 +429,7 @@
LNetMDUnlink(struct lnet_handle_md mdh)
{
lnet_event_t ev;
- lnet_libmd_t *md;
+ struct lnet_libmd *md;
int cpt;
LASSERT(the_lnet.ln_refcount > 0);
diff --git a/drivers/staging/lustre/lnet/lnet/lib-me.c b/drivers/staging/lustre/lnet/lnet/lib-me.c
index 20cc8f8..75922a5 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-me.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-me.c
@@ -223,7 +223,7 @@
LNetMEUnlink(struct lnet_handle_me meh)
{
struct lnet_me *me;
- lnet_libmd_t *md;
+ struct lnet_libmd *md;
lnet_event_t ev;
int cpt;
@@ -261,7 +261,7 @@
list_del(&me->me_list);
if (me->me_md) {
- lnet_libmd_t *md = me->me_md;
+ struct lnet_libmd *md = me->me_md;
/* detach MD from portal of this ME */
lnet_ptl_detach_md(me, md);
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index a789d7e..a55b58e 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -412,7 +412,7 @@
static void
lnet_setpayloadbuffer(struct lnet_msg *msg)
{
- lnet_libmd_t *md = msg->msg_md;
+ struct lnet_libmd *md = msg->msg_md;
LASSERT(msg->msg_len > 0);
LASSERT(!msg->msg_routing);
@@ -1392,7 +1392,7 @@
void *private = msg->msg_private;
struct lnet_hdr *hdr = &msg->msg_hdr;
lnet_process_id_t src = {0};
- lnet_libmd_t *md;
+ struct lnet_libmd *md;
int rlength;
int mlength;
int cpt;
@@ -1456,7 +1456,7 @@
{
struct lnet_hdr *hdr = &msg->msg_hdr;
lnet_process_id_t src = {0};
- lnet_libmd_t *md;
+ struct lnet_libmd *md;
int cpt;
src.nid = hdr->src_nid;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c
index d35d28b..bcb5e24 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-msg.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c
@@ -39,7 +39,7 @@
#include "../../include/linux/lnet/lib-lnet.h"
void
-lnet_build_unlink_event(lnet_libmd_t *md, lnet_event_t *ev)
+lnet_build_unlink_event(struct lnet_libmd *md, lnet_event_t *ev)
{
memset(ev, 0, sizeof(*ev));
@@ -306,7 +306,7 @@
}
void
-lnet_msg_attach_md(struct lnet_msg *msg, lnet_libmd_t *md,
+lnet_msg_attach_md(struct lnet_msg *msg, struct lnet_libmd *md,
unsigned int offset, unsigned int mlen)
{
/* NB: @offset and @len are only useful for receiving */
@@ -338,7 +338,7 @@
void
lnet_msg_detach_md(struct lnet_msg *msg, int status)
{
- lnet_libmd_t *md = msg->msg_md;
+ struct lnet_libmd *md = msg->msg_md;
int unlink;
/* Now it's safe to drop my caller's ref */
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index b538939..9ea3c08 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -131,7 +131,7 @@
}
static int
-lnet_try_match_md(lnet_libmd_t *md,
+lnet_try_match_md(struct lnet_libmd *md,
struct lnet_match_info *info, struct lnet_msg *msg)
{
/*
@@ -641,7 +641,7 @@ struct list_head *
}
void
-lnet_ptl_detach_md(struct lnet_me *me, lnet_libmd_t *md)
+lnet_ptl_detach_md(struct lnet_me *me, struct lnet_libmd *md)
{
LASSERT(me->me_md == md && md->md_me == me);
@@ -651,7 +651,7 @@ struct list_head *
/* called with lnet_res_lock held */
void
-lnet_ptl_attach_md(struct lnet_me *me, lnet_libmd_t *md,
+lnet_ptl_attach_md(struct lnet_me *me, struct lnet_libmd *md,
struct list_head *matches, struct list_head *drops)
{
struct lnet_portal *ptl = the_lnet.ln_portals[me->me_portal];
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 05/34] staging: lustre: lnet: remove generic lnet_handle_any_t |
| Message-ID | <tfhPx-6aG-15@gated-at.bofh.it> |
| In reply to | #1588431 |
With the creation of unique handlers we can remove the
barely used generic handlers.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/api.h | 1 -
drivers/staging/lustre/include/linux/lnet/types.h | 41 ++---------------------
drivers/staging/lustre/lnet/lnet/api-ni.c | 11 ------
3 files changed, 3 insertions(+), 50 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/api.h b/drivers/staging/lustre/include/linux/lnet/api.h
index af756e8..2585dbb 100644
--- a/drivers/staging/lustre/include/linux/lnet/api.h
+++ b/drivers/staging/lustre/include/linux/lnet/api.h
@@ -76,7 +76,6 @@
*/
int LNetGetId(unsigned int index, lnet_process_id_t *id);
int LNetDist(lnet_nid_t nid, lnet_nid_t *srcnid, __u32 *order);
-void LNetSnprintHandle(char *str, int str_len, lnet_handle_any_t handle);
/** @} lnet_addr */
diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/linux/lnet/types.h
index 513ad6f..e81b079 100644
--- a/drivers/staging/lustre/include/linux/lnet/types.h
+++ b/drivers/staging/lustre/include/linux/lnet/types.h
@@ -272,48 +272,13 @@ struct lnet_ping_info {
/**
* Objects maintained by the LNet are accessed through handles. Handle types
- * have names of the form lnet_handle_xx_t, where xx is one of the two letter
+ * have names of the form lnet_handle_xx, where xx is one of the two letter
* object type codes ('eq' for event queue, 'md' for memory descriptor, and
- * 'me' for match entry).
- * Each type of object is given a unique handle type to enhance type checking.
- * The type lnet_handle_any_t can be used when a generic handle is needed.
- * Every handle value can be converted into a value of type lnet_handle_any_t
- * without loss of information.
+ * 'me' for match entry). Each type of object is given a unique handle type
+ * to enhance type checking.
*/
-typedef struct {
- __u64 cookie;
-} lnet_handle_any_t;
-
#define LNET_WIRE_HANDLE_COOKIE_NONE (-1)
-/**
- * Invalidate handle \a h.
- */
-static inline void LNetInvalidateHandle(lnet_handle_any_t *h)
-{
- h->cookie = LNET_WIRE_HANDLE_COOKIE_NONE;
-}
-
-/**
- * Compare handles \a h1 and \a h2.
- *
- * \return 1 if handles are equal, 0 if otherwise.
- */
-static inline int LNetHandleIsEqual(lnet_handle_any_t h1, lnet_handle_any_t h2)
-{
- return h1.cookie == h2.cookie;
-}
-
-/**
- * Check whether handle \a h is invalid.
- *
- * \return 1 if handle is invalid, 0 if valid.
- */
-static inline int LNetHandleIsInvalid(lnet_handle_any_t h)
-{
- return h.cookie == LNET_WIRE_HANDLE_COOKIE_NONE;
-}
-
struct lnet_handle_eq {
u64 cookie;
};
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index a650fe0..efafd42 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -2127,17 +2127,6 @@ void LNetDebugPeer(lnet_process_id_t id)
}
EXPORT_SYMBOL(LNetGetId);
-/**
- * Print a string representation of handle \a h into buffer \a str of
- * \a len bytes.
- */
-void
-LNetSnprintHandle(char *str, int len, lnet_handle_any_t h)
-{
- snprintf(str, len, "%#llx", h.cookie);
-}
-EXPORT_SYMBOL(LNetSnprintHandle);
-
static int lnet_ping(lnet_process_id_t id, int timeout_ms,
lnet_process_id_t __user *ids, int n_ids)
{
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 17/34] staging: lustre: lnet: change lnet_remotenet_t to proper structure |
| Message-ID | <tfhPx-6aG-17@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_remotenet_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
.../staging/lustre/include/linux/lnet/lib-lnet.h | 2 +-
.../staging/lustre/include/linux/lnet/lib-types.h | 4 ++--
drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +-
drivers/staging/lustre/lnet/lnet/lib-move.c | 6 +++---
drivers/staging/lustre/lnet/lnet/router.c | 24 +++++++++++-----------
drivers/staging/lustre/lnet/lnet/router_proc.c | 4 ++--
6 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 93e6830..8483a4a 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -473,7 +473,7 @@ int lnet_get_route(int idx, __u32 *net, __u32 *hops,
int lnet_rtrpools_enable(void);
void lnet_rtrpools_disable(void);
void lnet_rtrpools_free(int keep_pools);
-lnet_remotenet_t *lnet_find_net_locked(__u32 net);
+struct lnet_remotenet *lnet_find_net_locked(__u32 net);
int lnet_dyn_add_ni(lnet_pid_t requested_pid,
struct lnet_ioctl_config_data *conf);
int lnet_dyn_del_ni(__u32 net);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index a0d9cad..04ad728 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -384,12 +384,12 @@ struct lnet_route {
#define LNET_REMOTE_NETS_HASH_MAX (1U << 16)
#define LNET_REMOTE_NETS_HASH_SIZE (1 << the_lnet.ln_remote_nets_hbits)
-typedef struct {
+struct lnet_remotenet {
struct list_head lrn_list; /* chain on
ln_remote_nets_hash */
struct list_head lrn_routes; /* routes to me */
__u32 lrn_net; /* my net number */
-} lnet_remotenet_t;
+};
/** lnet message has credit and can be submitted to lnd for send/receive */
#define LNET_CREDIT_OK 0
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 88279ed..c03e701 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1762,7 +1762,7 @@ void lnet_lib_exit(void)
struct lnet_handle_md md_handle;
struct lnet_ni *ni;
struct list_head net_head;
- lnet_remotenet_t *rnet;
+ struct lnet_remotenet *rnet;
int rc;
INIT_LIST_HEAD(&net_head);
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 9d1ab1f..3581100 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -998,7 +998,7 @@
lnet_find_route_locked(struct lnet_ni *ni, lnet_nid_t target,
lnet_nid_t rtr_nid)
{
- lnet_remotenet_t *rnet;
+ struct lnet_remotenet *rnet;
struct lnet_route *route;
struct lnet_route *best_route;
struct lnet_route *last_route;
@@ -2291,7 +2291,7 @@ struct lnet_msg *
{
struct list_head *e;
struct lnet_ni *ni;
- lnet_remotenet_t *rnet;
+ struct lnet_remotenet *rnet;
__u32 dstnet = LNET_NIDNET(dstnid);
int hops;
int cpt;
@@ -2348,7 +2348,7 @@ struct lnet_msg *
rn_list = lnet_net2rnethash(dstnet);
list_for_each(e, rn_list) {
- rnet = list_entry(e, lnet_remotenet_t, lrn_list);
+ rnet = list_entry(e, struct lnet_remotenet, lrn_list);
if (rnet->lrn_net == dstnet) {
struct lnet_route *route;
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c
index 8e5af05..9a5faba 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -217,10 +217,10 @@
}
}
-lnet_remotenet_t *
+struct lnet_remotenet *
lnet_find_net_locked(__u32 net)
{
- lnet_remotenet_t *rnet;
+ struct lnet_remotenet *rnet;
struct list_head *tmp;
struct list_head *rn_list;
@@ -228,7 +228,7 @@
rn_list = lnet_net2rnethash(net);
list_for_each(tmp, rn_list) {
- rnet = list_entry(tmp, lnet_remotenet_t, lrn_list);
+ rnet = list_entry(tmp, struct lnet_remotenet, lrn_list);
if (rnet->lrn_net == net)
return rnet;
@@ -268,7 +268,7 @@ static void lnet_shuffle_seed(void)
/* NB expects LNET_LOCK held */
static void
-lnet_add_route_to_rnet(lnet_remotenet_t *rnet, struct lnet_route *route)
+lnet_add_route_to_rnet(struct lnet_remotenet *rnet, struct lnet_route *route)
{
unsigned int len = 0;
unsigned int offset = 0;
@@ -299,8 +299,8 @@ static void lnet_shuffle_seed(void)
unsigned int priority)
{
struct list_head *e;
- lnet_remotenet_t *rnet;
- lnet_remotenet_t *rnet2;
+ struct lnet_remotenet *rnet;
+ struct lnet_remotenet *rnet2;
struct lnet_route *route;
struct lnet_ni *ni;
int add_route;
@@ -416,7 +416,7 @@ static void lnet_shuffle_seed(void)
int
lnet_check_routes(void)
{
- lnet_remotenet_t *rnet;
+ struct lnet_remotenet *rnet;
struct lnet_route *route;
struct lnet_route *route2;
struct list_head *e1;
@@ -430,7 +430,7 @@ static void lnet_shuffle_seed(void)
for (i = 0; i < LNET_REMOTE_NETS_HASH_SIZE; i++) {
rn_list = &the_lnet.ln_remote_nets_hash[i];
list_for_each(e1, rn_list) {
- rnet = list_entry(e1, lnet_remotenet_t, lrn_list);
+ rnet = list_entry(e1, struct lnet_remotenet, lrn_list);
route2 = NULL;
list_for_each(e2, &rnet->lrn_routes) {
@@ -472,7 +472,7 @@ static void lnet_shuffle_seed(void)
lnet_del_route(__u32 net, lnet_nid_t gw_nid)
{
struct lnet_peer *gateway;
- lnet_remotenet_t *rnet;
+ struct lnet_remotenet *rnet;
struct lnet_route *route;
struct list_head *e1;
struct list_head *e2;
@@ -495,7 +495,7 @@ static void lnet_shuffle_seed(void)
again:
list_for_each(e1, rn_list) {
- rnet = list_entry(e1, lnet_remotenet_t, lrn_list);
+ rnet = list_entry(e1, struct lnet_remotenet, lrn_list);
if (!(net == LNET_NIDNET(LNET_NID_ANY) ||
net == rnet->lrn_net))
@@ -588,7 +588,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
{
struct list_head *e1;
struct list_head *e2;
- lnet_remotenet_t *rnet;
+ struct lnet_remotenet *rnet;
struct lnet_route *route;
int cpt;
int i;
@@ -599,7 +599,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
for (i = 0; i < LNET_REMOTE_NETS_HASH_SIZE; i++) {
rn_list = &the_lnet.ln_remote_nets_hash[i];
list_for_each(e1, rn_list) {
- rnet = list_entry(e1, lnet_remotenet_t, lrn_list);
+ rnet = list_entry(e1, struct lnet_remotenet, lrn_list);
list_for_each(e2, &rnet->lrn_routes) {
route = list_entry(e2, struct lnet_route,
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c
index 1b2817c..779ec69 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -172,7 +172,7 @@ static int proc_lnet_routes(struct ctl_table *table, int write,
struct list_head *n;
struct list_head *r;
struct lnet_route *route = NULL;
- lnet_remotenet_t *rnet = NULL;
+ struct lnet_remotenet *rnet = NULL;
int skip = off - 1;
struct list_head *rn_list;
int i;
@@ -191,7 +191,7 @@ static int proc_lnet_routes(struct ctl_table *table, int write,
n = rn_list->next;
while (n != rn_list && !route) {
- rnet = list_entry(n, lnet_remotenet_t,
+ rnet = list_entry(n, struct lnet_remotenet,
lrn_list);
r = rnet->lrn_routes.next;
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 15/34] staging: lustre: lnet: change lnet_peer_t to proper structure |
| Message-ID | <tfhPx-6aG-23@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_peer_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
.../staging/lustre/include/linux/lnet/lib-lnet.h | 20 +++++++--------
.../staging/lustre/include/linux/lnet/lib-types.h | 6 ++---
drivers/staging/lustre/lnet/lnet/lib-move.c | 20 +++++++--------
drivers/staging/lustre/lnet/lnet/peer.c | 30 +++++++++++-----------
drivers/staging/lustre/lnet/lnet/router.c | 30 +++++++++++-----------
drivers/staging/lustre/lnet/lnet/router_proc.c | 10 +++++---
6 files changed, 59 insertions(+), 57 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 3d5913d..bcfbed1 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -364,16 +364,16 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
}
static inline void
-lnet_peer_addref_locked(lnet_peer_t *lp)
+lnet_peer_addref_locked(struct lnet_peer *lp)
{
LASSERT(lp->lp_refcount > 0);
lp->lp_refcount++;
}
-void lnet_destroy_peer_locked(lnet_peer_t *lp);
+void lnet_destroy_peer_locked(struct lnet_peer *lp);
static inline void
-lnet_peer_decref_locked(lnet_peer_t *lp)
+lnet_peer_decref_locked(struct lnet_peer *lp)
{
LASSERT(lp->lp_refcount > 0);
lp->lp_refcount--;
@@ -382,7 +382,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
}
static inline int
-lnet_isrouter(lnet_peer_t *lp)
+lnet_isrouter(struct lnet_peer *lp)
{
return lp->lp_rtr_refcount ? 1 : 0;
}
@@ -454,7 +454,7 @@ struct lnet_ni *
void lnet_lib_exit(void);
int lnet_notify(struct lnet_ni *ni, lnet_nid_t peer, int alive, unsigned long when);
-void lnet_notify_locked(lnet_peer_t *lp, int notifylnd, int alive,
+void lnet_notify_locked(struct lnet_peer *lp, int notifylnd, int alive,
unsigned long when);
int lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway_nid,
unsigned int priority);
@@ -666,7 +666,7 @@ int lnet_sock_connect(struct socket **sockp, int *fatal,
int lnet_router_checker_start(void);
void lnet_router_checker_stop(void);
-void lnet_router_ni_update_locked(lnet_peer_t *gw, __u32 net);
+void lnet_router_ni_update_locked(struct lnet_peer *gw, __u32 net);
void lnet_swap_pinginfo(struct lnet_ping_info *info);
int lnet_parse_ip2nets(char **networksp, char *ip2nets);
@@ -674,9 +674,9 @@ int lnet_sock_connect(struct socket **sockp, int *fatal,
int lnet_parse_networks(struct list_head *nilist, char *networks);
int lnet_net_unique(__u32 net, struct list_head *nilist);
-int lnet_nid2peer_locked(lnet_peer_t **lpp, lnet_nid_t nid, int cpt);
-lnet_peer_t *lnet_find_peer_locked(struct lnet_peer_table *ptable,
- lnet_nid_t nid);
+int lnet_nid2peer_locked(struct lnet_peer **lpp, lnet_nid_t nid, int cpt);
+struct lnet_peer *lnet_find_peer_locked(struct lnet_peer_table *ptable,
+ lnet_nid_t nid);
void lnet_peer_tables_cleanup(struct lnet_ni *ni);
void lnet_peer_tables_destroy(void);
int lnet_peer_tables_create(void);
@@ -689,7 +689,7 @@ int lnet_get_peer_info(__u32 peer_index, __u64 *nid,
__u32 *peer_tx_qnob);
static inline void
-lnet_peer_set_alive(lnet_peer_t *lp)
+lnet_peer_set_alive(struct lnet_peer *lp)
{
lp->lp_last_query = jiffies;
lp->lp_last_alive = jiffies;
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 10bf60f..2cfc1bf 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -305,7 +305,7 @@ struct lnet_rc_data {
struct lnet_ping_info *rcd_pinginfo; /* ping buffer */
};
-typedef struct lnet_peer {
+struct lnet_peer {
struct list_head lp_hashlist; /* chain on peer hash */
struct list_head lp_txq; /* messages blocking for
tx credits */
@@ -346,7 +346,7 @@ struct lnet_rc_data {
unsigned int lp_ping_feats;
struct list_head lp_routes; /* routers on this peer */
struct lnet_rc_data *lp_rcd; /* router checker state */
-} lnet_peer_t;
+};
/* peer hash size */
#define LNET_PEER_HASH_BITS 9
@@ -372,7 +372,7 @@ struct lnet_peer_table {
typedef struct {
struct list_head lr_list; /* chain on net */
struct list_head lr_gwlist; /* chain on gateway */
- lnet_peer_t *lr_gateway; /* router node */
+ struct lnet_peer *lr_gateway; /* router node */
__u32 lr_net; /* remote network number */
int lr_seq; /* sequence for round-robin */
unsigned int lr_downis; /* number of down NIs */
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 3aabb32..9615dcd 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -489,7 +489,7 @@
/* NB: caller shall hold a ref on 'lp' as I'd drop lnet_net_lock */
static void
-lnet_ni_query_locked(struct lnet_ni *ni, lnet_peer_t *lp)
+lnet_ni_query_locked(struct lnet_ni *ni, struct lnet_peer *lp)
{
unsigned long last_alive = 0;
@@ -508,7 +508,7 @@
/* NB: always called with lnet_net_lock held */
static inline int
-lnet_peer_is_alive(lnet_peer_t *lp, unsigned long now)
+lnet_peer_is_alive(struct lnet_peer *lp, unsigned long now)
{
int alive;
unsigned long deadline;
@@ -542,7 +542,7 @@
* may drop the lnet_net_lock
*/
static int
-lnet_peer_alive_locked(lnet_peer_t *lp)
+lnet_peer_alive_locked(struct lnet_peer *lp)
{
unsigned long now = cfs_time_current();
@@ -598,7 +598,7 @@
static int
lnet_post_send_locked(struct lnet_msg *msg, int do_send)
{
- lnet_peer_t *lp = msg->msg_txpeer;
+ struct lnet_peer *lp = msg->msg_txpeer;
struct lnet_ni *ni = lp->lp_ni;
int cpt = msg->msg_tx_cpt;
struct lnet_tx_queue *tq = ni->ni_tx_queues[cpt];
@@ -709,7 +709,7 @@
* I return LNET_CREDIT_WAIT if msg blocked and LNET_CREDIT_OK if
* received or OK to receive
*/
- lnet_peer_t *lp = msg->msg_rxpeer;
+ struct lnet_peer *lp = msg->msg_rxpeer;
lnet_rtrbufpool_t *rbp;
lnet_rtrbuf_t *rb;
@@ -779,7 +779,7 @@
void
lnet_return_tx_credits_locked(struct lnet_msg *msg)
{
- lnet_peer_t *txpeer = msg->msg_txpeer;
+ struct lnet_peer *txpeer = msg->msg_txpeer;
struct lnet_msg *msg2;
if (msg->msg_txcredit) {
@@ -874,7 +874,7 @@
void
lnet_return_rx_credits_locked(struct lnet_msg *msg)
{
- lnet_peer_t *rxpeer = msg->msg_rxpeer;
+ struct lnet_peer *rxpeer = msg->msg_rxpeer;
struct lnet_msg *msg2;
if (msg->msg_rtrcredit) {
@@ -959,8 +959,8 @@
static int
lnet_compare_routes(lnet_route_t *r1, lnet_route_t *r2)
{
- lnet_peer_t *p1 = r1->lr_gateway;
- lnet_peer_t *p2 = r2->lr_gateway;
+ struct lnet_peer *p1 = r1->lr_gateway;
+ struct lnet_peer *p2 = r2->lr_gateway;
int r1_hops = (r1->lr_hops == LNET_UNDEFINED_HOPS) ? 1 : r1->lr_hops;
int r2_hops = (r2->lr_hops == LNET_UNDEFINED_HOPS) ? 1 : r2->lr_hops;
@@ -994,7 +994,7 @@
return -ERANGE;
}
-static lnet_peer_t *
+static struct lnet_peer *
lnet_find_route_locked(struct lnet_ni *ni, lnet_nid_t target,
lnet_nid_t rtr_nid)
{
diff --git a/drivers/staging/lustre/lnet/lnet/peer.c b/drivers/staging/lustre/lnet/lnet/peer.c
index 4b1a632..e62b21f 100644
--- a/drivers/staging/lustre/lnet/lnet/peer.c
+++ b/drivers/staging/lustre/lnet/lnet/peer.c
@@ -105,8 +105,8 @@
struct lnet_peer_table *ptable)
{
int i;
- lnet_peer_t *lp;
- lnet_peer_t *tmp;
+ struct lnet_peer *lp;
+ struct lnet_peer *tmp;
for (i = 0; i < LNET_PEER_HASH_SIZE; i++) {
list_for_each_entry_safe(lp, tmp, &ptable->pt_hash[i],
@@ -146,8 +146,8 @@
struct lnet_peer_table *ptable,
int cpt_locked)
{
- lnet_peer_t *lp;
- lnet_peer_t *tmp;
+ struct lnet_peer *lp;
+ struct lnet_peer *tmp;
lnet_nid_t lp_nid;
int i;
@@ -174,8 +174,8 @@
{
struct lnet_peer_table *ptable;
struct list_head deathrow;
- lnet_peer_t *lp;
- lnet_peer_t *temp;
+ struct lnet_peer *lp;
+ struct lnet_peer *temp;
int i;
INIT_LIST_HEAD(&deathrow);
@@ -216,7 +216,7 @@
}
void
-lnet_destroy_peer_locked(lnet_peer_t *lp)
+lnet_destroy_peer_locked(struct lnet_peer *lp)
{
struct lnet_peer_table *ptable;
@@ -238,11 +238,11 @@
ptable->pt_zombies--;
}
-lnet_peer_t *
+struct lnet_peer *
lnet_find_peer_locked(struct lnet_peer_table *ptable, lnet_nid_t nid)
{
struct list_head *peers;
- lnet_peer_t *lp;
+ struct lnet_peer *lp;
LASSERT(!the_lnet.ln_shutdown);
@@ -258,11 +258,11 @@
}
int
-lnet_nid2peer_locked(lnet_peer_t **lpp, lnet_nid_t nid, int cpt)
+lnet_nid2peer_locked(struct lnet_peer **lpp, lnet_nid_t nid, int cpt)
{
struct lnet_peer_table *ptable;
- lnet_peer_t *lp = NULL;
- lnet_peer_t *lp2;
+ struct lnet_peer *lp = NULL;
+ struct lnet_peer *lp2;
int cpt2;
int rc = 0;
@@ -282,7 +282,7 @@
if (!list_empty(&ptable->pt_deathrow)) {
lp = list_entry(ptable->pt_deathrow.next,
- lnet_peer_t, lp_hashlist);
+ struct lnet_peer, lp_hashlist);
list_del(&lp->lp_hashlist);
}
@@ -364,7 +364,7 @@
lnet_debug_peer(lnet_nid_t nid)
{
char *aliveness = "NA";
- lnet_peer_t *lp;
+ struct lnet_peer *lp;
int rc;
int cpt;
@@ -401,7 +401,7 @@
__u32 *peer_tx_qnob)
{
struct lnet_peer_table *peer_table;
- lnet_peer_t *lp;
+ struct lnet_peer *lp;
bool found = false;
int lncpt, j;
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c
index c73d7a0..eda829a 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -98,7 +98,7 @@
}
void
-lnet_notify_locked(lnet_peer_t *lp, int notifylnd, int alive,
+lnet_notify_locked(struct lnet_peer *lp, int notifylnd, int alive,
unsigned long when)
{
if (time_before(when, lp->lp_timestamp)) { /* out of date information */
@@ -128,7 +128,7 @@
}
static void
-lnet_ni_notify_locked(struct lnet_ni *ni, lnet_peer_t *lp)
+lnet_ni_notify_locked(struct lnet_ni *ni, struct lnet_peer *lp)
{
int alive;
int notifylnd;
@@ -167,7 +167,7 @@
}
static void
-lnet_rtr_addref_locked(lnet_peer_t *lp)
+lnet_rtr_addref_locked(struct lnet_peer *lp)
{
LASSERT(lp->lp_refcount > 0);
LASSERT(lp->lp_rtr_refcount >= 0);
@@ -179,9 +179,9 @@
/* a simple insertion sort */
list_for_each_prev(pos, &the_lnet.ln_routers) {
- lnet_peer_t *rtr = list_entry(pos, lnet_peer_t,
- lp_rtr_list);
+ struct lnet_peer *rtr;
+ rtr = list_entry(pos, struct lnet_peer, lp_rtr_list);
if (rtr->lp_nid < lp->lp_nid)
break;
}
@@ -194,7 +194,7 @@
}
static void
-lnet_rtr_decref_locked(lnet_peer_t *lp)
+lnet_rtr_decref_locked(struct lnet_peer *lp)
{
LASSERT(lp->lp_refcount > 0);
LASSERT(lp->lp_rtr_refcount > 0);
@@ -791,7 +791,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
static void
lnet_wait_known_routerstate(void)
{
- lnet_peer_t *rtr;
+ struct lnet_peer *rtr;
struct list_head *entry;
int all_known;
@@ -802,7 +802,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
all_known = 1;
list_for_each(entry, &the_lnet.ln_routers) {
- rtr = list_entry(entry, lnet_peer_t, lp_rtr_list);
+ rtr = list_entry(entry,struct lnet_peer, lp_rtr_list);
if (!rtr->lp_alive_count) {
all_known = 0;
@@ -821,7 +821,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
}
void
-lnet_router_ni_update_locked(lnet_peer_t *gw, __u32 net)
+lnet_router_ni_update_locked(struct lnet_peer *gw, __u32 net)
{
lnet_route_t *rte;
@@ -899,7 +899,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
}
static struct lnet_rc_data *
-lnet_create_rc_data_locked(lnet_peer_t *gateway)
+lnet_create_rc_data_locked(struct lnet_peer *gateway)
{
struct lnet_rc_data *rcd = NULL;
struct lnet_ping_info *pi;
@@ -969,7 +969,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
}
static int
-lnet_router_check_interval(lnet_peer_t *rtr)
+lnet_router_check_interval(struct lnet_peer *rtr)
{
int secs;
@@ -982,7 +982,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
}
static void
-lnet_ping_router_locked(lnet_peer_t *rtr)
+lnet_ping_router_locked(struct lnet_peer *rtr)
{
struct lnet_rc_data *rcd = NULL;
unsigned long now = cfs_time_current();
@@ -1126,7 +1126,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
{
struct lnet_rc_data *rcd;
struct lnet_rc_data *tmp;
- lnet_peer_t *lp;
+ struct lnet_peer *lp;
struct list_head head;
int i = 2;
@@ -1232,7 +1232,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
static int
lnet_router_checker(void *arg)
{
- lnet_peer_t *rtr;
+ struct lnet_peer *rtr;
struct list_head *entry;
cfs_block_allsigs();
@@ -1247,7 +1247,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
version = the_lnet.ln_routers_version;
list_for_each(entry, &the_lnet.ln_routers) {
- rtr = list_entry(entry, lnet_peer_t, lp_rtr_list);
+ rtr = list_entry(entry, struct lnet_peer, lp_rtr_list);
cpt2 = lnet_cpt_of_nid_locked(rtr->lp_nid);
if (cpt != cpt2) {
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c
index 672d71d..e672148 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -307,9 +307,9 @@ static int proc_lnet_routers(struct ctl_table *table, int write,
r = the_lnet.ln_routers.next;
while (r != &the_lnet.ln_routers) {
- lnet_peer_t *lp = list_entry(r, lnet_peer_t,
- lp_rtr_list);
+ struct lnet_peer *lp;
+ lp = list_entry(r, struct lnet_peer, lp_rtr_list);
if (!skip) {
peer = lp;
break;
@@ -454,8 +454,10 @@ static int proc_lnet_peers(struct ctl_table *table, int write,
p = ptable->pt_hash[hash].next;
while (p != &ptable->pt_hash[hash]) {
- lnet_peer_t *lp = list_entry(p, lnet_peer_t,
- lp_hashlist);
+ struct lnet_peer *lp;
+
+ lp = list_entry(p, struct lnet_peer,
+ lp_hashlist);
if (!skip) {
peer = lp;
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:00 +0100 |
| Subject | [PATCH 08/34] staging: lustre: lnet: change lnet_eq_t to proper structure |
| Message-ID | <tfhPx-6aG-25@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_eq_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 14 +++++++-------
drivers/staging/lustre/include/linux/lnet/lib-types.h | 6 +++---
drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +-
drivers/staging/lustre/lnet/lnet/lib-eq.c | 8 ++++----
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 1c147b3..9e33d0a 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -178,17 +178,17 @@ static inline int lnet_md_unlinkable(lnet_libmd_t *md)
#define MAX_PORTALS 64
-static inline lnet_eq_t *
+static inline struct lnet_eq *
lnet_eq_alloc(void)
{
- lnet_eq_t *eq;
+ struct lnet_eq *eq;
LIBCFS_ALLOC(eq, sizeof(*eq));
return eq;
}
static inline void
-lnet_eq_free(lnet_eq_t *eq)
+lnet_eq_free(struct lnet_eq *eq)
{
LIBCFS_FREE(eq, sizeof(*eq));
}
@@ -278,7 +278,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
}
static inline void
-lnet_eq2handle(struct lnet_handle_eq *handle, lnet_eq_t *eq)
+lnet_eq2handle(struct lnet_handle_eq *handle, struct lnet_eq *eq)
{
if (!eq) {
LNetInvalidateEQHandle(handle);
@@ -288,7 +288,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
handle->cookie = eq->eq_lh.lh_cookie;
}
-static inline lnet_eq_t *
+static inline struct lnet_eq *
lnet_handle2eq(struct lnet_handle_eq *handle)
{
struct lnet_libhandle *lh;
@@ -297,7 +297,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
if (!lh)
return NULL;
- return lh_entry(lh, lnet_eq_t, eq_lh);
+ return lh_entry(lh, struct lnet_eq, eq_lh);
}
static inline void
@@ -490,7 +490,7 @@ void lnet_msg_attach_md(struct lnet_msg *msg, lnet_libmd_t *md,
void lnet_msg_commit(struct lnet_msg *msg, int cpt);
void lnet_msg_decommit(struct lnet_msg *msg, int cpt, int status);
-void lnet_eq_enqueue_event(lnet_eq_t *eq, lnet_event_t *ev);
+void lnet_eq_enqueue_event(struct lnet_eq *eq, lnet_event_t *ev);
void lnet_prep_send(struct lnet_msg *msg, int type, lnet_process_id_t target,
unsigned int offset, unsigned int len);
int lnet_send(lnet_nid_t nid, struct lnet_msg *msg, lnet_nid_t rtr_nid);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 9f301f4..19e01cc 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -116,7 +116,7 @@ struct lnet_libhandle {
#define lh_entry(ptr, type, member) \
((type *)((char *)(ptr) - (char *)(&((type *)0)->member)))
-typedef struct lnet_eq {
+struct lnet_eq {
struct list_head eq_list;
struct lnet_libhandle eq_lh;
lnet_seq_t eq_enq_seq;
@@ -125,7 +125,7 @@ struct lnet_libhandle {
lnet_eq_handler_t eq_callback;
lnet_event_t *eq_events;
int **eq_refs; /* percpt refcount for EQ */
-} lnet_eq_t;
+};
typedef struct lnet_me {
struct list_head me_list;
@@ -152,7 +152,7 @@ struct lnet_libhandle {
unsigned int md_options;
unsigned int md_flags;
void *md_user_ptr;
- lnet_eq_t *md_eq;
+ struct lnet_eq *md_eq;
unsigned int md_niov; /* # frags */
union {
struct kvec iov[LNET_MAX_IOV];
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 4c9a064..ee47ba9 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -383,7 +383,7 @@ static void lnet_assert_wire_constants(void)
list_del_init(e);
if (rec->rec_type == LNET_COOKIE_TYPE_EQ) {
- lnet_eq_free(list_entry(e, lnet_eq_t, eq_list));
+ lnet_eq_free(list_entry(e, struct lnet_eq, eq_list));
} else if (rec->rec_type == LNET_COOKIE_TYPE_MD) {
lnet_md_free(list_entry(e, lnet_libmd_t, md_list));
diff --git a/drivers/staging/lustre/lnet/lnet/lib-eq.c b/drivers/staging/lustre/lnet/lnet/lib-eq.c
index 6645fdc..4369df3 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-eq.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-eq.c
@@ -66,7 +66,7 @@
LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback,
struct lnet_handle_eq *handle)
{
- lnet_eq_t *eq;
+ struct lnet_eq *eq;
LASSERT(the_lnet.ln_refcount > 0);
@@ -210,7 +210,7 @@
EXPORT_SYMBOL(LNetEQFree);
void
-lnet_eq_enqueue_event(lnet_eq_t *eq, lnet_event_t *ev)
+lnet_eq_enqueue_event(struct lnet_eq *eq, lnet_event_t *ev)
{
/* MUST called with resource lock hold but w/o lnet_eq_wait_lock */
int index;
@@ -239,7 +239,7 @@
}
static int
-lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev)
+lnet_eq_dequeue_event(struct lnet_eq *eq, lnet_event_t *ev)
{
int new_index = eq->eq_deq_seq & (eq->eq_size - 1);
lnet_event_t *new_event = &eq->eq_events[new_index];
@@ -386,7 +386,7 @@
for (;;) {
for (i = 0; i < neq; i++) {
- lnet_eq_t *eq = lnet_handle2eq(&eventqs[i]);
+ struct lnet_eq *eq = lnet_handle2eq(&eventqs[i]);
if (!eq) {
lnet_eq_wait_unlock();
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:10 +0100 |
| Subject | [PATCH 27/34] staging: lustre: lnet: change lnet_msg_type_t to proper enum |
| Message-ID | <tfhZ7-6sW-11@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_msg_type_t from typedef to proper enum.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/types.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/linux/lnet/types.h
index 74118d0..6a24189 100644
--- a/drivers/staging/lustre/include/linux/lnet/types.h
+++ b/drivers/staging/lustre/include/linux/lnet/types.h
@@ -132,13 +132,13 @@ struct lnet_handle_wire {
__u64 wh_object_cookie;
} WIRE_ATTR;
-typedef enum {
+enum lnet_msg_type {
LNET_MSG_ACK = 0,
LNET_MSG_PUT,
LNET_MSG_GET,
LNET_MSG_REPLY,
LNET_MSG_HELLO,
-} lnet_msg_type_t;
+};
/*
* The variant fields of the portals message header are aligned on an 8
@@ -182,7 +182,7 @@ struct lnet_hdr {
lnet_nid_t src_nid;
lnet_pid_t dest_pid;
lnet_pid_t src_pid;
- __u32 type; /* lnet_msg_type_t */
+ __u32 type; /* enum lnet_msg_type */
__u32 payload_length; /* payload data to follow */
/*<------__u64 aligned------->*/
union {
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:10 +0100 |
| Subject | [PATCH 23/34] staging: lustre: lnet: change lnet_counter_t to proper structure |
| Message-ID | <tfhZ7-6sW-13@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_counter_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 2 +-
drivers/staging/lustre/include/linux/lnet/lib-types.h | 2 +-
drivers/staging/lustre/include/linux/lnet/types.h | 4 ++--
drivers/staging/lustre/lnet/lnet/api-ni.c | 10 +++++-----
drivers/staging/lustre/lnet/lnet/lib-msg.c | 6 +++---
drivers/staging/lustre/lnet/lnet/router_proc.c | 2 +-
drivers/staging/lustre/lnet/selftest/console.c | 4 ++--
drivers/staging/lustre/lnet/selftest/rpc.h | 2 +-
8 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 4ffe79c..4a1e0a1 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -603,7 +603,7 @@ int lnet_delay_rule_list(int pos, struct lnet_fault_attr *attr,
/** @} lnet_fault_simulation */
-void lnet_counters_get(lnet_counters_t *counters);
+void lnet_counters_get(struct lnet_counters *counters);
void lnet_counters_reset(void);
unsigned int lnet_iov_nob(unsigned int niov, struct kvec *iov);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index ffc961f..c98af93 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -573,7 +573,7 @@ struct lnet {
struct cfs_percpt_lock *ln_net_lock;
/* percpt message containers for active/finalizing/freed message */
struct lnet_msg_container **ln_msg_containers;
- lnet_counters_t **ln_counters;
+ struct lnet_counters **ln_counters;
struct lnet_peer_table **ln_peer_tables;
/* failure simulation */
struct list_head ln_test_peers;
diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/linux/lnet/types.h
index e81b079..d2af335 100644
--- a/drivers/staging/lustre/include/linux/lnet/types.h
+++ b/drivers/staging/lustre/include/linux/lnet/types.h
@@ -250,7 +250,7 @@ struct lnet_ping_info {
struct lnet_ni_status pi_ni[0];
} WIRE_ATTR;
-typedef struct lnet_counters {
+struct lnet_counters {
__u32 msgs_alloc;
__u32 msgs_max;
__u32 errors;
@@ -262,7 +262,7 @@ struct lnet_ping_info {
__u64 recv_length;
__u64 route_length;
__u64 drop_length;
-} WIRE_ATTR lnet_counters_t;
+} WIRE_ATTR;
#define LNET_NI_STATUS_UP 0x15aac0de
#define LNET_NI_STATUS_DOWN 0xdeadface
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 024b8e3..34b9b10 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -315,9 +315,9 @@ static void lnet_assert_wire_constants(void)
EXPORT_SYMBOL(lnet_unregister_lnd);
void
-lnet_counters_get(lnet_counters_t *counters)
+lnet_counters_get(struct lnet_counters *counters)
{
- lnet_counters_t *ctr;
+ struct lnet_counters *ctr;
int i;
memset(counters, 0, sizeof(*counters));
@@ -344,13 +344,13 @@ static void lnet_assert_wire_constants(void)
void
lnet_counters_reset(void)
{
- lnet_counters_t *counters;
+ struct lnet_counters *counters;
int i;
lnet_net_lock(LNET_LOCK_EX);
cfs_percpt_for_each(counters, i, the_lnet.ln_counters)
- memset(counters, 0, sizeof(lnet_counters_t));
+ memset(counters, 0, sizeof(struct lnet_counters));
lnet_net_unlock(LNET_LOCK_EX);
}
@@ -560,7 +560,7 @@ struct lnet_libhandle *
the_lnet.ln_interface_cookie = ktime_get_ns();
the_lnet.ln_counters = cfs_percpt_alloc(lnet_cpt_table(),
- sizeof(lnet_counters_t));
+ sizeof(struct lnet_counters));
if (!the_lnet.ln_counters) {
CERROR("Failed to allocate counters for LNet\n");
rc = -ENOMEM;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c
index 128c335..4b5e3a8 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-msg.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c
@@ -132,7 +132,7 @@
lnet_msg_commit(struct lnet_msg *msg, int cpt)
{
struct lnet_msg_container *container = the_lnet.ln_msg_containers[cpt];
- lnet_counters_t *counters = the_lnet.ln_counters[cpt];
+ struct lnet_counters *counters = the_lnet.ln_counters[cpt];
/* routed message can be committed for both receiving and sending */
LASSERT(!msg->msg_tx_committed);
@@ -164,7 +164,7 @@
static void
lnet_msg_decommit_tx(struct lnet_msg *msg, int status)
{
- lnet_counters_t *counters;
+ struct lnet_counters *counters;
lnet_event_t *ev = &msg->msg_ev;
LASSERT(msg->msg_tx_committed);
@@ -216,7 +216,7 @@
static void
lnet_msg_decommit_rx(struct lnet_msg *msg, int status)
{
- lnet_counters_t *counters;
+ struct lnet_counters *counters;
lnet_event_t *ev = &msg->msg_ev;
LASSERT(!msg->msg_tx_committed); /* decommitted or never committed */
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c
index 0065cc1..72b80c5 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -77,7 +77,7 @@ static int __proc_lnet_stats(void *data, int write,
loff_t pos, void __user *buffer, int nob)
{
int rc;
- lnet_counters_t *ctrs;
+ struct lnet_counters *ctrs;
int len;
char *tmpstr;
const int tmpsiz = 256; /* 7 %u and 4 %llu */
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 4e7e5c8..358cae8 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -1469,14 +1469,14 @@ static void lstcon_group_ndlink_release(struct lstcon_group *,
struct srpc_stat_reply *rep = &msg->msg_body.stat_reply;
struct sfw_counters __user *sfwk_stat;
struct srpc_counters __user *srpc_stat;
- lnet_counters_t __user *lnet_stat;
+ struct lnet_counters __user *lnet_stat;
if (rep->str_status)
return 0;
sfwk_stat = (struct sfw_counters __user *)&ent_up->rpe_payload[0];
srpc_stat = (struct srpc_counters __user *)(sfwk_stat + 1);
- lnet_stat = (lnet_counters_t __user *)(srpc_stat + 1);
+ lnet_stat = (struct lnet_counters __user *)(srpc_stat + 1);
if (copy_to_user(sfwk_stat, &rep->str_fw, sizeof(*sfwk_stat)) ||
copy_to_user(srpc_stat, &rep->str_rpc, sizeof(*srpc_stat)) ||
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h
index 418c9c9..a765537 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.h
+++ b/drivers/staging/lustre/lnet/selftest/rpc.h
@@ -163,7 +163,7 @@ struct srpc_stat_reply {
struct lst_sid str_sid;
struct sfw_counters str_fw;
struct srpc_counters str_rpc;
- lnet_counters_t str_lnet;
+ struct lnet_counters str_lnet;
} WIRE_ATTR;
struct test_bulk_req {
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:10 +0100 |
| Subject | [PATCH 19/34] staging: lustre: lnet: change lnet_rtrbuf_t to proper structure |
| Message-ID | <tfhZ7-6sW-15@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_rtrbuf_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 2 +-
drivers/staging/lustre/include/linux/lnet/lib-types.h | 4 ++--
drivers/staging/lustre/lnet/lnet/lib-move.c | 8 ++++----
drivers/staging/lustre/lnet/lnet/router.c | 18 +++++++++---------
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 61a911a..223e5a3 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -468,7 +468,7 @@ int lnet_get_route(int idx, __u32 *net, __u32 *hops,
void lnet_router_debugfs_init(void);
void lnet_router_debugfs_fini(void);
int lnet_rtrpools_alloc(int im_a_router);
-void lnet_destroy_rtrbuf(lnet_rtrbuf_t *rb, int npages);
+void lnet_destroy_rtrbuf(struct lnet_rtrbuf *rb, int npages);
int lnet_rtrpools_adjust(int tiny, int small, int large);
int lnet_rtrpools_enable(void);
void lnet_rtrpools_disable(void);
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index b654ab6..f939492 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -410,11 +410,11 @@ struct lnet_rtrbufpool {
int rbp_mincredits; /* low water mark */
};
-typedef struct {
+struct lnet_rtrbuf {
struct list_head rb_list; /* chain on rbp_bufs */
struct lnet_rtrbufpool *rb_pool; /* owning pool */
lnet_kiov_t rb_kiov[0]; /* the buffer space */
-} lnet_rtrbuf_t;
+};
#define LNET_PEER_HASHSIZE 503 /* prime! */
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 2d31e1f..aea899e 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -711,7 +711,7 @@
*/
struct lnet_peer *lp = msg->msg_rxpeer;
struct lnet_rtrbufpool *rbp;
- lnet_rtrbuf_t *rb;
+ struct lnet_rtrbuf *rb;
LASSERT(!msg->msg_iov);
LASSERT(!msg->msg_kiov);
@@ -759,7 +759,7 @@
}
LASSERT(!list_empty(&rbp->rbp_bufs));
- rb = list_entry(rbp->rbp_bufs.next, lnet_rtrbuf_t, rb_list);
+ rb = list_entry(rbp->rbp_bufs.next, struct lnet_rtrbuf, rb_list);
list_del(&rb->rb_list);
msg->msg_niov = rbp->rbp_npages;
@@ -879,7 +879,7 @@
if (msg->msg_rtrcredit) {
/* give back global router credits */
- lnet_rtrbuf_t *rb;
+ struct lnet_rtrbuf *rb;
struct lnet_rtrbufpool *rbp;
/*
@@ -889,7 +889,7 @@
*/
LASSERT(msg->msg_kiov);
- rb = list_entry(msg->msg_kiov, lnet_rtrbuf_t, rb_kiov[0]);
+ rb = list_entry(msg->msg_kiov, struct lnet_rtrbuf, rb_kiov[0]);
rbp = rb->rb_pool;
msg->msg_kiov = NULL;
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c
index a5f1f85..effa0fe 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -1305,9 +1305,9 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
}
void
-lnet_destroy_rtrbuf(lnet_rtrbuf_t *rb, int npages)
+lnet_destroy_rtrbuf(struct lnet_rtrbuf *rb, int npages)
{
- int sz = offsetof(lnet_rtrbuf_t, rb_kiov[npages]);
+ int sz = offsetof(struct lnet_rtrbuf, rb_kiov[npages]);
while (--npages >= 0)
__free_page(rb->rb_kiov[npages].bv_page);
@@ -1315,13 +1315,13 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
LIBCFS_FREE(rb, sz);
}
-static lnet_rtrbuf_t *
+static struct lnet_rtrbuf *
lnet_new_rtrbuf(struct lnet_rtrbufpool *rbp, int cpt)
{
int npages = rbp->rbp_npages;
- int sz = offsetof(lnet_rtrbuf_t, rb_kiov[npages]);
+ int sz = offsetof(struct lnet_rtrbuf, rb_kiov[npages]);
struct page *page;
- lnet_rtrbuf_t *rb;
+ struct lnet_rtrbuf *rb;
int i;
LIBCFS_CPT_ALLOC(rb, lnet_cpt_table(), cpt, sz);
@@ -1355,8 +1355,8 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
{
int npages = rbp->rbp_npages;
struct list_head tmp;
- lnet_rtrbuf_t *rb;
- lnet_rtrbuf_t *temp;
+ struct lnet_rtrbuf *rb;
+ struct lnet_rtrbuf *temp;
if (!rbp->rbp_nbuffers) /* not initialized or already freed */
return;
@@ -1383,7 +1383,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
lnet_rtrpool_adjust_bufs(struct lnet_rtrbufpool *rbp, int nbufs, int cpt)
{
struct list_head rb_list;
- lnet_rtrbuf_t *rb;
+ struct lnet_rtrbuf *rb;
int num_rb;
int num_buffers = 0;
int old_req_nbufs;
@@ -1458,7 +1458,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
failed:
while (!list_empty(&rb_list)) {
- rb = list_entry(rb_list.next, lnet_rtrbuf_t, rb_list);
+ rb = list_entry(rb_list.next, struct lnet_rtrbuf, rb_list);
list_del(&rb->rb_list);
lnet_destroy_rtrbuf(rb, npages);
}
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:10 +0100 |
| Subject | [PATCH 21/34] staging: lustre: lnet: change lnet_t to proper structure |
| Message-ID | <tfhZ7-6sW-19@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 2 +-
drivers/staging/lustre/include/linux/lnet/lib-types.h | 4 ++--
drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 37b9d66..4ffe79c 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -41,7 +41,7 @@
#include "lib-types.h"
#include "lib-dlc.h"
-extern lnet_t the_lnet; /* THE network */
+extern struct lnet the_lnet; /* THE network */
#if (BITS_PER_LONG == 32)
/* 2 CPTs, allowing more CPTs might make us under memory pressure */
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index e00bd38..5bf1819 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -545,7 +545,7 @@ struct lnet_msg_container {
#define LNET_RC_STATE_RUNNING 1 /* started up OK */
#define LNET_RC_STATE_STOPPING 2 /* telling thread to stop */
-typedef struct {
+struct lnet {
/* CPU partition table of LNet */
struct cfs_cpt_table *ln_cpt_table;
/* number of CPTs in ln_cpt_table */
@@ -648,6 +648,6 @@ struct lnet_msg_container {
*/
wait_queue_head_t ln_rc_waitq;
-} lnet_t;
+};
#endif
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index c03e701..024b8e3 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -39,7 +39,7 @@
#define D_LNI D_CONSOLE
-lnet_t the_lnet; /* THE state of the network */
+struct lnet the_lnet; /* THE state of the network */
EXPORT_SYMBOL(the_lnet);
static char *ip2nets = "";
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:10 +0100 |
| Subject | [PATCH 18/34] staging: lustre: lnet: change lnet_rtrbufpool_t to proper structure |
| Message-ID | <tfhZ7-6sW-17@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_rtrbufpool_t from typedef to proper structure.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 2 +-
drivers/staging/lustre/include/linux/lnet/lib-types.h | 8 ++++----
drivers/staging/lustre/lnet/lnet/lib-move.c | 10 +++++-----
drivers/staging/lustre/lnet/lnet/router.c | 18 +++++++++---------
drivers/staging/lustre/lnet/lnet/router_proc.c | 2 +-
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 8483a4a..61a911a 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -496,7 +496,7 @@ void lnet_prep_send(struct lnet_msg *msg, int type, lnet_process_id_t target,
int lnet_send(lnet_nid_t nid, struct lnet_msg *msg, lnet_nid_t rtr_nid);
void lnet_return_tx_credits_locked(struct lnet_msg *msg);
void lnet_return_rx_credits_locked(struct lnet_msg *msg);
-void lnet_schedule_blocked_locked(lnet_rtrbufpool_t *rbp);
+void lnet_schedule_blocked_locked(struct lnet_rtrbufpool *rbp);
void lnet_drop_routed_msgs_locked(struct list_head *list, int cpt);
/* portals functions */
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 04ad728..b654ab6 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -396,7 +396,7 @@ struct lnet_remotenet {
/** lnet message is waiting for credit */
#define LNET_CREDIT_WAIT 1
-typedef struct {
+struct lnet_rtrbufpool {
struct list_head rbp_bufs; /* my free buffer pool */
struct list_head rbp_msgs; /* messages blocking
for a buffer */
@@ -408,11 +408,11 @@ struct lnet_remotenet {
int rbp_credits; /* # free buffers /
blocked messages */
int rbp_mincredits; /* low water mark */
-} lnet_rtrbufpool_t;
+};
typedef struct {
struct list_head rb_list; /* chain on rbp_bufs */
- lnet_rtrbufpool_t *rb_pool; /* owning pool */
+ struct lnet_rtrbufpool *rb_pool; /* owning pool */
lnet_kiov_t rb_kiov[0]; /* the buffer space */
} lnet_rtrbuf_t;
@@ -596,7 +596,7 @@ struct lnet_msg_container {
/* validity stamp */
__u64 ln_routers_version;
/* percpt router buffer pools */
- lnet_rtrbufpool_t **ln_rtrpools;
+ struct lnet_rtrbufpool **ln_rtrpools;
struct lnet_handle_md ln_ping_target_md;
struct lnet_handle_eq ln_ping_target_eq;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 3581100..2d31e1f 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -680,10 +680,10 @@
return LNET_CREDIT_OK;
}
-static lnet_rtrbufpool_t *
+static struct lnet_rtrbufpool *
lnet_msg2bufpool(struct lnet_msg *msg)
{
- lnet_rtrbufpool_t *rbp;
+ struct lnet_rtrbufpool *rbp;
int cpt;
LASSERT(msg->msg_rx_committed);
@@ -710,7 +710,7 @@
* received or OK to receive
*/
struct lnet_peer *lp = msg->msg_rxpeer;
- lnet_rtrbufpool_t *rbp;
+ struct lnet_rtrbufpool *rbp;
lnet_rtrbuf_t *rb;
LASSERT(!msg->msg_iov);
@@ -835,7 +835,7 @@
}
void
-lnet_schedule_blocked_locked(lnet_rtrbufpool_t *rbp)
+lnet_schedule_blocked_locked(struct lnet_rtrbufpool *rbp)
{
struct lnet_msg *msg;
@@ -880,7 +880,7 @@
if (msg->msg_rtrcredit) {
/* give back global router credits */
lnet_rtrbuf_t *rb;
- lnet_rtrbufpool_t *rbp;
+ struct lnet_rtrbufpool *rbp;
/*
* NB If a msg ever blocks for a buffer in rbp_msgs, it stays
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c
index 9a5faba..a5f1f85 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -558,7 +558,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
return rc;
for (i = 0; i < LNET_NRBPOOLS; i++) {
- lnet_rtrbufpool_t *rbp;
+ struct lnet_rtrbufpool *rbp;
lnet_net_lock(LNET_LOCK_EX);
cfs_percpt_for_each(rbp, j, the_lnet.ln_rtrpools) {
@@ -1316,7 +1316,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
}
static lnet_rtrbuf_t *
-lnet_new_rtrbuf(lnet_rtrbufpool_t *rbp, int cpt)
+lnet_new_rtrbuf(struct lnet_rtrbufpool *rbp, int cpt)
{
int npages = rbp->rbp_npages;
int sz = offsetof(lnet_rtrbuf_t, rb_kiov[npages]);
@@ -1351,7 +1351,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
}
static void
-lnet_rtrpool_free_bufs(lnet_rtrbufpool_t *rbp, int cpt)
+lnet_rtrpool_free_bufs(struct lnet_rtrbufpool *rbp, int cpt)
{
int npages = rbp->rbp_npages;
struct list_head tmp;
@@ -1380,7 +1380,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
}
static int
-lnet_rtrpool_adjust_bufs(lnet_rtrbufpool_t *rbp, int nbufs, int cpt)
+lnet_rtrpool_adjust_bufs(struct lnet_rtrbufpool *rbp, int nbufs, int cpt)
{
struct list_head rb_list;
lnet_rtrbuf_t *rb;
@@ -1467,7 +1467,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
}
static void
-lnet_rtrpool_init(lnet_rtrbufpool_t *rbp, int npages)
+lnet_rtrpool_init(struct lnet_rtrbufpool *rbp, int npages)
{
INIT_LIST_HEAD(&rbp->rbp_msgs);
INIT_LIST_HEAD(&rbp->rbp_bufs);
@@ -1480,7 +1480,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
void
lnet_rtrpools_free(int keep_pools)
{
- lnet_rtrbufpool_t *rtrp;
+ struct lnet_rtrbufpool *rtrp;
int i;
if (!the_lnet.ln_rtrpools) /* uninitialized or freed */
@@ -1558,7 +1558,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
int
lnet_rtrpools_alloc(int im_a_router)
{
- lnet_rtrbufpool_t *rtrp;
+ struct lnet_rtrbufpool *rtrp;
int nrb_tiny;
int nrb_small;
int nrb_large;
@@ -1593,7 +1593,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
the_lnet.ln_rtrpools = cfs_percpt_alloc(lnet_cpt_table(),
LNET_NRBPOOLS *
- sizeof(lnet_rtrbufpool_t));
+ sizeof(struct lnet_rtrbufpool));
if (!the_lnet.ln_rtrpools) {
LCONSOLE_ERROR_MSG(0x10c,
"Failed to initialize router buffe pool\n");
@@ -1639,7 +1639,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
int nrb = 0;
int rc = 0;
int i;
- lnet_rtrbufpool_t *rtrp;
+ struct lnet_rtrbufpool *rtrp;
/*
* If the provided values for each buffer pool are different than the
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c
index 779ec69..0065cc1 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -592,7 +592,7 @@ static int __proc_lnet_buffers(void *data, int write,
goto out; /* I'm not a router */
for (idx = 0; idx < LNET_NRBPOOLS; idx++) {
- lnet_rtrbufpool_t *rbp;
+ struct lnet_rtrbufpool *rbp;
lnet_net_lock(LNET_LOCK_EX);
cfs_percpt_for_each(rbp, i, the_lnet.ln_rtrpools) {
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:20 +0100 |
| Subject | [PATCH 31/34] staging: lustre: lnet: change lnet_ack_req_t to proper enum |
| Message-ID | <tfi8O-6xb-3@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_ack_req_t from typedef to proper enum.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/api.h | 2 +-
drivers/staging/lustre/include/linux/lnet/types.h | 4 ++--
drivers/staging/lustre/lnet/lnet/lib-move.c | 2 +-
drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/api.h b/drivers/staging/lustre/include/linux/lnet/api.h
index fc42898..f4b6de2 100644
--- a/drivers/staging/lustre/include/linux/lnet/api.h
+++ b/drivers/staging/lustre/include/linux/lnet/api.h
@@ -180,7 +180,7 @@ int LNetEQPoll(struct lnet_handle_eq *eventqs_in,
*/
int LNetPut(lnet_nid_t self,
struct lnet_handle_md md_in,
- lnet_ack_req_t ack_req_in,
+ enum lnet_ack_req ack_req_in,
struct lnet_process_id target_in,
unsigned int portal_in,
__u64 match_bits_in,
diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/linux/lnet/types.h
index a621ab6..8e10ad6 100644
--- a/drivers/staging/lustre/include/linux/lnet/types.h
+++ b/drivers/staging/lustre/include/linux/lnet/types.h
@@ -663,12 +663,12 @@ struct lnet_event {
* \see lnet_md::options for the discussion on LNET_MD_ACK_DISABLE by which
* acknowledgments can be disabled for a MD.
*/
-typedef enum {
+enum lnet_ack_req {
/** Request an acknowledgment */
LNET_ACK_REQ,
/** Request that no acknowledgment should be generated. */
LNET_NOACK_REQ
-} lnet_ack_req_t;
+};
/** @} lnet_data */
/** @} lnet */
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 7fdbc75..48e1f5b 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -1990,7 +1990,7 @@
* \see lnet_event::hdr_data and lnet_event_kind.
*/
int
-LNetPut(lnet_nid_t self, struct lnet_handle_md mdh, lnet_ack_req_t ack,
+LNetPut(lnet_nid_t self, struct lnet_handle_md mdh, enum lnet_ack_req ack,
struct lnet_process_id target, unsigned int portal,
__u64 match_bits, unsigned int offset,
__u64 hdr_data)
diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c
index e3d2c0d..eddc192 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c
@@ -44,7 +44,7 @@
* Returns 0 on success or error code.
*/
static int ptl_send_buf(struct lnet_handle_md *mdh, void *base, int len,
- lnet_ack_req_t ack, struct ptlrpc_cb_id *cbid,
+ enum lnet_ack_req ack, struct ptlrpc_cb_id *cbid,
struct ptlrpc_connection *conn, int portal, __u64 xid,
unsigned int offset)
{
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Date | 2017-02-27 02:20 +0100 |
| Subject | [PATCH 02/34] staging: lustre: lnet: change lnet_handle_eq_t to proper struct |
| Message-ID | <tfi8O-6xb-5@gated-at.bofh.it> |
| In reply to | #1588431 |
Change lnet_handle_eq_t from a typedef of another typedef into
a proper stand alone structure. Create the inline functions
LNetInvalidateEQHandle and LNetEQHandleIsInvalid to handle this
new piece of data.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/include/linux/lnet/api.h | 8 +++----
.../staging/lustre/include/linux/lnet/lib-lnet.h | 6 +++---
.../staging/lustre/include/linux/lnet/lib-types.h | 4 ++--
drivers/staging/lustre/include/linux/lnet/types.h | 25 ++++++++++++++++++++--
drivers/staging/lustre/lnet/lnet/api-ni.c | 4 ++--
drivers/staging/lustre/lnet/lnet/lib-eq.c | 6 +++---
drivers/staging/lustre/lnet/lnet/lib-md.c | 4 ++--
drivers/staging/lustre/lnet/lnet/router.c | 2 +-
drivers/staging/lustre/lnet/selftest/rpc.c | 4 ++--
drivers/staging/lustre/lustre/include/lustre_net.h | 2 +-
drivers/staging/lustre/lustre/ptlrpc/events.c | 2 +-
11 files changed, 44 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/api.h b/drivers/staging/lustre/include/linux/lnet/api.h
index cb0d6b4..1db4e00 100644
--- a/drivers/staging/lustre/include/linux/lnet/api.h
+++ b/drivers/staging/lustre/include/linux/lnet/api.h
@@ -147,7 +147,7 @@ int LNetMDBind(lnet_md_t md_in,
* associated with it. If an event handler exists, it will be run for each
* event that is deposited into the EQ.
*
- * In addition to the lnet_handle_eq_t, the LNet API defines two types
+ * In addition to the lnet_handle_eq, the LNet API defines two types
* associated with events: The ::lnet_event_kind_t defines the kinds of events
* that can be stored in an EQ. The lnet_event_t defines a structure that
* holds the information about with an event.
@@ -162,11 +162,11 @@ int LNetMDBind(lnet_md_t md_in,
*/
int LNetEQAlloc(unsigned int count_in,
lnet_eq_handler_t handler,
- lnet_handle_eq_t *handle_out);
+ struct lnet_handle_eq *handle_out);
-int LNetEQFree(lnet_handle_eq_t eventq_in);
+int LNetEQFree(struct lnet_handle_eq eventq_in);
-int LNetEQPoll(lnet_handle_eq_t *eventqs_in,
+int LNetEQPoll(struct lnet_handle_eq *eventqs_in,
int neq_in,
int timeout_ms,
lnet_event_t *event_out,
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 3d19402..808d886 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -278,10 +278,10 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
}
static inline void
-lnet_eq2handle(lnet_handle_eq_t *handle, lnet_eq_t *eq)
+lnet_eq2handle(struct lnet_handle_eq *handle, lnet_eq_t *eq)
{
if (!eq) {
- LNetInvalidateHandle(handle);
+ LNetInvalidateEQHandle(handle);
return;
}
@@ -289,7 +289,7 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
}
static inline lnet_eq_t *
-lnet_handle2eq(lnet_handle_eq_t *handle)
+lnet_handle2eq(struct lnet_handle_eq *handle)
{
lnet_libhandle_t *lh;
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 9850398..199e194 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -598,13 +598,13 @@ struct lnet_msg_container {
lnet_rtrbufpool_t **ln_rtrpools;
lnet_handle_md_t ln_ping_target_md;
- lnet_handle_eq_t ln_ping_target_eq;
+ struct lnet_handle_eq ln_ping_target_eq;
struct lnet_ping_info *ln_ping_info;
/* router checker startup/shutdown state */
int ln_rc_state;
/* router checker's event queue */
- lnet_handle_eq_t ln_rc_eqh;
+ struct lnet_handle_eq ln_rc_eqh;
/* rcd still pending on net */
struct list_head ln_rcd_deathrow;
/* rcd ready for free */
diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/linux/lnet/types.h
index 1c8de72..ebf87cd 100644
--- a/drivers/staging/lustre/include/linux/lnet/types.h
+++ b/drivers/staging/lustre/include/linux/lnet/types.h
@@ -284,7 +284,6 @@ struct lnet_ping_info {
__u64 cookie;
} lnet_handle_any_t;
-typedef lnet_handle_any_t lnet_handle_eq_t;
typedef lnet_handle_any_t lnet_handle_md_t;
typedef lnet_handle_any_t lnet_handle_me_t;
@@ -318,6 +317,28 @@ static inline int LNetHandleIsInvalid(lnet_handle_any_t h)
return h.cookie == LNET_WIRE_HANDLE_COOKIE_NONE;
}
+struct lnet_handle_eq {
+ u64 cookie;
+};
+
+/**
+ * Invalidate eq handle @h.
+ */
+static inline void LNetInvalidateEQHandle(struct lnet_handle_eq *h)
+{
+ h->cookie = LNET_WIRE_HANDLE_COOKIE_NONE;
+}
+
+/**
+ * Check whether eq handle @h is invalid.
+ *
+ * @return 1 if handle is invalid, 0 if valid.
+ */
+static inline int LNetEQHandleIsInvalid(struct lnet_handle_eq h)
+{
+ return (LNET_WIRE_HANDLE_COOKIE_NONE == h.cookie);
+}
+
/**
* Global process ID.
*/
@@ -461,7 +482,7 @@ static inline int LNetHandleIsInvalid(lnet_handle_any_t h)
* by LNetInvalidateHandle()), operations performed on this memory
* descriptor are not logged.
*/
- lnet_handle_eq_t eq_handle;
+ struct lnet_handle_eq eq_handle;
} lnet_md_t;
/*
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 08b38ef..0564e93 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1433,7 +1433,7 @@ int lnet_lib_init(void)
}
the_lnet.ln_refcount = 0;
- LNetInvalidateHandle(&the_lnet.ln_rc_eqh);
+ LNetInvalidateEQHandle(&the_lnet.ln_rc_eqh);
INIT_LIST_HEAD(&the_lnet.ln_lnds);
INIT_LIST_HEAD(&the_lnet.ln_rcd_zombie);
INIT_LIST_HEAD(&the_lnet.ln_rcd_deathrow);
@@ -2138,7 +2138,7 @@ void LNetDebugPeer(lnet_process_id_t id)
static int lnet_ping(lnet_process_id_t id, int timeout_ms,
lnet_process_id_t __user *ids, int n_ids)
{
- lnet_handle_eq_t eqh;
+ struct lnet_handle_eq eqh;
lnet_handle_md_t mdh;
lnet_event_t event;
lnet_md_t md = { NULL };
diff --git a/drivers/staging/lustre/lnet/lnet/lib-eq.c b/drivers/staging/lustre/lnet/lnet/lib-eq.c
index d05c6cc..6645fdc 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-eq.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-eq.c
@@ -64,7 +64,7 @@
*/
int
LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback,
- lnet_handle_eq_t *handle)
+ struct lnet_handle_eq *handle)
{
lnet_eq_t *eq;
@@ -152,7 +152,7 @@
* \retval -EBUSY If the EQ is still in use by some MDs.
*/
int
-LNetEQFree(lnet_handle_eq_t eqh)
+LNetEQFree(struct lnet_handle_eq eqh)
{
struct lnet_eq *eq;
lnet_event_t *events = NULL;
@@ -370,7 +370,7 @@
* \retval -ENOENT If there's an invalid handle in \a eventqs.
*/
int
-LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
+LNetEQPoll(struct lnet_handle_eq *eventqs, int neq, int timeout_ms,
lnet_event_t *event, int *which)
{
int wait = 1;
diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c
index eab53cd..d97e046 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -165,7 +165,7 @@
/* must be called with resource lock held */
static int
-lnet_md_link(lnet_libmd_t *md, lnet_handle_eq_t eq_handle, int cpt)
+lnet_md_link(lnet_libmd_t *md, struct lnet_handle_eq eq_handle, int cpt)
{
struct lnet_res_container *container = the_lnet.ln_md_containers[cpt];
@@ -185,7 +185,7 @@
* maybe there we shouldn't even allow LNET_EQ_NONE!)
* LASSERT(!eq);
*/
- if (!LNetHandleIsInvalid(eq_handle)) {
+ if (!LNetEQHandleIsInvalid(eq_handle)) {
md->md_eq = lnet_handle2eq(&eq_handle);
if (!md->md_eq)
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c
index cf22525..ba80221 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -933,7 +933,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
md.options = LNET_MD_TRUNCATE;
md.eq_handle = the_lnet.ln_rc_eqh;
- LASSERT(!LNetHandleIsInvalid(the_lnet.ln_rc_eqh));
+ LASSERT(!LNetEQHandleIsInvalid(the_lnet.ln_rc_eqh));
rc = LNetMDBind(md, LNET_UNLINK, &rcd->rcd_mdh);
if (rc < 0) {
CERROR("Can't bind MD: %d\n", rc);
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 92cd411..3f070eb 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -53,7 +53,7 @@ enum srpc_state {
static struct smoketest_rpc {
spinlock_t rpc_glock; /* global lock */
struct srpc_service *rpc_services[SRPC_SERVICE_MAX_ID + 1];
- lnet_handle_eq_t rpc_lnet_eq; /* _the_ LNet event queue */
+ struct lnet_handle_eq rpc_lnet_eq; /* _the_ LNet event queue */
enum srpc_state rpc_state;
struct srpc_counters rpc_counters;
__u64 rpc_matchbits; /* matchbits counter */
@@ -1622,7 +1622,7 @@ struct srpc_client_rpc *
srpc_data.rpc_state = SRPC_STATE_NI_INIT;
- LNetInvalidateHandle(&srpc_data.rpc_lnet_eq);
+ LNetInvalidateEQHandle(&srpc_data.rpc_lnet_eq);
rc = LNetEQAlloc(0, srpc_lnet_ev_handler, &srpc_data.rpc_lnet_eq);
if (rc) {
CERROR("LNetEQAlloc() has failed: %d\n", rc);
diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h
index 1b48df0..7955cbf 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -1749,7 +1749,7 @@ static inline bool nrs_policy_compat_one(const struct ptlrpc_service *svc,
/** @} nrs */
/* ptlrpc/events.c */
-extern lnet_handle_eq_t ptlrpc_eq_h;
+extern struct lnet_handle_eq ptlrpc_eq_h;
int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
lnet_process_id_t *peer, lnet_nid_t *self);
/**
diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c b/drivers/staging/lustre/lustre/ptlrpc/events.c
index dc0fe9d..ca11b03 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/events.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/events.c
@@ -42,7 +42,7 @@
#include "../include/lustre_sec.h"
#include "ptlrpc_internal.h"
-lnet_handle_eq_t ptlrpc_eq_h;
+struct lnet_handle_eq ptlrpc_eq_h;
/*
* Client's outgoing request callback
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | linux.kernel
csiph-web