aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-10-03 23:10:42 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-11-11 18:18:53 +0000
commit598fbd36f1efc6fc322b78ad53d0c285a4e2e8d8 (patch)
treea51c59679bbe5477f75192e89051a74d066f8aed
parent44c1914ee672487fe19363647f787958f2e3bebb (diff)
downloadsrc-598fbd36f1efc6fc322b78ad53d0c285a4e2e8d8.tar.gz
src-598fbd36f1efc6fc322b78ad53d0c285a4e2e8d8.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 (cherry picked from commit 3b887005b4bb215e0e052ae81fe31c2c0d5f4f35)
-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));