hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/fs/lockd/clntproc.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/fs/lockd/clntproc.c
34 *
....@@ -46,13 +47,14 @@
4647 c->len=4;
4748 }
4849
49
-static struct nlm_lockowner *nlm_get_lockowner(struct nlm_lockowner *lockowner)
50
+static struct nlm_lockowner *
51
+nlmclnt_get_lockowner(struct nlm_lockowner *lockowner)
5052 {
5153 refcount_inc(&lockowner->count);
5254 return lockowner;
5355 }
5456
55
-static void nlm_put_lockowner(struct nlm_lockowner *lockowner)
57
+static void nlmclnt_put_lockowner(struct nlm_lockowner *lockowner)
5658 {
5759 if (!refcount_dec_and_lock(&lockowner->count, &lockowner->host->h_lock))
5860 return;
....@@ -81,28 +83,28 @@
8183 return res;
8284 }
8385
84
-static struct nlm_lockowner *__nlm_find_lockowner(struct nlm_host *host, fl_owner_t owner)
86
+static struct nlm_lockowner *__nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner)
8587 {
8688 struct nlm_lockowner *lockowner;
8789 list_for_each_entry(lockowner, &host->h_lockowners, list) {
8890 if (lockowner->owner != owner)
8991 continue;
90
- return nlm_get_lockowner(lockowner);
92
+ return nlmclnt_get_lockowner(lockowner);
9193 }
9294 return NULL;
9395 }
9496
95
-static struct nlm_lockowner *nlm_find_lockowner(struct nlm_host *host, fl_owner_t owner)
97
+static struct nlm_lockowner *nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner)
9698 {
9799 struct nlm_lockowner *res, *new = NULL;
98100
99101 spin_lock(&host->h_lock);
100
- res = __nlm_find_lockowner(host, owner);
102
+ res = __nlmclnt_find_lockowner(host, owner);
101103 if (res == NULL) {
102104 spin_unlock(&host->h_lock);
103105 new = kmalloc(sizeof(*new), GFP_KERNEL);
104106 spin_lock(&host->h_lock);
105
- res = __nlm_find_lockowner(host, owner);
107
+ res = __nlmclnt_find_lockowner(host, owner);
106108 if (res == NULL && new != NULL) {
107109 res = new;
108110 refcount_set(&new->count, 1);
....@@ -256,7 +258,7 @@
256258 * Generic NLM call
257259 */
258260 static int
259
-nlmclnt_call(struct rpc_cred *cred, struct nlm_rqst *req, u32 proc)
261
+nlmclnt_call(const struct cred *cred, struct nlm_rqst *req, u32 proc)
260262 {
261263 struct nlm_host *host = req->a_host;
262264 struct rpc_clnt *clnt;
....@@ -401,7 +403,7 @@
401403 * completion in order to be able to correctly track the lock
402404 * state.
403405 */
404
-static int nlmclnt_async_call(struct rpc_cred *cred, struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
406
+static int nlmclnt_async_call(const struct cred *cred, struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
405407 {
406408 struct rpc_message msg = {
407409 .rpc_argp = &req->a_args,
....@@ -456,7 +458,7 @@
456458 {
457459 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock);
458460 new->fl_u.nfs_fl.state = fl->fl_u.nfs_fl.state;
459
- new->fl_u.nfs_fl.owner = nlm_get_lockowner(fl->fl_u.nfs_fl.owner);
461
+ new->fl_u.nfs_fl.owner = nlmclnt_get_lockowner(fl->fl_u.nfs_fl.owner);
460462 list_add_tail(&new->fl_u.nfs_fl.list, &fl->fl_u.nfs_fl.owner->host->h_granted);
461463 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock);
462464 }
....@@ -466,7 +468,7 @@
466468 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock);
467469 list_del(&fl->fl_u.nfs_fl.list);
468470 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock);
469
- nlm_put_lockowner(fl->fl_u.nfs_fl.owner);
471
+ nlmclnt_put_lockowner(fl->fl_u.nfs_fl.owner);
470472 }
471473
472474 static const struct file_lock_operations nlmclnt_lock_ops = {
....@@ -477,7 +479,7 @@
477479 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host)
478480 {
479481 fl->fl_u.nfs_fl.state = 0;
480
- fl->fl_u.nfs_fl.owner = nlm_find_lockowner(host, fl->fl_owner);
482
+ fl->fl_u.nfs_fl.owner = nlmclnt_find_lockowner(host, fl->fl_owner);
481483 INIT_LIST_HEAD(&fl->fl_u.nfs_fl.list);
482484 fl->fl_ops = &nlmclnt_lock_ops;
483485 }
....@@ -510,7 +512,7 @@
510512 static int
511513 nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)
512514 {
513
- struct rpc_cred *cred = nfs_file_cred(fl->fl_file);
515
+ const struct cred *cred = nfs_file_cred(fl->fl_file);
514516 struct nlm_host *host = req->a_host;
515517 struct nlm_res *resp = &req->a_res;
516518 struct nlm_wait *block = NULL;
....@@ -715,7 +717,7 @@
715717 struct nlm_rqst *req = data;
716718 u32 status = ntohl(req->a_res.status);
717719
718
- if (RPC_ASSASSINATED(task))
720
+ if (RPC_SIGNALLED(task))
719721 goto die;
720722
721723 if (task->tk_status < 0) {
....@@ -783,7 +785,7 @@
783785 struct nlm_rqst *req = data;
784786 u32 status = ntohl(req->a_res.status);
785787
786
- if (RPC_ASSASSINATED(task))
788
+ if (RPC_SIGNALLED(task))
787789 goto die;
788790
789791 if (task->tk_status < 0) {