• NeilBrown's avatar
    SUNRPC: rename and refactor svc_get_next_xprt() · 7b31f4da
    NeilBrown authored
    svc_get_next_xprt() does a lot more than just get an xprt.  It also
    decides if it needs to sleep, depending not only on the availability of
    xprts but also on the need to exit or handle external work.
    
    So rename it to svc_rqst_wait_for_work() and only do the testing and
    waiting.  Move all the waiting-related code out of svc_recv() into the
    new svc_rqst_wait_for_work().
    
    Move the dequeueing code out of svc_get_next_xprt() into svc_recv().
    
    Previously svc_xprt_dequeue() would be called twice, once before waiting
    and possibly once after.  Now instead rqst_should_sleep() is called
    twice.  Once to decide if waiting is needed, and once to check against
    after setting the task state do see if we might have missed a wakeup.
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    7b31f4da
svc_xprt.c 38.1 KB