sunrpc: turn swapper_enable/disable functions into rpc_xprt_ops

RDMA xprts don't have a sock_xprt, but an rdma_xprt, so the
xs_swapper_enable/disable functions will likely oops when fed an RDMA
xprt. Turn these functions into rpc_xprt_ops so that that doesn't
occur. For now the RDMA versions are no-ops that just return -EINVAL
on an attempt to swapon.

Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
Jeff Layton
2015-06-03 16:14:29 -04:00
committed by Trond Myklebust
parent d6e971d8ec
commit d67fa4d85a
4 changed files with 55 additions and 11 deletions

View File

@@ -2495,7 +2495,7 @@ retry:
goto retry;
}
ret = xs_swapper_enable(xprt);
ret = xprt_enable_swap(xprt);
xprt_put(xprt);
}
return ret;
@@ -2522,7 +2522,7 @@ retry:
goto retry;
}
xs_swapper_disable(xprt);
xprt_disable_swap(xprt);
xprt_put(xprt);
}
}