Skip to content

Commit

Permalink
SUNRPC: add EXPORT_SYMBOL_GPL for generic transport functions
Browse files Browse the repository at this point in the history
SUNRPC: add EXPORT_SYMBOL_GPL for generic transport functions

As a preface to allowing arbitrary transport modules to be loaded
dynamically, add EXPORT_SYMBOL_GPL for all generic transport functions
that a transport implementation might want to use.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Tom Talpey <tmt@netapp.com>

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
\"Talpey, Thomas\ authored and Trond Myklebust committed Oct 9, 2007
1 parent 4f22ccc commit 1244480
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/sunrpc/rpcb_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ void rpcb_getport_async(struct rpc_task *task)
bailout_nowake:
task->tk_status = status;
}
EXPORT_SYMBOL_GPL(rpcb_getport_async);

/*
* Rpcbind child task calls this callback via tk_exit.
Expand Down
2 changes: 2 additions & 0 deletions net/sunrpc/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ void *rpc_malloc(struct rpc_task *task, size_t size)
task->tk_pid, size, buf);
return &buf->data;
}
EXPORT_SYMBOL_GPL(rpc_malloc);

/**
* rpc_free - free buffer allocated via rpc_malloc
Expand All @@ -802,6 +803,7 @@ void rpc_free(void *buffer)
else
kfree(buf);
}
EXPORT_SYMBOL_GPL(rpc_free);

/*
* Creation and deletion of RPC task structures
Expand Down
3 changes: 3 additions & 0 deletions net/sunrpc/socklib.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ size_t xdr_skb_read_bits(struct xdr_skb_reader *desc, void *to, size_t len)
desc->offset += len;
return len;
}
EXPORT_SYMBOL_GPL(xdr_skb_read_bits);

/**
* xdr_skb_read_and_csum_bits - copy and checksum from skb to buffer
Expand Down Expand Up @@ -137,6 +138,7 @@ ssize_t xdr_partial_copy_from_skb(struct xdr_buf *xdr, unsigned int base, struct
out:
return copied;
}
EXPORT_SYMBOL_GPL(xdr_partial_copy_from_skb);

/**
* csum_partial_copy_to_xdr - checksum and copy data
Expand Down Expand Up @@ -179,3 +181,4 @@ int csum_partial_copy_to_xdr(struct xdr_buf *xdr, struct sk_buff *skb)
return -1;
return 0;
}
EXPORT_SYMBOL_GPL(csum_partial_copy_to_xdr);
4 changes: 4 additions & 0 deletions net/sunrpc/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <linux/types.h>
#include <linux/unistd.h>
#include <linux/module.h>

#include <linux/sunrpc/clnt.h>

Expand All @@ -40,6 +41,7 @@ rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo)
rt->ntimeouts[i] = 0;
}
}
EXPORT_SYMBOL_GPL(rpc_init_rtt);

/*
* NB: When computing the smoothed RTT and standard deviation,
Expand Down Expand Up @@ -75,6 +77,7 @@ rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m)
if (*sdrtt < RPC_RTO_MIN)
*sdrtt = RPC_RTO_MIN;
}
EXPORT_SYMBOL_GPL(rpc_update_rtt);

/*
* Estimate rto for an nfs rpc sent via. an unreliable datagram.
Expand Down Expand Up @@ -103,3 +106,4 @@ rpc_calc_rto(struct rpc_rtt *rt, unsigned timer)

return res;
}
EXPORT_SYMBOL_GPL(rpc_calc_rto);
15 changes: 15 additions & 0 deletions net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ int xprt_reserve_xprt(struct rpc_task *task)
rpc_sleep_on(&xprt->sending, task, NULL, NULL);
return 0;
}
EXPORT_SYMBOL_GPL(xprt_reserve_xprt);

static void xprt_clear_locked(struct rpc_xprt *xprt)
{
Expand Down Expand Up @@ -167,6 +168,7 @@ int xprt_reserve_xprt_cong(struct rpc_task *task)
rpc_sleep_on(&xprt->sending, task, NULL, NULL);
return 0;
}
EXPORT_SYMBOL_GPL(xprt_reserve_xprt_cong);

static inline int xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
{
Expand Down Expand Up @@ -246,6 +248,7 @@ void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task)
__xprt_lock_write_next(xprt);
}
}
EXPORT_SYMBOL_GPL(xprt_release_xprt);

/**
* xprt_release_xprt_cong - allow other requests to use a transport
Expand All @@ -262,6 +265,7 @@ void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task)
__xprt_lock_write_next_cong(xprt);
}
}
EXPORT_SYMBOL_GPL(xprt_release_xprt_cong);

static inline void xprt_release_write(struct rpc_xprt *xprt, struct rpc_task *task)
{
Expand Down Expand Up @@ -314,6 +318,7 @@ void xprt_release_rqst_cong(struct rpc_task *task)
{
__xprt_put_cong(task->tk_xprt, task->tk_rqstp);
}
EXPORT_SYMBOL_GPL(xprt_release_rqst_cong);

/**
* xprt_adjust_cwnd - adjust transport congestion window
Expand Down Expand Up @@ -345,6 +350,7 @@ void xprt_adjust_cwnd(struct rpc_task *task, int result)
xprt->cwnd = cwnd;
__xprt_put_cong(xprt, req);
}
EXPORT_SYMBOL_GPL(xprt_adjust_cwnd);

/**
* xprt_wake_pending_tasks - wake all tasks on a transport's pending queue
Expand All @@ -359,6 +365,7 @@ void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status)
else
rpc_wake_up(&xprt->pending);
}
EXPORT_SYMBOL_GPL(xprt_wake_pending_tasks);

/**
* xprt_wait_for_buffer_space - wait for transport output buffer to clear
Expand All @@ -373,6 +380,7 @@ void xprt_wait_for_buffer_space(struct rpc_task *task)
task->tk_timeout = req->rq_timeout;
rpc_sleep_on(&xprt->pending, task, NULL, NULL);
}
EXPORT_SYMBOL_GPL(xprt_wait_for_buffer_space);

/**
* xprt_write_space - wake the task waiting for transport output buffer space
Expand All @@ -393,6 +401,7 @@ void xprt_write_space(struct rpc_xprt *xprt)
}
spin_unlock_bh(&xprt->transport_lock);
}
EXPORT_SYMBOL_GPL(xprt_write_space);

/**
* xprt_set_retrans_timeout_def - set a request's retransmit timeout
Expand All @@ -406,6 +415,7 @@ void xprt_set_retrans_timeout_def(struct rpc_task *task)
{
task->tk_timeout = task->tk_rqstp->rq_timeout;
}
EXPORT_SYMBOL_GPL(xprt_set_retrans_timeout_def);

/*
* xprt_set_retrans_timeout_rtt - set a request's retransmit timeout
Expand All @@ -425,6 +435,7 @@ void xprt_set_retrans_timeout_rtt(struct rpc_task *task)
if (task->tk_timeout > max_timeout || task->tk_timeout == 0)
task->tk_timeout = max_timeout;
}
EXPORT_SYMBOL_GPL(xprt_set_retrans_timeout_rtt);

static void xprt_reset_majortimeo(struct rpc_rqst *req)
{
Expand Down Expand Up @@ -500,6 +511,7 @@ void xprt_disconnect(struct rpc_xprt *xprt)
xprt_wake_pending_tasks(xprt, -ENOTCONN);
spin_unlock_bh(&xprt->transport_lock);
}
EXPORT_SYMBOL_GPL(xprt_disconnect);

static void
xprt_init_autodisconnect(unsigned long data)
Expand Down Expand Up @@ -610,6 +622,7 @@ struct rpc_rqst *xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid)
xprt->stat.bad_xids++;
return NULL;
}
EXPORT_SYMBOL_GPL(xprt_lookup_rqst);

/**
* xprt_update_rtt - update an RPC client's RTT state after receiving a reply
Expand All @@ -629,6 +642,7 @@ void xprt_update_rtt(struct rpc_task *task)
rpc_set_timeo(rtt, timer, req->rq_ntrans - 1);
}
}
EXPORT_SYMBOL_GPL(xprt_update_rtt);

/**
* xprt_complete_rqst - called when reply processing is complete
Expand All @@ -653,6 +667,7 @@ void xprt_complete_rqst(struct rpc_task *task, int copied)
req->rq_received = req->rq_private_buf.len = copied;
rpc_wake_up_task(task);
}
EXPORT_SYMBOL_GPL(xprt_complete_rqst);

static void xprt_timer(struct rpc_task *task)
{
Expand Down

0 comments on commit 1244480

Please sign in to comment.