Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82449
b: refs/heads/master
c: 360d873
h: refs/heads/master
i:
  82447: ce6a769
v: v3
  • Loading branch information
Tom Tucker authored and J. Bruce Fields committed Feb 1, 2008
1 parent 6259846 commit d9f8f75
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d8206b97a09e7ff2fbef17d8d1ea008d764eeaa
refs/heads/master: 360d873864c8903a650b227758b49dd50e6ecc9f
1 change: 0 additions & 1 deletion trunk/include/linux/sunrpc/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define RPCDBG_BIND 0x0020
#define RPCDBG_SCHED 0x0040
#define RPCDBG_TRANS 0x0080
#define RPCDBG_SVCSOCK 0x0100
#define RPCDBG_SVCXPRT 0x0100
#define RPCDBG_SVCDSP 0x0200
#define RPCDBG_MISC 0x0400
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/sunrpc/svcsock.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
#define SUNRPC_SVCSOCK_H

#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/svc_xprt.h>

/*
* RPC server socket.
*/
struct svc_sock {
struct svc_xprt sk_xprt;
struct list_head sk_ready; /* list of ready sockets */
struct list_head sk_list; /* list of all sockets */
struct socket * sk_sock; /* berkeley socket layer */
Expand Down Expand Up @@ -78,6 +80,8 @@ int svc_addsock(struct svc_serv *serv,
int fd,
char *name_return,
int *proto);
void svc_init_xprt_sock(void);
void svc_cleanup_xprt_sock(void);

/*
* svc_makesock socket characteristics
Expand Down
4 changes: 3 additions & 1 deletion trunk/net/sunrpc/sunrpc_syms.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ init_sunrpc(void)
#endif
cache_register(&ip_map_cache);
cache_register(&unix_gid_cache);
init_socket_xprt();
svc_init_xprt_sock(); /* svc sock transport */
init_socket_xprt(); /* clnt sock transport */
rpcauth_init_module();
out:
return err;
Expand All @@ -96,6 +97,7 @@ cleanup_sunrpc(void)
{
rpcauth_remove_module();
cleanup_socket_xprt();
svc_cleanup_xprt_sock();
unregister_rpc_pipefs();
rpc_destroy_mempool();
cache_unregister(&ip_map_cache);
Expand Down
32 changes: 31 additions & 1 deletion trunk/net/sunrpc/svcsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
*
*/

#define RPCDBG_FACILITY RPCDBG_SVCSOCK
#define RPCDBG_FACILITY RPCDBG_SVCXPRT


static struct svc_sock *svc_setup_socket(struct svc_serv *, struct socket *,
Expand Down Expand Up @@ -900,12 +900,21 @@ svc_udp_sendto(struct svc_rqst *rqstp)
return error;
}

static struct svc_xprt_ops svc_udp_ops = {
};

static struct svc_xprt_class svc_udp_class = {
.xcl_name = "udp",
.xcl_ops = &svc_udp_ops,
};

static void
svc_udp_init(struct svc_sock *svsk)
{
int one = 1;
mm_segment_t oldfs;

svc_xprt_init(&svc_udp_class, &svsk->sk_xprt);
svsk->sk_sk->sk_data_ready = svc_udp_data_ready;
svsk->sk_sk->sk_write_space = svc_write_space;
svsk->sk_recvfrom = svc_udp_recvfrom;
Expand Down Expand Up @@ -1344,12 +1353,33 @@ svc_tcp_sendto(struct svc_rqst *rqstp)
return sent;
}

static struct svc_xprt_ops svc_tcp_ops = {
};

static struct svc_xprt_class svc_tcp_class = {
.xcl_name = "tcp",
.xcl_ops = &svc_tcp_ops,
};

void svc_init_xprt_sock(void)
{
svc_reg_xprt_class(&svc_tcp_class);
svc_reg_xprt_class(&svc_udp_class);
}

void svc_cleanup_xprt_sock(void)
{
svc_unreg_xprt_class(&svc_tcp_class);
svc_unreg_xprt_class(&svc_udp_class);
}

static void
svc_tcp_init(struct svc_sock *svsk)
{
struct sock *sk = svsk->sk_sk;
struct tcp_sock *tp = tcp_sk(sk);

svc_xprt_init(&svc_tcp_class, &svsk->sk_xprt);
svsk->sk_recvfrom = svc_tcp_recvfrom;
svsk->sk_sendto = svc_tcp_sendto;

Expand Down

0 comments on commit d9f8f75

Please sign in to comment.