diff options
author | Andy Grover <andy.grover@oracle.com> | 2010-01-12 17:17:31 -0500 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:11:39 -0400 |
commit | f4dd96f7b27743e568cec519eff0f951c56833c6 (patch) | |
tree | 7190122e832f3ce6ed394fb7293c037562b346f6 | |
parent | ff87e97a9d70c9ae133d3d3d7792b26ab85f4297 (diff) |
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: Andy Grover <andy.grover@oracle.com>
-rw-r--r-- | net/rds/message.c | 2 | ||||
-rw-r--r-- | net/rds/rdma.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/net/rds/message.c b/net/rds/message.c index 4352ce79b376..7d678e217820 100644 --- a/net/rds/message.c +++ b/net/rds/message.c | |||
@@ -249,7 +249,7 @@ struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents) | |||
249 | WARN_ON(rm->m_used_sgs + nents > rm->m_total_sgs); | 249 | WARN_ON(rm->m_used_sgs + nents > rm->m_total_sgs); |
250 | 250 | ||
251 | sg_ret = &sg_first[rm->m_used_sgs]; | 251 | sg_ret = &sg_first[rm->m_used_sgs]; |
252 | 252 | sg_init_table(sg_ret, nents); | |
253 | rm->m_used_sgs += nents; | 253 | rm->m_used_sgs += nents; |
254 | 254 | ||
255 | return sg_ret; | 255 | return sg_ret; |
diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 7ff3379bab14..4fda33045598 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c | |||
@@ -534,14 +534,13 @@ static int rds_rdma_prepare(struct rds_message *rm, | |||
534 | goto out; | 534 | goto out; |
535 | } | 535 | } |
536 | 536 | ||
537 | op->r_sg = rds_message_alloc_sgs(rm, nr_pages); | ||
538 | op->r_write = !!(args->flags & RDS_RDMA_READWRITE); | 537 | op->r_write = !!(args->flags & RDS_RDMA_READWRITE); |
539 | op->r_fence = !!(args->flags & RDS_RDMA_FENCE); | 538 | op->r_fence = !!(args->flags & RDS_RDMA_FENCE); |
540 | op->r_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME); | 539 | op->r_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME); |
541 | op->r_active = 1; | 540 | op->r_active = 1; |
542 | op->r_recverr = rs->rs_recverr; | 541 | op->r_recverr = rs->rs_recverr; |
543 | WARN_ON(!nr_pages); | 542 | WARN_ON(!nr_pages); |
544 | sg_init_table(op->r_sg, nr_pages); | 543 | op->r_sg = rds_message_alloc_sgs(rm, nr_pages); |
545 | 544 | ||
546 | if (op->r_notify || op->r_recverr) { | 545 | if (op->r_notify || op->r_recverr) { |
547 | /* We allocate an uninitialized notifier here, because | 546 | /* We allocate an uninitialized notifier here, because |