Commit 7375bbad authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Trond Myklebust
Browse files

NFS: cleanup nfs_inode_reclaim_delegation



Reduce a level of indentation for most of the code in this function.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20250718081509.2607553-3-hch@lst.de


Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 67173860
Loading
Loading
Loading
Loading
+24 −24
Original line number Diff line number Diff line
@@ -237,7 +237,13 @@ void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred,

	rcu_read_lock();
	delegation = rcu_dereference(NFS_I(inode)->delegation);
	if (delegation != NULL) {
	if (!delegation) {
		rcu_read_unlock();
		nfs_inode_set_delegation(inode, cred, type, stateid,
					 pagemod_limit, deleg_type);
		return;
	}

	spin_lock(&delegation->lock);
	nfs4_stateid_copy(&delegation->stateid, stateid);
	delegation->type = type;
@@ -253,18 +259,12 @@ void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred,
		clear_bit(NFS_DELEGATION_DELEGTIME, &delegation->flags);
	}
	clear_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags);
		if (test_and_clear_bit(NFS_DELEGATION_REVOKED,
				       &delegation->flags))
	if (test_and_clear_bit(NFS_DELEGATION_REVOKED, &delegation->flags))
		atomic_long_inc(&nfs_active_delegations);
	spin_unlock(&delegation->lock);
	rcu_read_unlock();
	put_cred(oldcred);
	trace_nfs4_reclaim_delegation(inode, type);
	} else {
		rcu_read_unlock();
		nfs_inode_set_delegation(inode, cred, type, stateid,
					 pagemod_limit, deleg_type);
	}
}

static int nfs_do_return_delegation(struct inode *inode,