sunrpc: replace svc_serv->sv_bc_xprt by boolean flag

svc_serv-> sv_bc_xprt is netns-unsafe and cannot be used as pointer.
To prevent its misuse in future it is replaced by new boolean flag.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Vasily Averin
2018-12-24 14:45:04 +03:00
committed by J. Bruce Fields
parent d4b09acf92
commit a289ce5311
5 changed files with 10 additions and 13 deletions

View File

@@ -47,11 +47,9 @@ void xprt_free_bc_rqst(struct rpc_rqst *req);
/*
* Determine if a shared backchannel is in use
*/
static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
{
if (rqstp->rq_server->sv_bc_xprt)
return 1;
return 0;
return rqstp->rq_server->sv_bc_enabled;
}
#else /* CONFIG_SUNRPC_BACKCHANNEL */
static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
@@ -60,9 +58,9 @@ static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
return 0;
}
static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
{
return 0;
return false;
}
static inline void xprt_free_bc_request(struct rpc_rqst *req)

View File

@@ -109,7 +109,7 @@ struct svc_serv {
spinlock_t sv_cb_lock; /* protects the svc_cb_list */
wait_queue_head_t sv_cb_waitq; /* sleep here if there are no
* entries in the svc_cb_list */
struct svc_xprt *sv_bc_xprt; /* callback on fore channel */
bool sv_bc_enabled; /* service uses backchannel */
#endif /* CONFIG_SUNRPC_BACKCHANNEL */
};