]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Refactor svc_recvfrom()
authorChuck Lever <chuck.lever@oracle.com>
Wed, 20 May 2020 21:30:12 +0000 (17:30 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Wed, 20 May 2020 21:30:12 +0000 (17:30 -0400)
commit257a978d11ed2853382780f9efa9f307f6b86226
tree7a87b7f483c651f1d378a8207f83f08db682c7ac
parente6fde6bf7b1501e1b8540c9810635943a566167a
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.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/linux/sunrpc/svc.h
net/sunrpc/svcsock.c