staging: lustre: lnet: change lnet_rtrbuf_t to proper structure
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
91a39e293d
commit
e99cc0f1a2
@ -468,7 +468,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg);
|
||||
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);
|
||||
|
@ -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! */
|
||||
|
||||
|
@ -711,7 +711,7 @@ lnet_post_routed_recv_locked(struct lnet_msg *msg, int do_recv)
|
||||
*/
|
||||
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 @@ lnet_post_routed_recv_locked(struct lnet_msg *msg, int do_recv)
|
||||
}
|
||||
|
||||
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 @@ lnet_return_rx_credits_locked(struct lnet_msg *msg)
|
||||
|
||||
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 @@ lnet_return_rx_credits_locked(struct lnet_msg *msg)
|
||||
*/
|
||||
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;
|
||||
|
@ -1305,9 +1305,9 @@ rescan:
|
||||
}
|
||||
|
||||
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 @@ lnet_destroy_rtrbuf(lnet_rtrbuf_t *rb, int npages)
|
||||
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 @@ lnet_rtrpool_free_bufs(struct lnet_rtrbufpool *rbp, int cpt)
|
||||
{
|
||||
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 @@ static int
|
||||
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 @@ lnet_rtrpool_adjust_bufs(struct lnet_rtrbufpool *rbp, int nbufs, int cpt)
|
||||
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user