• NeilBrown's avatar
    SUNRPC: always treat sv_nrpools==1 as "not pooled" · 93aa619e
    NeilBrown authored
    Currently 'pooled' services hold a reference on the pool_map, and
    'unpooled' services do not.
    svc_destroy() uses the presence of ->svo_function (via
    svc_serv_is_pooled()) to determine if the reference should be dropped.
    There is no direct correlation between being pooled and the use of
    svo_function, though in practice, lockd is the only non-pooled service,
    and the only one not to use svo_function.
    
    This is untidy and would cause problems if we changed lockd to use
    svc_set_num_threads(), which requires the use of ->svo_function.
    
    So change the test for "is the service pooled" to "is sv_nrpools > 1".
    
    This means that when svc_pool_map_get() returns 1, it must NOT take a
    reference to the pool.
    
    We discard svc_serv_is_pooled(), and test sv_nrpools directly.
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    93aa619e
svc.c 39.8 KB