Commit 2ea8f9aa authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lnet: change lnet_process_id_packed_t to proper structure

Change lnet_process_id_packed_t from typedef to proper structure.
Signed-off-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566Reviewed-by: default avatarDoug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: default avatarOlaf Weber <olaf@sgi.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 581c38f3
No related merge requests found
...@@ -115,11 +115,11 @@ static inline __u32 LNET_MKNET(__u32 type, __u32 num) ...@@ -115,11 +115,11 @@ static inline __u32 LNET_MKNET(__u32 type, __u32 num)
#define WIRE_ATTR __packed #define WIRE_ATTR __packed
/* Packed version of lnet_process_id_t to transfer via network */ /* Packed version of lnet_process_id_t to transfer via network */
typedef struct { struct lnet_process_id_packed {
/* node id / process id */ /* node id / process id */
lnet_nid_t nid; lnet_nid_t nid;
lnet_pid_t pid; lnet_pid_t pid;
} WIRE_ATTR lnet_process_id_packed_t; } WIRE_ATTR;
/* /*
* The wire handle's interface cookie only matches one network interface in * The wire handle's interface cookie only matches one network interface in
......
...@@ -698,17 +698,17 @@ lstcon_statrpc_prep(struct lstcon_node *nd, unsigned int feats, ...@@ -698,17 +698,17 @@ lstcon_statrpc_prep(struct lstcon_node *nd, unsigned int feats,
return 0; return 0;
} }
static lnet_process_id_packed_t * static struct lnet_process_id_packed *
lstcon_next_id(int idx, int nkiov, lnet_kiov_t *kiov) lstcon_next_id(int idx, int nkiov, lnet_kiov_t *kiov)
{ {
lnet_process_id_packed_t *pid; struct lnet_process_id_packed *pid;
int i; int i;
i = idx / SFW_ID_PER_PAGE; i = idx / SFW_ID_PER_PAGE;
LASSERT(i < nkiov); LASSERT(i < nkiov);
pid = (lnet_process_id_packed_t *)page_address(kiov[i].bv_page); pid = (struct lnet_process_id_packed *)page_address(kiov[i].bv_page);
return &pid[idx % SFW_ID_PER_PAGE]; return &pid[idx % SFW_ID_PER_PAGE];
} }
...@@ -717,7 +717,7 @@ static int ...@@ -717,7 +717,7 @@ static int
lstcon_dstnodes_prep(struct lstcon_group *grp, int idx, lstcon_dstnodes_prep(struct lstcon_group *grp, int idx,
int dist, int span, int nkiov, lnet_kiov_t *kiov) int dist, int span, int nkiov, lnet_kiov_t *kiov)
{ {
lnet_process_id_packed_t *pid; struct lnet_process_id_packed *pid;
struct lstcon_ndlink *ndl; struct lstcon_ndlink *ndl;
struct lstcon_node *nd; struct lstcon_node *nd;
int start; int start;
...@@ -823,7 +823,7 @@ lstcon_testrpc_prep(struct lstcon_node *nd, int transop, unsigned int feats, ...@@ -823,7 +823,7 @@ lstcon_testrpc_prep(struct lstcon_node *nd, int transop, unsigned int feats,
npg = sfw_id_pages(test->tes_span); npg = sfw_id_pages(test->tes_span);
nob = !(feats & LST_FEAT_BULK_LEN) ? nob = !(feats & LST_FEAT_BULK_LEN) ?
npg * PAGE_SIZE : npg * PAGE_SIZE :
sizeof(lnet_process_id_packed_t) * test->tes_span; sizeof(struct lnet_process_id_packed) * test->tes_span;
} }
rc = lstcon_rpc_prep(nd, SRPC_SERVICE_TEST, feats, npg, nob, crpc); rc = lstcon_rpc_prep(nd, SRPC_SERVICE_TEST, feats, npg, nob, crpc);
......
...@@ -777,14 +777,14 @@ sfw_add_test_instance(struct sfw_batch *tsb, struct srpc_server_rpc *rpc) ...@@ -777,14 +777,14 @@ sfw_add_test_instance(struct sfw_batch *tsb, struct srpc_server_rpc *rpc)
LASSERT(bk); LASSERT(bk);
LASSERT(bk->bk_niov * SFW_ID_PER_PAGE >= (unsigned int)ndest); LASSERT(bk->bk_niov * SFW_ID_PER_PAGE >= (unsigned int)ndest);
LASSERT((unsigned int)bk->bk_len >= LASSERT((unsigned int)bk->bk_len >=
sizeof(lnet_process_id_packed_t) * ndest); sizeof(struct lnet_process_id_packed) * ndest);
sfw_unpack_addtest_req(msg); sfw_unpack_addtest_req(msg);
memcpy(&tsi->tsi_u, &req->tsr_u, sizeof(tsi->tsi_u)); memcpy(&tsi->tsi_u, &req->tsr_u, sizeof(tsi->tsi_u));
for (i = 0; i < ndest; i++) { for (i = 0; i < ndest; i++) {
lnet_process_id_packed_t *dests; struct lnet_process_id_packed *dests;
lnet_process_id_packed_t id; struct lnet_process_id_packed id;
int j; int j;
dests = page_address(bk->bk_iovs[i / SFW_ID_PER_PAGE].bv_page); dests = page_address(bk->bk_iovs[i / SFW_ID_PER_PAGE].bv_page);
...@@ -1164,7 +1164,7 @@ sfw_add_test(struct srpc_server_rpc *rpc) ...@@ -1164,7 +1164,7 @@ sfw_add_test(struct srpc_server_rpc *rpc)
len = npg * PAGE_SIZE; len = npg * PAGE_SIZE;
} else { } else {
len = sizeof(lnet_process_id_packed_t) * len = sizeof(struct lnet_process_id_packed) *
request->tsr_ndest; request->tsr_ndest;
} }
......
...@@ -396,7 +396,7 @@ struct sfw_test_instance { ...@@ -396,7 +396,7 @@ struct sfw_test_instance {
* pages are not used * pages are not used
*/ */
#define SFW_MAX_CONCUR LST_MAX_CONCUR #define SFW_MAX_CONCUR LST_MAX_CONCUR
#define SFW_ID_PER_PAGE (PAGE_SIZE / sizeof(lnet_process_id_packed_t)) #define SFW_ID_PER_PAGE (PAGE_SIZE / sizeof(struct lnet_process_id_packed))
#define SFW_MAX_NDESTS (LNET_MAX_IOV * SFW_ID_PER_PAGE) #define SFW_MAX_NDESTS (LNET_MAX_IOV * SFW_ID_PER_PAGE)
#define sfw_id_pages(n) (((n) + SFW_ID_PER_PAGE - 1) / SFW_ID_PER_PAGE) #define sfw_id_pages(n) (((n) + SFW_ID_PER_PAGE - 1) / SFW_ID_PER_PAGE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment