diff options
author | Andy Grover <andy.grover@oracle.com> | 2010-03-01 17:11:53 -0500 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:11:58 -0400 |
commit | f8b3aaf2ba8ca9e27b47f8bfdff07c8b968f2c05 (patch) | |
tree | 42de574167e590ca2e413314b6486df916cd1f31 /net/rds/send.c | |
parent | d0ab25a83c4a08cd98b73a37d3f4c069f7b4f50b (diff) |
RDS: Remove struct rds_rdma_op
A big changeset, but it's all pretty dumb.
struct rds_rdma_op was already embedded in struct rm_rdma_op.
Remove rds_rdma_op and put its members in rm_rdma_op. Rename
members with "op_" prefix instead of "r_", for consistency.
Of course this breaks a lot, so fixup the code accordingly.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/send.c')
-rw-r--r-- | net/rds/send.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/net/rds/send.c b/net/rds/send.c index 42fb934293be..08df279ced2a 100644 --- a/net/rds/send.c +++ b/net/rds/send.c | |||
@@ -237,7 +237,7 @@ int rds_send_xmit(struct rds_connection *conn) | |||
237 | * connection. | 237 | * connection. |
238 | * Therefore, we never retransmit messages with RDMA ops. | 238 | * Therefore, we never retransmit messages with RDMA ops. |
239 | */ | 239 | */ |
240 | if (rm->rdma.m_rdma_op.r_active && | 240 | if (rm->rdma.op_active && |
241 | test_bit(RDS_MSG_RETRANSMITTED, &rm->m_flags)) { | 241 | test_bit(RDS_MSG_RETRANSMITTED, &rm->m_flags)) { |
242 | spin_lock_irqsave(&conn->c_lock, flags); | 242 | spin_lock_irqsave(&conn->c_lock, flags); |
243 | if (test_and_clear_bit(RDS_MSG_ON_CONN, &rm->m_flags)) | 243 | if (test_and_clear_bit(RDS_MSG_ON_CONN, &rm->m_flags)) |
@@ -280,8 +280,8 @@ int rds_send_xmit(struct rds_connection *conn) | |||
280 | * keep this simple and require that the transport either | 280 | * keep this simple and require that the transport either |
281 | * send the whole rdma or none of it. | 281 | * send the whole rdma or none of it. |
282 | */ | 282 | */ |
283 | if (rm->rdma.m_rdma_op.r_active && !conn->c_xmit_rdma_sent) { | 283 | if (rm->rdma.op_active && !conn->c_xmit_rdma_sent) { |
284 | ret = conn->c_trans->xmit_rdma(conn, &rm->rdma.m_rdma_op); | 284 | ret = conn->c_trans->xmit_rdma(conn, &rm->rdma); |
285 | if (ret) | 285 | if (ret) |
286 | break; | 286 | break; |
287 | conn->c_xmit_rdma_sent = 1; | 287 | conn->c_xmit_rdma_sent = 1; |
@@ -430,16 +430,16 @@ int rds_send_acked_before(struct rds_connection *conn, u64 seq) | |||
430 | void rds_rdma_send_complete(struct rds_message *rm, int status) | 430 | void rds_rdma_send_complete(struct rds_message *rm, int status) |
431 | { | 431 | { |
432 | struct rds_sock *rs = NULL; | 432 | struct rds_sock *rs = NULL; |
433 | struct rds_rdma_op *ro; | 433 | struct rm_rdma_op *ro; |
434 | struct rds_notifier *notifier; | 434 | struct rds_notifier *notifier; |
435 | unsigned long flags; | 435 | unsigned long flags; |
436 | 436 | ||
437 | spin_lock_irqsave(&rm->m_rs_lock, flags); | 437 | spin_lock_irqsave(&rm->m_rs_lock, flags); |
438 | 438 | ||
439 | ro = &rm->rdma.m_rdma_op; | 439 | ro = &rm->rdma; |
440 | if (test_bit(RDS_MSG_ON_SOCK, &rm->m_flags) && | 440 | if (test_bit(RDS_MSG_ON_SOCK, &rm->m_flags) && |
441 | ro->r_active && ro->r_notify && ro->r_notifier) { | 441 | ro->op_active && ro->op_notify && ro->op_notifier) { |
442 | notifier = ro->r_notifier; | 442 | notifier = ro->op_notifier; |
443 | rs = rm->m_rs; | 443 | rs = rm->m_rs; |
444 | sock_hold(rds_rs_to_sk(rs)); | 444 | sock_hold(rds_rs_to_sk(rs)); |
445 | 445 | ||
@@ -448,7 +448,7 @@ void rds_rdma_send_complete(struct rds_message *rm, int status) | |||
448 | list_add_tail(¬ifier->n_list, &rs->rs_notify_queue); | 448 | list_add_tail(¬ifier->n_list, &rs->rs_notify_queue); |
449 | spin_unlock(&rs->rs_lock); | 449 | spin_unlock(&rs->rs_lock); |
450 | 450 | ||
451 | ro->r_notifier = NULL; | 451 | ro->op_notifier = NULL; |
452 | } | 452 | } |
453 | 453 | ||
454 | spin_unlock_irqrestore(&rm->m_rs_lock, flags); | 454 | spin_unlock_irqrestore(&rm->m_rs_lock, flags); |
@@ -503,13 +503,13 @@ EXPORT_SYMBOL_GPL(rds_atomic_send_complete); | |||
503 | static inline void | 503 | static inline void |
504 | __rds_rdma_send_complete(struct rds_sock *rs, struct rds_message *rm, int status) | 504 | __rds_rdma_send_complete(struct rds_sock *rs, struct rds_message *rm, int status) |
505 | { | 505 | { |
506 | struct rds_rdma_op *ro; | 506 | struct rm_rdma_op *ro; |
507 | 507 | ||
508 | ro = &rm->rdma.m_rdma_op; | 508 | ro = &rm->rdma; |
509 | if (ro->r_active && ro->r_notify && ro->r_notifier) { | 509 | if (ro->op_active && ro->op_notify && ro->op_notifier) { |
510 | ro->r_notifier->n_status = status; | 510 | ro->op_notifier->n_status = status; |
511 | list_add_tail(&ro->r_notifier->n_list, &rs->rs_notify_queue); | 511 | list_add_tail(&ro->op_notifier->n_list, &rs->rs_notify_queue); |
512 | ro->r_notifier = NULL; | 512 | ro->op_notifier = NULL; |
513 | } | 513 | } |
514 | 514 | ||
515 | /* No need to wake the app - caller does this */ | 515 | /* No need to wake the app - caller does this */ |
@@ -521,7 +521,7 @@ __rds_rdma_send_complete(struct rds_sock *rs, struct rds_message *rm, int status | |||
521 | * So speed is not an issue here. | 521 | * So speed is not an issue here. |
522 | */ | 522 | */ |
523 | struct rds_message *rds_send_get_message(struct rds_connection *conn, | 523 | struct rds_message *rds_send_get_message(struct rds_connection *conn, |
524 | struct rds_rdma_op *op) | 524 | struct rm_rdma_op *op) |
525 | { | 525 | { |
526 | struct rds_message *rm, *tmp, *found = NULL; | 526 | struct rds_message *rm, *tmp, *found = NULL; |
527 | unsigned long flags; | 527 | unsigned long flags; |
@@ -529,7 +529,7 @@ struct rds_message *rds_send_get_message(struct rds_connection *conn, | |||
529 | spin_lock_irqsave(&conn->c_lock, flags); | 529 | spin_lock_irqsave(&conn->c_lock, flags); |
530 | 530 | ||
531 | list_for_each_entry_safe(rm, tmp, &conn->c_retrans, m_conn_item) { | 531 | list_for_each_entry_safe(rm, tmp, &conn->c_retrans, m_conn_item) { |
532 | if (&rm->rdma.m_rdma_op == op) { | 532 | if (&rm->rdma == op) { |
533 | atomic_inc(&rm->m_refcount); | 533 | atomic_inc(&rm->m_refcount); |
534 | found = rm; | 534 | found = rm; |
535 | goto out; | 535 | goto out; |
@@ -537,7 +537,7 @@ struct rds_message *rds_send_get_message(struct rds_connection *conn, | |||
537 | } | 537 | } |
538 | 538 | ||
539 | list_for_each_entry_safe(rm, tmp, &conn->c_send_queue, m_conn_item) { | 539 | list_for_each_entry_safe(rm, tmp, &conn->c_send_queue, m_conn_item) { |
540 | if (&rm->rdma.m_rdma_op == op) { | 540 | if (&rm->rdma == op) { |
541 | atomic_inc(&rm->m_refcount); | 541 | atomic_inc(&rm->m_refcount); |
542 | found = rm; | 542 | found = rm; |
543 | break; | 543 | break; |
@@ -597,20 +597,20 @@ void rds_send_remove_from_sock(struct list_head *messages, int status) | |||
597 | spin_lock(&rs->rs_lock); | 597 | spin_lock(&rs->rs_lock); |
598 | 598 | ||
599 | if (test_and_clear_bit(RDS_MSG_ON_SOCK, &rm->m_flags)) { | 599 | if (test_and_clear_bit(RDS_MSG_ON_SOCK, &rm->m_flags)) { |
600 | struct rds_rdma_op *ro = &rm->rdma.m_rdma_op; | 600 | struct rm_rdma_op *ro = &rm->rdma; |
601 | struct rds_notifier *notifier; | 601 | struct rds_notifier *notifier; |
602 | 602 | ||
603 | list_del_init(&rm->m_sock_item); | 603 | list_del_init(&rm->m_sock_item); |
604 | rds_send_sndbuf_remove(rs, rm); | 604 | rds_send_sndbuf_remove(rs, rm); |
605 | 605 | ||
606 | if (ro->r_active && ro->r_notifier && | 606 | if (ro->op_active && ro->op_notifier && |
607 | (ro->r_notify || (ro->r_recverr && status))) { | 607 | (ro->op_notify || (ro->op_recverr && status))) { |
608 | notifier = ro->r_notifier; | 608 | notifier = ro->op_notifier; |
609 | list_add_tail(¬ifier->n_list, | 609 | list_add_tail(¬ifier->n_list, |
610 | &rs->rs_notify_queue); | 610 | &rs->rs_notify_queue); |
611 | if (!notifier->n_status) | 611 | if (!notifier->n_status) |
612 | notifier->n_status = status; | 612 | notifier->n_status = status; |
613 | rm->rdma.m_rdma_op.r_notifier = NULL; | 613 | rm->rdma.op_notifier = NULL; |
614 | } | 614 | } |
615 | was_on_sock = 1; | 615 | was_on_sock = 1; |
616 | rm->m_rs = NULL; | 616 | rm->m_rs = NULL; |
@@ -987,11 +987,11 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, | |||
987 | if (ret) | 987 | if (ret) |
988 | goto out; | 988 | goto out; |
989 | 989 | ||
990 | if ((rm->m_rdma_cookie || rm->rdma.m_rdma_op.r_active) && | 990 | if ((rm->m_rdma_cookie || rm->rdma.op_active) && |
991 | !conn->c_trans->xmit_rdma) { | 991 | !conn->c_trans->xmit_rdma) { |
992 | if (printk_ratelimit()) | 992 | if (printk_ratelimit()) |
993 | printk(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n", | 993 | printk(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n", |
994 | &rm->rdma.m_rdma_op, conn->c_trans->xmit_rdma); | 994 | &rm->rdma, conn->c_trans->xmit_rdma); |
995 | ret = -EOPNOTSUPP; | 995 | ret = -EOPNOTSUPP; |
996 | goto out; | 996 | goto out; |
997 | } | 997 | } |