SUNRPC: Simplify TCP receive code by switching to using iterators

Most of this code should also be reusable with other socket types.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
Trond Myklebust
2018-09-14 09:49:06 -04:00
parent 9d96acbc7f
commit 277e4ab7d5
3 changed files with 338 additions and 393 deletions

View File

@@ -31,15 +31,16 @@ struct sock_xprt {
* State of TCP reply receive
*/
struct {
__be32 fraghdr,
struct {
__be32 fraghdr,
xid,
calldir;
} __attribute__((packed));
u32 offset,
len;
unsigned long copied,
flags;
unsigned long copied;
} recv;
/*
@@ -76,21 +77,9 @@ struct sock_xprt {
void (*old_error_report)(struct sock *);
};
/*
* TCP receive state flags
*/
#define TCP_RCV_LAST_FRAG (1UL << 0)
#define TCP_RCV_COPY_FRAGHDR (1UL << 1)
#define TCP_RCV_COPY_XID (1UL << 2)
#define TCP_RCV_COPY_DATA (1UL << 3)
#define TCP_RCV_READ_CALLDIR (1UL << 4)
#define TCP_RCV_COPY_CALLDIR (1UL << 5)
/*
* TCP RPC flags
*/
#define TCP_RPC_REPLY (1UL << 6)
#define XPRT_SOCK_CONNECTING 1U
#define XPRT_SOCK_DATA_READY (2)
#define XPRT_SOCK_UPD_TIMEOUT (3)