aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-10-03 23:10:42 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-10-03 23:10:42 +0000
commit3b887005b4bb215e0e052ae81fe31c2c0d5f4f35 (patch)
tree9f58e753bb1fc69a309248fc8d81f922e1625aeb
parentdb695788fc3d1eb3ff4cb258710f874953324208 (diff)
downloadsrc-3b887005b4bb215e0e052ae81fe31c2c0d5f4f35.tar.gz
src-3b887005b4bb215e0e052ae81fe31c2c0d5f4f35.zip
rpc.lockd: Explicitly cast enum nlm_stats values to enum nlm4_stats.
NLM 4 status values are a superset of the older NLM protocol so these casts are safe while pacifying -Wenum-conversion warnings from GCC. Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D36816
-rw-r--r--usr.sbin/rpc.lockd/lock_proc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/rpc.lockd/lock_proc.c b/usr.sbin/rpc.lockd/lock_proc.c
index 160e1844e5a8..395baf399832 100644
--- a/usr.sbin/rpc.lockd/lock_proc.c
+++ b/usr.sbin/rpc.lockd/lock_proc.c
@@ -999,7 +999,7 @@ nlm4_lock_4_svc(nlm4_lockargs *arg, struct svc_req *rqstp)
/* copy cookie from arg to result. See comment in nlm_test_4() */
res.cookie = arg->cookie;
- res.stat.stat = getlock(arg, rqstp, LOCK_MON | LOCK_V4);
+ res.stat.stat = (enum nlm4_stats)getlock(arg, rqstp, LOCK_MON | LOCK_V4);
return (&res);
}
@@ -1012,7 +1012,7 @@ nlm4_lock_msg_4_svc(nlm4_lockargs *arg, struct svc_req *rqstp)
log_from_addr("nlm4_lock_msg", rqstp);
res.cookie = arg->cookie;
- res.stat.stat = getlock(arg, rqstp, LOCK_MON | LOCK_ASYNC | LOCK_V4);
+ res.stat.stat = (enum nlm4_stats)getlock(arg, rqstp, LOCK_MON | LOCK_ASYNC | LOCK_V4);
transmit4_result(NLM4_LOCK_RES, &res, getrpcaddr(rqstp));
return (NULL);
@@ -1039,7 +1039,7 @@ nlm4_cancel_4_svc(nlm4_cancargs *arg, struct svc_req *rqstp)
* Since at present we never return 'nlm_blocked', there can never be
* a lock to cancel, so this call always fails.
*/
- res.stat.stat = unlock(&arg->alock, LOCK_CANCEL);
+ res.stat.stat = (enum nlm4_stats)unlock(&arg->alock, LOCK_CANCEL);
return (&res);
}
@@ -1056,7 +1056,7 @@ nlm4_cancel_msg_4_svc(nlm4_cancargs *arg, struct svc_req *rqstp)
* Since at present we never return 'nlm_blocked', there can never be
* a lock to cancel, so this call always fails.
*/
- res.stat.stat = unlock(&arg->alock, LOCK_CANCEL | LOCK_V4);
+ res.stat.stat = (enum nlm4_stats)unlock(&arg->alock, LOCK_CANCEL | LOCK_V4);
transmit4_result(NLM4_CANCEL_RES, &res, getrpcaddr(rqstp));
return (NULL);
}
@@ -1077,7 +1077,7 @@ nlm4_unlock_4_svc(nlm4_unlockargs *arg, struct svc_req *rqstp)
if (debug_level)
log_from_addr("nlm4_unlock", rqstp);
- res.stat.stat = unlock(&arg->alock, LOCK_V4);
+ res.stat.stat = (enum nlm4_stats)unlock(&arg->alock, LOCK_V4);
res.cookie = arg->cookie;
return (&res);
@@ -1091,7 +1091,7 @@ nlm4_unlock_msg_4_svc(nlm4_unlockargs *arg, struct svc_req *rqstp)
if (debug_level)
log_from_addr("nlm4_unlock_msg", rqstp);
- res.stat.stat = unlock(&arg->alock, LOCK_V4);
+ res.stat.stat = (enum nlm4_stats)unlock(&arg->alock, LOCK_V4);
res.cookie = arg->cookie;
transmit4_result(NLM4_UNLOCK_RES, &res, getrpcaddr(rqstp));