summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2026-01-07 08:27:01 +0100
committerAnna Schumaker <anna.schumaker@oracle.com>2026-01-20 14:49:46 -0500
commit8cb32b9344f65dbdcb947745f812173d4bb65601 (patch)
tree5c444ec3d9c0e9df938ae675ddaac8d1b69c1600
parent86ac1b7b616bbc33f886882655d31068f0b14b8d (diff)
NFS: open code nfs_delegation_need_return
There is only a single caller, and the function can be condensed into a single if statement, making it more clear what is being tested there. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
-rw-r--r--fs/nfs/delegation.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 7b05d661775b..bf1dcf186a47 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -591,22 +591,6 @@ out:
return err;
}
-static bool nfs_delegation_need_return(struct nfs_delegation *delegation)
-{
- bool ret = false;
-
- trace_nfs_delegation_need_return(delegation);
-
- if (test_and_clear_bit(NFS_DELEGATION_RETURN, &delegation->flags))
- ret = true;
- if (test_bit(NFS_DELEGATION_RETURNING, &delegation->flags) ||
- test_bit(NFS_DELEGATION_RETURN_DELAYED, &delegation->flags) ||
- test_bit(NFS_DELEGATION_REVOKED, &delegation->flags))
- ret = false;
-
- return ret;
-}
-
static int nfs_server_return_marked_delegations(struct nfs_server *server,
void __always_unused *data)
{
@@ -641,11 +625,17 @@ restart:
list_for_each_entry_from_rcu(delegation, &server->delegations, super_list) {
struct inode *to_put = NULL;
- if (!nfs_delegation_need_return(delegation)) {
+ trace_nfs_delegation_need_return(delegation);
+
+ if (!test_and_clear_bit(NFS_DELEGATION_RETURN, &delegation->flags) ||
+ test_bit(NFS_DELEGATION_RETURNING, &delegation->flags) ||
+ test_bit(NFS_DELEGATION_RETURN_DELAYED, &delegation->flags) ||
+ test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) {
if (nfs4_is_valid_delegation(delegation, 0))
prev = delegation;
continue;
}
+
inode = nfs_delegation_grab_inode(delegation);
if (inode == NULL)
continue;