mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 02:05:20 +07:00
a73881c96d
udp_poll() checks the struct file for the O_NONBLOCK flag, so we must not
call it with a NULL file pointer.
Fixes: 0ffe86f480
("SUNRPC: Use poll() to fix up the socket requeue races")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
91 lines
1.6 KiB
C
91 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* linux/include/linux/sunrpc/xprtsock.h
|
|
*
|
|
* Declarations for the RPC transport socket provider.
|
|
*/
|
|
|
|
#ifndef _LINUX_SUNRPC_XPRTSOCK_H
|
|
#define _LINUX_SUNRPC_XPRTSOCK_H
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
int init_socket_xprt(void);
|
|
void cleanup_socket_xprt(void);
|
|
|
|
#define RPC_MIN_RESVPORT (1U)
|
|
#define RPC_MAX_RESVPORT (65535U)
|
|
#define RPC_DEF_MIN_RESVPORT (665U)
|
|
#define RPC_DEF_MAX_RESVPORT (1023U)
|
|
|
|
struct sock_xprt {
|
|
struct rpc_xprt xprt;
|
|
|
|
/*
|
|
* Network layer
|
|
*/
|
|
struct socket * sock;
|
|
struct sock * inet;
|
|
struct file * file;
|
|
|
|
/*
|
|
* State of TCP reply receive
|
|
*/
|
|
struct {
|
|
struct {
|
|
__be32 fraghdr,
|
|
xid,
|
|
calldir;
|
|
} __attribute__((packed));
|
|
|
|
u32 offset,
|
|
len;
|
|
|
|
unsigned long copied;
|
|
} recv;
|
|
|
|
/*
|
|
* State of TCP transmit queue
|
|
*/
|
|
struct {
|
|
u32 offset;
|
|
} xmit;
|
|
|
|
/*
|
|
* Connection of transports
|
|
*/
|
|
unsigned long sock_state;
|
|
struct delayed_work connect_worker;
|
|
struct work_struct recv_worker;
|
|
struct mutex recv_mutex;
|
|
struct sockaddr_storage srcaddr;
|
|
unsigned short srcport;
|
|
|
|
/*
|
|
* UDP socket buffer size parameters
|
|
*/
|
|
size_t rcvsize,
|
|
sndsize;
|
|
|
|
struct rpc_timeout tcp_timeout;
|
|
|
|
/*
|
|
* Saved socket callback addresses
|
|
*/
|
|
void (*old_data_ready)(struct sock *);
|
|
void (*old_state_change)(struct sock *);
|
|
void (*old_write_space)(struct sock *);
|
|
void (*old_error_report)(struct sock *);
|
|
};
|
|
|
|
/*
|
|
* TCP RPC flags
|
|
*/
|
|
#define XPRT_SOCK_CONNECTING 1U
|
|
#define XPRT_SOCK_DATA_READY (2)
|
|
#define XPRT_SOCK_UPD_TIMEOUT (3)
|
|
|
|
#endif /* __KERNEL__ */
|
|
|
|
#endif /* _LINUX_SUNRPC_XPRTSOCK_H */
|