提交 7edc5a99 编写于 作者: S Sagi Grimberg 提交者: Christoph Hellwig

IB/iser: Use helper for container_of

Nicer this way.
Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 0f512b34
...@@ -731,4 +731,10 @@ iser_tx_next_wr(struct iser_tx_desc *tx_desc) ...@@ -731,4 +731,10 @@ iser_tx_next_wr(struct iser_tx_desc *tx_desc)
return cur_wr; return cur_wr;
} }
static inline struct iser_conn *
to_iser_conn(struct ib_conn *ib_conn)
{
return container_of(ib_conn, struct iser_conn, ib_conn);
}
#endif #endif
...@@ -559,8 +559,7 @@ void iser_rcv_completion(struct iser_rx_desc *rx_desc, ...@@ -559,8 +559,7 @@ void iser_rcv_completion(struct iser_rx_desc *rx_desc,
unsigned long rx_xfer_len, unsigned long rx_xfer_len,
struct ib_conn *ib_conn) struct ib_conn *ib_conn)
{ {
struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn, struct iser_conn *iser_conn = to_iser_conn(ib_conn);
ib_conn);
struct iscsi_hdr *hdr; struct iscsi_hdr *hdr;
char *data; char *data;
u64 rx_dma; u64 rx_dma;
......
...@@ -461,8 +461,7 @@ void iser_free_fastreg_pool(struct ib_conn *ib_conn) ...@@ -461,8 +461,7 @@ void iser_free_fastreg_pool(struct ib_conn *ib_conn)
*/ */
static int iser_create_ib_conn_res(struct ib_conn *ib_conn) static int iser_create_ib_conn_res(struct ib_conn *ib_conn)
{ {
struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn, struct iser_conn *iser_conn = to_iser_conn(ib_conn);
ib_conn);
struct iser_device *device; struct iser_device *device;
struct ib_device_attr *dev_attr; struct ib_device_attr *dev_attr;
struct ib_qp_init_attr init_attr; struct ib_qp_init_attr init_attr;
...@@ -1166,9 +1165,8 @@ static void ...@@ -1166,9 +1165,8 @@ static void
iser_handle_comp_error(struct ib_conn *ib_conn, iser_handle_comp_error(struct ib_conn *ib_conn,
struct ib_wc *wc) struct ib_wc *wc)
{ {
struct iser_conn *iser_conn = to_iser_conn(ib_conn);
void *wr_id = (void *)(uintptr_t)wc->wr_id; void *wr_id = (void *)(uintptr_t)wc->wr_id;
struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn,
ib_conn);
if (wc->status != IB_WC_WR_FLUSH_ERR) if (wc->status != IB_WC_WR_FLUSH_ERR)
if (iser_conn->iscsi_conn) if (iser_conn->iscsi_conn)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册