Skip to content

Commit

Permalink
RDS: Export symbols from core RDS
Browse files Browse the repository at this point in the history
Now that rdma and tcp transports will be modularized,
we need to export a number of functions so they can call them.

Signed-off-by: Andy Grover <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Andy Grover authored and davem330 committed Aug 24, 2009
1 parent 7004108 commit 616b757
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/rds/cong.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ void rds_cong_map_updated(struct rds_cong_map *map, uint64_t portmask)
read_unlock_irqrestore(&rds_cong_monitor_lock, flags);
}
}
EXPORT_SYMBOL_GPL(rds_cong_map_updated);

int rds_cong_updated_since(unsigned long *recent)
{
Expand Down
5 changes: 5 additions & 0 deletions net/rds/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,14 @@ struct rds_connection *rds_conn_create(__be32 laddr, __be32 faddr,
{
return __rds_conn_create(laddr, faddr, trans, gfp, 0);
}
EXPORT_SYMBOL_GPL(rds_conn_create);

struct rds_connection *rds_conn_create_outgoing(__be32 laddr, __be32 faddr,
struct rds_transport *trans, gfp_t gfp)
{
return __rds_conn_create(laddr, faddr, trans, gfp, 1);
}
EXPORT_SYMBOL_GPL(rds_conn_create_outgoing);

void rds_conn_destroy(struct rds_connection *conn)
{
Expand Down Expand Up @@ -303,6 +305,7 @@ void rds_conn_destroy(struct rds_connection *conn)

rds_conn_count--;
}
EXPORT_SYMBOL_GPL(rds_conn_destroy);

static void rds_conn_message_info(struct socket *sock, unsigned int len,
struct rds_info_iterator *iter,
Expand Down Expand Up @@ -406,6 +409,7 @@ void rds_for_each_conn_info(struct socket *sock, unsigned int len,

spin_unlock_irqrestore(&rds_conn_lock, flags);
}
EXPORT_SYMBOL_GPL(rds_for_each_conn_info);

static int rds_conn_info_visitor(struct rds_connection *conn,
void *buffer)
Expand Down Expand Up @@ -481,6 +485,7 @@ void rds_conn_drop(struct rds_connection *conn)
atomic_set(&conn->c_state, RDS_CONN_ERROR);
queue_work(rds_wq, &conn->c_down_w);
}
EXPORT_SYMBOL_GPL(rds_conn_drop);

/*
* An error occurred on the connection
Expand Down
3 changes: 3 additions & 0 deletions net/rds/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void rds_info_register_func(int optname, rds_info_func func)
rds_info_funcs[offset] = func;
spin_unlock(&rds_info_lock);
}
EXPORT_SYMBOL_GPL(rds_info_register_func);

void rds_info_deregister_func(int optname, rds_info_func func)
{
Expand All @@ -91,6 +92,7 @@ void rds_info_deregister_func(int optname, rds_info_func func)
rds_info_funcs[offset] = NULL;
spin_unlock(&rds_info_lock);
}
EXPORT_SYMBOL_GPL(rds_info_deregister_func);

/*
* Typically we hold an atomic kmap across multiple rds_info_copy() calls
Expand Down Expand Up @@ -137,6 +139,7 @@ void rds_info_copy(struct rds_info_iterator *iter, void *data,
}
}
}
EXPORT_SYMBOL_GPL(rds_info_copy);

/*
* @optval points to the userspace buffer that the information snapshot
Expand Down
6 changes: 6 additions & 0 deletions net/rds/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void rds_message_addref(struct rds_message *rm)
rdsdebug("addref rm %p ref %d\n", rm, atomic_read(&rm->m_refcount));
atomic_inc(&rm->m_refcount);
}
EXPORT_SYMBOL_GPL(rds_message_addref);

/*
* This relies on dma_map_sg() not touching sg[].page during merging.
Expand Down Expand Up @@ -92,6 +93,7 @@ void rds_message_put(struct rds_message *rm)
kfree(rm);
}
}
EXPORT_SYMBOL_GPL(rds_message_put);

void rds_message_inc_free(struct rds_incoming *inc)
{
Expand All @@ -108,6 +110,7 @@ void rds_message_populate_header(struct rds_header *hdr, __be16 sport,
hdr->h_sequence = cpu_to_be64(seq);
hdr->h_exthdr[0] = RDS_EXTHDR_NONE;
}
EXPORT_SYMBOL_GPL(rds_message_populate_header);

int rds_message_add_extension(struct rds_header *hdr,
unsigned int type, const void *data, unsigned int len)
Expand All @@ -133,6 +136,7 @@ int rds_message_add_extension(struct rds_header *hdr,
dst[len] = RDS_EXTHDR_NONE;
return 1;
}
EXPORT_SYMBOL_GPL(rds_message_add_extension);

/*
* If a message has extension headers, retrieve them here.
Expand Down Expand Up @@ -208,6 +212,7 @@ int rds_message_add_rdma_dest_extension(struct rds_header *hdr, u32 r_key, u32 o
ext_hdr.h_rdma_offset = cpu_to_be32(offset);
return rds_message_add_extension(hdr, RDS_EXTHDR_RDMA_DEST, &ext_hdr, sizeof(ext_hdr));
}
EXPORT_SYMBOL_GPL(rds_message_add_rdma_dest_extension);

struct rds_message *rds_message_alloc(unsigned int nents, gfp_t gfp)
{
Expand Down Expand Up @@ -399,4 +404,5 @@ void rds_message_unmapped(struct rds_message *rm)
if (waitqueue_active(&rds_message_flush_waitq))
wake_up(&rds_message_flush_waitq);
}
EXPORT_SYMBOL_GPL(rds_message_unmapped);

1 change: 1 addition & 0 deletions net/rds/page.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ int rds_page_copy_user(struct page *page, unsigned long offset,

return 0;
}
EXPORT_SYMBOL_GPL(rds_page_copy_user);

/*
* Message allocation uses this to build up regions of a message.
Expand Down
4 changes: 4 additions & 0 deletions net/rds/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn,
inc->i_saddr = saddr;
inc->i_rdma_cookie = 0;
}
EXPORT_SYMBOL_GPL(rds_inc_init);

void rds_inc_addref(struct rds_incoming *inc)
{
rdsdebug("addref inc %p ref %d\n", inc, atomic_read(&inc->i_refcount));
atomic_inc(&inc->i_refcount);
}
EXPORT_SYMBOL_GPL(rds_inc_addref);

void rds_inc_put(struct rds_incoming *inc)
{
Expand All @@ -62,6 +64,7 @@ void rds_inc_put(struct rds_incoming *inc)
inc->i_conn->c_trans->inc_free(inc);
}
}
EXPORT_SYMBOL_GPL(rds_inc_put);

static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk,
struct rds_cong_map *map,
Expand Down Expand Up @@ -237,6 +240,7 @@ void rds_recv_incoming(struct rds_connection *conn, __be32 saddr, __be32 daddr,
if (rs)
rds_sock_put(rs);
}
EXPORT_SYMBOL_GPL(rds_recv_incoming);

/*
* be very careful here. This is being called as the condition in
Expand Down
3 changes: 3 additions & 0 deletions net/rds/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ void rds_rdma_send_complete(struct rds_message *rm, int status)
sock_put(rds_rs_to_sk(rs));
}
}
EXPORT_SYMBOL_GPL(rds_rdma_send_complete);

/*
* This is the same as rds_rdma_send_complete except we
Expand Down Expand Up @@ -494,6 +495,7 @@ struct rds_message *rds_send_get_message(struct rds_connection *conn,

return found;
}
EXPORT_SYMBOL_GPL(rds_send_get_message);

/*
* This removes messages from the socket's list if they're on it. The list
Expand Down Expand Up @@ -610,6 +612,7 @@ void rds_send_drop_acked(struct rds_connection *conn, u64 ack,
/* now remove the messages from the sock list as needed */
rds_send_remove_from_sock(&list, RDS_RDMA_SUCCESS);
}
EXPORT_SYMBOL_GPL(rds_send_drop_acked);

void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest)
{
Expand Down
2 changes: 2 additions & 0 deletions net/rds/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "rds.h"

DEFINE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats);
EXPORT_PER_CPU_SYMBOL_GPL(rds_stats);

/* :.,$s/unsigned long\>.*\<s_\(.*\);/"\1",/g */

Expand Down Expand Up @@ -90,6 +91,7 @@ void rds_stats_info_copy(struct rds_info_iterator *iter,
rds_info_copy(iter, &ctr, sizeof(ctr));
}
}
EXPORT_SYMBOL_GPL(rds_stats_info_copy);

/*
* This gives global counters across all the transports. The strings
Expand Down
2 changes: 2 additions & 0 deletions net/rds/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
* (TCP, IB/RDMA) to provide the necessary synchronisation.
*/
struct workqueue_struct *rds_wq;
EXPORT_SYMBOL_GPL(rds_wq);

void rds_connect_complete(struct rds_connection *conn)
{
Expand All @@ -89,6 +90,7 @@ void rds_connect_complete(struct rds_connection *conn)
queue_delayed_work(rds_wq, &conn->c_send_w, 0);
queue_delayed_work(rds_wq, &conn->c_recv_w, 0);
}
EXPORT_SYMBOL_GPL(rds_connect_complete);

/*
* This random exponential backoff is relied on to eventually resolve racing
Expand Down
2 changes: 2 additions & 0 deletions net/rds/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ int rds_trans_register(struct rds_transport *trans)

return 0;
}
EXPORT_SYMBOL_GPL(rds_trans_register);

void rds_trans_unregister(struct rds_transport *trans)
{
Expand All @@ -63,6 +64,7 @@ void rds_trans_unregister(struct rds_transport *trans)

up_write(&rds_trans_sem);
}
EXPORT_SYMBOL_GPL(rds_trans_unregister);

struct rds_transport *rds_trans_get_preferred(__be32 addr)
{
Expand Down

0 comments on commit 616b757

Please sign in to comment.