History

SUNRPC: Refactor svc_recvfrom()

This function is not currently "generic" so remove the documenting comment and rename it appropriately. Its internals are converted to use bio_vecs for reading from the transport socket. In existing typical sunrpc uses of bio_vecs, the bio_vec array is allocated dynamically. Here, instead, an array of bio_vecs is added to svc_rqst. The lifetime of this array can be greater than one call to xpo_recvfrom(): - Multiple calls to xpo_recvfrom() might be needed to read an RPC message completely. - At some later point, rq_arg.bvecs will point to this array and it will carry the received message into svc_process(). I also expect that a future optimization will remove either the rq_vec or rq_pages array in favor of rq_bvec, thus conserving the size of struct svc_rqst.

Chuck Lever committed 6 years ago

Commit ca07eda1 parent cca557a2 files · +69 −41Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/sunrpc/svc.h+1−0
@@ -254,6 +254,7 @@ struct svc_rqst { · 253 unmodified lines
254 struct page * *rq_page_end; /* one past the last page */254 struct page * *rq_page_end; /* one past the last page */
255 255
256 struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */256 struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */
257 struct bio_vec rq_bvec[RPCSVC_MAXPAGES];
257 258
258 __be32 rq_xid; /* transmission id */259 __be32 rq_xid; /* transmission id */
259 u32 rq_prog; /* program number */260 u32 rq_prog; /* program number */