Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net/9p: move structures and macros to header files

With the new mount API all option parsing will need to happen
in fs/v9fs.c, so move some existing data structures and macros
to header files to facilitate this. Rename some to reflect
the transport they are used for (rdma, fd, etc), for clarity.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Message-ID: <20251010214222.1347785-3-sandeen@redhat.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>

authored by

Eric Sandeen and committed by
Dominique Martinet
c44393d8 695f2ca1

+49 -47
+6
include/net/9p/client.h
··· 16 16 /* Number of requests per row */ 17 17 #define P9_ROW_MAXTAG 255 18 18 19 + /* DEFAULT MSIZE = 32 pages worth of payload + P9_HDRSZ + 20 + * room for write (16 extra) or read (11 extra) operands. 21 + */ 22 + 23 + #define DEFAULT_MSIZE ((128 * 1024) + P9_IOHDRSZ) 24 + 19 25 /** enum p9_proto_versions - 9P protocol versions 20 26 * @p9_proto_legacy: 9P Legacy mode, pre-9P2000.u 21 27 * @p9_proto_2000u: 9P2000.u extension
+39
include/net/9p/transport.h
··· 14 14 #define P9_DEF_MIN_RESVPORT (665U) 15 15 #define P9_DEF_MAX_RESVPORT (1023U) 16 16 17 + #define P9_FD_PORT 564 18 + 19 + #define P9_RDMA_PORT 5640 20 + #define P9_RDMA_SQ_DEPTH 32 21 + #define P9_RDMA_RQ_DEPTH 32 22 + #define P9_RDMA_TIMEOUT 30000 /* 30 seconds */ 23 + 24 + /** 25 + * struct p9_fd_opts - per-transport options for fd transport 26 + * @rfd: file descriptor for reading (trans=fd) 27 + * @wfd: file descriptor for writing (trans=fd) 28 + * @port: port to connect to (trans=tcp) 29 + * @privport: port is privileged 30 + */ 31 + 32 + struct p9_fd_opts { 33 + int rfd; 34 + int wfd; 35 + u16 port; 36 + bool privport; 37 + }; 38 + 39 + /** 40 + * struct p9_rdma_opts - Collection of mount options for rdma transport 41 + * @port: port of connection 42 + * @privport: Whether a privileged port may be used 43 + * @sq_depth: The requested depth of the SQ. This really doesn't need 44 + * to be any deeper than the number of threads used in the client 45 + * @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth 46 + * @timeout: Time to wait in msecs for CM events 47 + */ 48 + struct p9_rdma_opts { 49 + short port; 50 + bool privport; 51 + int sq_depth; 52 + int rq_depth; 53 + long timeout; 54 + }; 55 + 17 56 /** 18 57 * struct p9_trans_module - transport module interface 19 58 * @list: used to maintain a list of currently available transports
-6
net/9p/client.c
··· 29 29 #define CREATE_TRACE_POINTS 30 30 #include <trace/events/9p.h> 31 31 32 - /* DEFAULT MSIZE = 32 pages worth of payload + P9_HDRSZ + 33 - * room for write (16 extra) or read (11 extra) operands. 34 - */ 35 - 36 - #define DEFAULT_MSIZE ((128 * 1024) + P9_IOHDRSZ) 37 - 38 32 /* Client Option Parsing (code inspired by NFS code) 39 33 * - a little lazy - parse all client options 40 34 */
+2 -18
net/9p/trans_fd.c
··· 31 31 32 32 #include <linux/syscalls.h> /* killme */ 33 33 34 - #define P9_PORT 564 35 34 #define MAX_SOCK_BUF (1024*1024) 36 35 #define MAXPOLLWADDR 2 37 36 38 37 static struct p9_trans_module p9_tcp_trans; 39 38 static struct p9_trans_module p9_fd_trans; 40 - 41 - /** 42 - * struct p9_fd_opts - per-transport options 43 - * @rfd: file descriptor for reading (trans=fd) 44 - * @wfd: file descriptor for writing (trans=fd) 45 - * @port: port to connect to (trans=tcp) 46 - * @privport: port is privileged 47 - */ 48 - 49 - struct p9_fd_opts { 50 - int rfd; 51 - int wfd; 52 - u16 port; 53 - bool privport; 54 - }; 55 39 56 40 /* 57 41 * Option Parsing (code inspired by NFS code) ··· 726 742 static int p9_fd_show_options(struct seq_file *m, struct p9_client *clnt) 727 743 { 728 744 if (clnt->trans_mod == &p9_tcp_trans) { 729 - if (clnt->trans_opts.tcp.port != P9_PORT) 745 + if (clnt->trans_opts.tcp.port != P9_FD_PORT) 730 746 seq_printf(m, ",port=%u", clnt->trans_opts.tcp.port); 731 747 } else if (clnt->trans_mod == &p9_fd_trans) { 732 748 if (clnt->trans_opts.fd.rfd != ~0) ··· 752 768 int option; 753 769 char *options, *tmp_options; 754 770 755 - opts->port = P9_PORT; 771 + opts->port = P9_FD_PORT; 756 772 opts->rfd = ~0; 757 773 opts->wfd = ~0; 758 774 opts->privport = false;
+2 -23
net/9p/trans_rdma.c
··· 32 32 #include <rdma/ib_verbs.h> 33 33 #include <rdma/rdma_cm.h> 34 34 35 - #define P9_PORT 5640 36 - #define P9_RDMA_SQ_DEPTH 32 37 - #define P9_RDMA_RQ_DEPTH 32 38 35 #define P9_RDMA_SEND_SGE 4 39 36 #define P9_RDMA_RECV_SGE 4 40 37 #define P9_RDMA_IRD 0 41 38 #define P9_RDMA_ORD 0 42 - #define P9_RDMA_TIMEOUT 30000 /* 30 seconds */ 43 39 #define P9_RDMA_MAXSIZE (1024*1024) /* 1MB */ 44 40 45 41 /** ··· 106 110 }; 107 111 }; 108 112 109 - /** 110 - * struct p9_rdma_opts - Collection of mount options 111 - * @port: port of connection 112 - * @privport: Whether a privileged port may be used 113 - * @sq_depth: The requested depth of the SQ. This really doesn't need 114 - * to be any deeper than the number of threads used in the client 115 - * @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth 116 - * @timeout: Time to wait in msecs for CM events 117 - */ 118 - struct p9_rdma_opts { 119 - short port; 120 - bool privport; 121 - int sq_depth; 122 - int rq_depth; 123 - long timeout; 124 - }; 125 - 126 113 /* 127 114 * Option Parsing (code inspired by NFS code) 128 115 */ ··· 130 151 { 131 152 struct p9_trans_rdma *rdma = clnt->trans; 132 153 133 - if (rdma->port != P9_PORT) 154 + if (rdma->port != P9_RDMA_PORT) 134 155 seq_printf(m, ",port=%u", rdma->port); 135 156 if (rdma->sq_depth != P9_RDMA_SQ_DEPTH) 136 157 seq_printf(m, ",sq=%u", rdma->sq_depth); ··· 157 178 int option; 158 179 char *options, *tmp_options; 159 180 160 - opts->port = P9_PORT; 181 + opts->port = P9_RDMA_PORT; 161 182 opts->sq_depth = P9_RDMA_SQ_DEPTH; 162 183 opts->rq_depth = P9_RDMA_RQ_DEPTH; 163 184 opts->timeout = P9_RDMA_TIMEOUT;