0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef SUNRPC_SVCSOCK_H
0011 #define SUNRPC_SVCSOCK_H
0012
0013 #include <linux/sunrpc/svc.h>
0014 #include <linux/sunrpc/svc_xprt.h>
0015
0016
0017
0018
0019 struct svc_sock {
0020 struct svc_xprt sk_xprt;
0021 struct socket * sk_sock;
0022 struct sock * sk_sk;
0023
0024
0025 void (*sk_ostate)(struct sock *);
0026 void (*sk_odata)(struct sock *);
0027 void (*sk_owspace)(struct sock *);
0028
0029
0030
0031 __be32 sk_marker;
0032
0033
0034 u32 sk_tcplen;
0035
0036
0037 u32 sk_datalen;
0038
0039 atomic_t sk_sendqlen;
0040
0041 struct page * sk_pages[RPCSVC_MAXPAGES];
0042 };
0043
0044 static inline u32 svc_sock_reclen(struct svc_sock *svsk)
0045 {
0046 return be32_to_cpu(svsk->sk_marker) & RPC_FRAGMENT_SIZE_MASK;
0047 }
0048
0049 static inline u32 svc_sock_final_rec(struct svc_sock *svsk)
0050 {
0051 return be32_to_cpu(svsk->sk_marker) & RPC_LAST_STREAM_FRAGMENT;
0052 }
0053
0054
0055
0056
0057 void svc_close_net(struct svc_serv *, struct net *);
0058 int svc_recv(struct svc_rqst *, long);
0059 int svc_send(struct svc_rqst *);
0060 void svc_drop(struct svc_rqst *);
0061 void svc_sock_update_bufs(struct svc_serv *serv);
0062 bool svc_alien_sock(struct net *net, int fd);
0063 int svc_addsock(struct svc_serv *serv, const int fd,
0064 char *name_return, const size_t len,
0065 const struct cred *cred);
0066 void svc_init_xprt_sock(void);
0067 void svc_cleanup_xprt_sock(void);
0068 struct svc_xprt *svc_sock_create(struct svc_serv *serv, int prot);
0069 void svc_sock_destroy(struct svc_xprt *);
0070
0071
0072
0073
0074 #define SVC_SOCK_DEFAULTS (0U)
0075 #define SVC_SOCK_ANONYMOUS (1U << 0)
0076 #define SVC_SOCK_TEMPORARY (1U << 1)
0077
0078 #endif