RDMA: Constify the argument of the work request conversion functions
When posting a send work request, the work request that is posted is not modified by any of the RDMA drivers. Make this explicit by constifying most ib_send_wr pointers in RDMA transport drivers. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
这个提交包含在:
@@ -1352,7 +1352,7 @@ struct ib_rdma_wr {
|
||||
u32 rkey;
|
||||
};
|
||||
|
||||
static inline struct ib_rdma_wr *rdma_wr(struct ib_send_wr *wr)
|
||||
static inline const struct ib_rdma_wr *rdma_wr(const struct ib_send_wr *wr)
|
||||
{
|
||||
return container_of(wr, struct ib_rdma_wr, wr);
|
||||
}
|
||||
@@ -1367,7 +1367,7 @@ struct ib_atomic_wr {
|
||||
u32 rkey;
|
||||
};
|
||||
|
||||
static inline struct ib_atomic_wr *atomic_wr(struct ib_send_wr *wr)
|
||||
static inline const struct ib_atomic_wr *atomic_wr(const struct ib_send_wr *wr)
|
||||
{
|
||||
return container_of(wr, struct ib_atomic_wr, wr);
|
||||
}
|
||||
@@ -1384,7 +1384,7 @@ struct ib_ud_wr {
|
||||
u8 port_num; /* valid for DR SMPs on switch only */
|
||||
};
|
||||
|
||||
static inline struct ib_ud_wr *ud_wr(struct ib_send_wr *wr)
|
||||
static inline const struct ib_ud_wr *ud_wr(const struct ib_send_wr *wr)
|
||||
{
|
||||
return container_of(wr, struct ib_ud_wr, wr);
|
||||
}
|
||||
@@ -1396,7 +1396,7 @@ struct ib_reg_wr {
|
||||
int access;
|
||||
};
|
||||
|
||||
static inline struct ib_reg_wr *reg_wr(struct ib_send_wr *wr)
|
||||
static inline const struct ib_reg_wr *reg_wr(const struct ib_send_wr *wr)
|
||||
{
|
||||
return container_of(wr, struct ib_reg_wr, wr);
|
||||
}
|
||||
@@ -1409,7 +1409,8 @@ struct ib_sig_handover_wr {
|
||||
struct ib_sge *prot;
|
||||
};
|
||||
|
||||
static inline struct ib_sig_handover_wr *sig_handover_wr(struct ib_send_wr *wr)
|
||||
static inline const struct ib_sig_handover_wr *
|
||||
sig_handover_wr(const struct ib_send_wr *wr)
|
||||
{
|
||||
return container_of(wr, struct ib_sig_handover_wr, wr);
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户