diff options
author | Andy Grover <andy.grover@oracle.com> | 2009-04-01 04:20:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-02 03:52:22 -0400 |
commit | 745cbccac3fe8cead529a1b3358e1e86a1505bfa (patch) | |
tree | 6c865b19881dbdd64556cc1827f6966d8a646a38 /net/rds/ib.h | |
parent | f1cffcbfcc53b825da7d1d26244aabd8dccb24aa (diff) |
RDS: Rewrite connection cleanup, fixing oops on rmmod
This fixes a bug where a connection was unexpectedly
not on *any* list while being destroyed. It also
cleans up some code duplication and regularizes some
function names.
* Grab appropriate lock in conn_free() and explain in comment
* Ensure via locking that a conn is never not on either
a dev's list or the nodev list
* Add rds_xx_remove_conn() to match rds_xx_add_conn()
* Make rds_xx_add_conn() return void
* Rename remove_{,nodev_}conns() to
destroy_{,nodev_}conns() and unify their implementation
in a helper function
* Document lock ordering as nodev conn_lock before
dev_conn_lock
Reported-by: Yosef Etigin <yosefe@voltaire.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/ib.h')
-rw-r--r-- | net/rds/ib.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/net/rds/ib.h b/net/rds/ib.h index 8be563a1363a..c08ffffb3164 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h | |||
@@ -267,9 +267,17 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn, | |||
267 | 267 | ||
268 | /* ib_rdma.c */ | 268 | /* ib_rdma.c */ |
269 | int rds_ib_update_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr); | 269 | int rds_ib_update_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr); |
270 | int rds_ib_add_conn(struct rds_ib_device *rds_ibdev, struct rds_connection *conn); | 270 | void rds_ib_add_conn(struct rds_ib_device *rds_ibdev, struct rds_connection *conn); |
271 | void rds_ib_remove_nodev_conns(void); | 271 | void rds_ib_remove_conn(struct rds_ib_device *rds_ibdev, struct rds_connection *conn); |
272 | void rds_ib_remove_conns(struct rds_ib_device *rds_ibdev); | 272 | void __rds_ib_destroy_conns(struct list_head *list, spinlock_t *list_lock); |
273 | static inline void rds_ib_destroy_nodev_conns(void) | ||
274 | { | ||
275 | __rds_ib_destroy_conns(&ib_nodev_conns, &ib_nodev_conns_lock); | ||
276 | } | ||
277 | static inline void rds_ib_destroy_conns(struct rds_ib_device *rds_ibdev) | ||
278 | { | ||
279 | __rds_ib_destroy_conns(&rds_ibdev->conn_list, &rds_ibdev->spinlock); | ||
280 | } | ||
273 | struct rds_ib_mr_pool *rds_ib_create_mr_pool(struct rds_ib_device *); | 281 | struct rds_ib_mr_pool *rds_ib_create_mr_pool(struct rds_ib_device *); |
274 | void rds_ib_get_mr_info(struct rds_ib_device *rds_ibdev, struct rds_info_rdma_connection *iinfo); | 282 | void rds_ib_get_mr_info(struct rds_ib_device *rds_ibdev, struct rds_info_rdma_connection *iinfo); |
275 | void rds_ib_destroy_mr_pool(struct rds_ib_mr_pool *); | 283 | void rds_ib_destroy_mr_pool(struct rds_ib_mr_pool *); |