aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-04-23 19:32:33 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-04-28 13:54:28 -0400
commitbfba9ab4c64f0e5c33930711e6c073c285e01fcf (patch)
tree1342b7e7d682fd468f0eb271faf2c15afdc8bd50
parent335c54bdc4d3bacdbd619ec95cd0b352435bd37f (diff)
SUNRPC: pass buffer size to svc_addsock()
Adjust the synopsis of svc_addsock() to pass in the size of the output buffer. Add a documenting comment. This is a cosmetic change for now. A subsequent patch will make sure the buffer length is passed to one_sock_name(), where the length will actually be useful. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
-rw-r--r--fs/nfsd/nfsctl.c2
-rw-r--r--include/linux/sunrpc/svcsock.h3
-rw-r--r--net/sunrpc/svcsock.c16
3 files changed, 16 insertions, 5 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 6a1cd908e6bc..1f1c2159b802 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -943,7 +943,7 @@ static ssize_t __write_ports_addfd(char *buf)
943 if (err != 0) 943 if (err != 0)
944 goto out; 944 goto out;
945 945
946 err = svc_addsock(nfsd_serv, fd, buf); 946 err = svc_addsock(nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT);
947 if (err < 0) 947 if (err < 0)
948 lockd_down(); 948 lockd_down();
949 949
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 483e10380aae..e23241c53f42 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -39,7 +39,8 @@ int svc_send(struct svc_rqst *);
39void svc_drop(struct svc_rqst *); 39void svc_drop(struct svc_rqst *);
40void svc_sock_update_bufs(struct svc_serv *serv); 40void svc_sock_update_bufs(struct svc_serv *serv);
41int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); 41int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose);
42int svc_addsock(struct svc_serv *serv, int fd, char *name_return); 42int svc_addsock(struct svc_serv *serv, const int fd,
43 char *name_return, const size_t len);
43void svc_init_xprt_sock(void); 44void svc_init_xprt_sock(void);
44void svc_cleanup_xprt_sock(void); 45void svc_cleanup_xprt_sock(void);
45 46
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 8b0832834135..6bec1e25b542 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1128,9 +1128,19 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv,
1128 return svsk; 1128 return svsk;
1129} 1129}
1130 1130
1131int svc_addsock(struct svc_serv *serv, 1131/**
1132 int fd, 1132 * svc_addsock - add a listener socket to an RPC service
1133 char *name_return) 1133 * @serv: pointer to RPC service to which to add a new listener
1134 * @fd: file descriptor of the new listener
1135 * @name_return: pointer to buffer to fill in with name of listener
1136 * @len: size of the buffer
1137 *
1138 * Fills in socket name and returns positive length of name if successful.
1139 * Name is terminated with '\n'. On error, returns a negative errno
1140 * value.
1141 */
1142int svc_addsock(struct svc_serv *serv, const int fd, char *name_return,
1143 const size_t len)
1134{ 1144{
1135 int err = 0; 1145 int err = 0;
1136 struct socket *so = sockfd_lookup(fd, &err); 1146 struct socket *so = sockfd_lookup(fd, &err);