.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/fs/lockd/clntproc.c |
---|
3 | 4 | * |
---|
.. | .. |
---|
46 | 47 | c->len=4; |
---|
47 | 48 | } |
---|
48 | 49 | |
---|
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) |
---|
50 | 52 | { |
---|
51 | 53 | refcount_inc(&lockowner->count); |
---|
52 | 54 | return lockowner; |
---|
53 | 55 | } |
---|
54 | 56 | |
---|
55 | | -static void nlm_put_lockowner(struct nlm_lockowner *lockowner) |
---|
| 57 | +static void nlmclnt_put_lockowner(struct nlm_lockowner *lockowner) |
---|
56 | 58 | { |
---|
57 | 59 | if (!refcount_dec_and_lock(&lockowner->count, &lockowner->host->h_lock)) |
---|
58 | 60 | return; |
---|
.. | .. |
---|
81 | 83 | return res; |
---|
82 | 84 | } |
---|
83 | 85 | |
---|
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) |
---|
85 | 87 | { |
---|
86 | 88 | struct nlm_lockowner *lockowner; |
---|
87 | 89 | list_for_each_entry(lockowner, &host->h_lockowners, list) { |
---|
88 | 90 | if (lockowner->owner != owner) |
---|
89 | 91 | continue; |
---|
90 | | - return nlm_get_lockowner(lockowner); |
---|
| 92 | + return nlmclnt_get_lockowner(lockowner); |
---|
91 | 93 | } |
---|
92 | 94 | return NULL; |
---|
93 | 95 | } |
---|
94 | 96 | |
---|
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) |
---|
96 | 98 | { |
---|
97 | 99 | struct nlm_lockowner *res, *new = NULL; |
---|
98 | 100 | |
---|
99 | 101 | spin_lock(&host->h_lock); |
---|
100 | | - res = __nlm_find_lockowner(host, owner); |
---|
| 102 | + res = __nlmclnt_find_lockowner(host, owner); |
---|
101 | 103 | if (res == NULL) { |
---|
102 | 104 | spin_unlock(&host->h_lock); |
---|
103 | 105 | new = kmalloc(sizeof(*new), GFP_KERNEL); |
---|
104 | 106 | spin_lock(&host->h_lock); |
---|
105 | | - res = __nlm_find_lockowner(host, owner); |
---|
| 107 | + res = __nlmclnt_find_lockowner(host, owner); |
---|
106 | 108 | if (res == NULL && new != NULL) { |
---|
107 | 109 | res = new; |
---|
108 | 110 | refcount_set(&new->count, 1); |
---|
.. | .. |
---|
256 | 258 | * Generic NLM call |
---|
257 | 259 | */ |
---|
258 | 260 | 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) |
---|
260 | 262 | { |
---|
261 | 263 | struct nlm_host *host = req->a_host; |
---|
262 | 264 | struct rpc_clnt *clnt; |
---|
.. | .. |
---|
401 | 403 | * completion in order to be able to correctly track the lock |
---|
402 | 404 | * state. |
---|
403 | 405 | */ |
---|
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) |
---|
405 | 407 | { |
---|
406 | 408 | struct rpc_message msg = { |
---|
407 | 409 | .rpc_argp = &req->a_args, |
---|
.. | .. |
---|
456 | 458 | { |
---|
457 | 459 | spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); |
---|
458 | 460 | 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); |
---|
460 | 462 | list_add_tail(&new->fl_u.nfs_fl.list, &fl->fl_u.nfs_fl.owner->host->h_granted); |
---|
461 | 463 | spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock); |
---|
462 | 464 | } |
---|
.. | .. |
---|
466 | 468 | spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock); |
---|
467 | 469 | list_del(&fl->fl_u.nfs_fl.list); |
---|
468 | 470 | 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); |
---|
470 | 472 | } |
---|
471 | 473 | |
---|
472 | 474 | static const struct file_lock_operations nlmclnt_lock_ops = { |
---|
.. | .. |
---|
477 | 479 | static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host) |
---|
478 | 480 | { |
---|
479 | 481 | 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); |
---|
481 | 483 | INIT_LIST_HEAD(&fl->fl_u.nfs_fl.list); |
---|
482 | 484 | fl->fl_ops = &nlmclnt_lock_ops; |
---|
483 | 485 | } |
---|
.. | .. |
---|
510 | 512 | static int |
---|
511 | 513 | nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl) |
---|
512 | 514 | { |
---|
513 | | - struct rpc_cred *cred = nfs_file_cred(fl->fl_file); |
---|
| 515 | + const struct cred *cred = nfs_file_cred(fl->fl_file); |
---|
514 | 516 | struct nlm_host *host = req->a_host; |
---|
515 | 517 | struct nlm_res *resp = &req->a_res; |
---|
516 | 518 | struct nlm_wait *block = NULL; |
---|
.. | .. |
---|
715 | 717 | struct nlm_rqst *req = data; |
---|
716 | 718 | u32 status = ntohl(req->a_res.status); |
---|
717 | 719 | |
---|
718 | | - if (RPC_ASSASSINATED(task)) |
---|
| 720 | + if (RPC_SIGNALLED(task)) |
---|
719 | 721 | goto die; |
---|
720 | 722 | |
---|
721 | 723 | if (task->tk_status < 0) { |
---|
.. | .. |
---|
783 | 785 | struct nlm_rqst *req = data; |
---|
784 | 786 | u32 status = ntohl(req->a_res.status); |
---|
785 | 787 | |
---|
786 | | - if (RPC_ASSASSINATED(task)) |
---|
| 788 | + if (RPC_SIGNALLED(task)) |
---|
787 | 789 | goto die; |
---|
788 | 790 | |
---|
789 | 791 | if (task->tk_status < 0) { |
---|