[openib-general] [PATCH 3 of 4] RFC: revert module ref counting patches
Michael S. Tsirkin
mst at mellanox.co.il
Mon Apr 10 04:18:02 PDT 2006
Revert module ref counting patch for addr.
Index: linux-2.6.16/drivers/infiniband/core/addr.c
===================================================================
--- linux-2.6.16/drivers/infiniband/core/addr.c (revision 6323)
+++ linux-2.6.16/drivers/infiniband/core/addr.c (revision 6322)
@@ -73,7 +73,6 @@
struct sockaddr src_addr;
struct sockaddr dst_addr;
struct rdma_dev_addr *addr;
- struct module *owner;
void *context;
void (*callback)(int status, struct sockaddr *src_addr,
struct rdma_dev_addr *addr, void *context);
@@ -253,10 +252,8 @@
list_for_each_entry_safe(req, temp_req, &done_list, list) {
list_del(&req->list);
- BUG_ON(!try_module_get(req->owner));
req->callback(req->status, &req->src_addr, req->addr,
req->context);
- module_put(req->owner);
kfree(req);
}
}
@@ -292,12 +289,11 @@
return ret;
}
-int __rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
- struct rdma_dev_addr *addr, int timeout_ms,
- void (*callback)(int status, struct sockaddr *src_addr,
- struct rdma_dev_addr *addr,
- void *context),
- void *context, struct module *owner)
+int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
+ struct rdma_dev_addr *addr, int timeout_ms,
+ void (*callback)(int status, struct sockaddr *src_addr,
+ struct rdma_dev_addr *addr, void *context),
+ void *context)
{
struct sockaddr_in *src_in, *dst_in;
struct addr_req *req;
@@ -314,7 +310,6 @@
req->addr = addr;
req->callback = callback;
req->context = context;
- req->owner = owner;
src_in = (struct sockaddr_in *) &req->src_addr;
dst_in = (struct sockaddr_in *) &req->dst_addr;
@@ -340,7 +335,7 @@
}
return ret;
}
-EXPORT_SYMBOL(__rdma_resolve_ip);
+EXPORT_SYMBOL(rdma_resolve_ip);
void rdma_addr_cancel(struct rdma_dev_addr *addr)
{
Index: linux-2.6.16/drivers/infiniband/include/rdma/ib_addr.h
===================================================================
--- linux-2.6.16/drivers/infiniband/include/rdma/ib_addr.h (revision 6323)
+++ linux-2.6.16/drivers/infiniband/include/rdma/ib_addr.h (revision 6322)
@@ -43,13 +43,6 @@
enum rdma_node_type dev_type;
};
-int __rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
- struct rdma_dev_addr *addr, int timeout_ms,
- void (*callback)(int status, struct sockaddr *src_addr,
- struct rdma_dev_addr *addr,
- void *context),
- void *context, struct module *owner);
-
/**
* rdma_translate_ip - Translate a local IP address to an RDMA hardware
* address.
@@ -71,16 +64,11 @@
* or been canceled. A status of 0 indicates success.
* @context: User-specified context associated with the call.
*/
-static inline int
-rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
- struct rdma_dev_addr *addr, int timeout_ms,
- void (*callback)(int status, struct sockaddr *src_addr,
- struct rdma_dev_addr *addr, void *context),
- void *context)
-{
- return __rdma_resolve_ip(src_addr, dst_addr, addr, timeout_ms,
- callback, context, THIS_MODULE);
-}
+int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
+ struct rdma_dev_addr *addr, int timeout_ms,
+ void (*callback)(int status, struct sockaddr *src_addr,
+ struct rdma_dev_addr *addr, void *context),
+ void *context);
void rdma_addr_cancel(struct rdma_dev_addr *addr);
--
MST
More information about the general
mailing list