• R
    nfs41: Process the RPC call direction · f4a2e418
    Ricardo Labiaga 提交于
    Reading and storing the RPC direction is a three step process.
    
    1. xs_tcp_read_calldir() reads the RPC direction, but it will not store it
    in the XDR buffer since the 'struct rpc_rqst' is not yet available.
    
    2. The 'struct rpc_rqst' is obtained during the TCP_RCV_COPY_DATA state.
    This state need not necessarily be preceeded by the TCP_RCV_READ_CALLDIR.
    For example, we may be reading a continuation packet to a large reply.
    Therefore, we can't simply obtain the 'struct rpc_rqst' during the
    TCP_RCV_READ_CALLDIR state and assume it's available during TCP_RCV_COPY_DATA.
    
    This patch adds a new TCP_RCV_READ_CALLDIR flag to indicate the need to
    read the RPC direction.  It then uses TCP_RCV_COPY_CALLDIR to indicate the
    RPC direction needs to be saved after the 'struct rpc_rqst' has been allocated.
    
    3. The 'struct rpc_rqst' is obtained by the xs_tcp_read_data() helper
    functions.  xs_tcp_read_common() then saves the RPC direction in the XDR
    buffer if TCP_RCV_COPY_CALLDIR is set.  This will happen when we're reading
    the data immediately after the direction was read.  xs_tcp_read_common()
    then clears this flag.
    
    [was nfs41: Skip past the RPC call direction]
    Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
    Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
    [nfs41: sunrpc: Add RPC direction back into the XDR buffer]
    Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
    Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
    [nfs41: sunrpc: Don't skip past the RPC call direction]
    Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
    Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
    f4a2e418
xprtsock.c 58.8 KB