Commit f4dd96f7 authored by Andy Grover's avatar Andy Grover

RDS: make sure all sgs alloced are initialized

rds_message_alloc_sgs() now returns correctly-initialized
sg lists, so calleds need not do this themselves.
Signed-off-by: default avatarAndy Grover <andy.grover@oracle.com>
parent ff87e97a
...@@ -249,7 +249,7 @@ struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents) ...@@ -249,7 +249,7 @@ struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents)
WARN_ON(rm->m_used_sgs + nents > rm->m_total_sgs); WARN_ON(rm->m_used_sgs + nents > rm->m_total_sgs);
sg_ret = &sg_first[rm->m_used_sgs]; sg_ret = &sg_first[rm->m_used_sgs];
sg_init_table(sg_ret, nents);
rm->m_used_sgs += nents; rm->m_used_sgs += nents;
return sg_ret; return sg_ret;
......
...@@ -534,14 +534,13 @@ static int rds_rdma_prepare(struct rds_message *rm, ...@@ -534,14 +534,13 @@ static int rds_rdma_prepare(struct rds_message *rm,
goto out; goto out;
} }
op->r_sg = rds_message_alloc_sgs(rm, nr_pages);
op->r_write = !!(args->flags & RDS_RDMA_READWRITE); op->r_write = !!(args->flags & RDS_RDMA_READWRITE);
op->r_fence = !!(args->flags & RDS_RDMA_FENCE); op->r_fence = !!(args->flags & RDS_RDMA_FENCE);
op->r_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME); op->r_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME);
op->r_active = 1; op->r_active = 1;
op->r_recverr = rs->rs_recverr; op->r_recverr = rs->rs_recverr;
WARN_ON(!nr_pages); WARN_ON(!nr_pages);
sg_init_table(op->r_sg, nr_pages); op->r_sg = rds_message_alloc_sgs(rm, nr_pages);
if (op->r_notify || op->r_recverr) { if (op->r_notify || op->r_recverr) {
/* We allocate an uninitialized notifier here, because /* We allocate an uninitialized notifier here, because
......
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