NFS: remove nfs_inode_detach_delegation

Fold it into the only caller.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
This commit is contained in:
Christoph Hellwig 2026-01-07 08:26:56 +01:00 committed by Anna Schumaker
parent c6c9b9bc9f
commit ee443e1161

View File

@ -402,21 +402,6 @@ static struct nfs_delegation *nfs_detach_delegation(struct nfs_inode *nfsi,
return delegation;
}
static struct nfs_delegation *
nfs_inode_detach_delegation(struct inode *inode)
{
struct nfs_inode *nfsi = NFS_I(inode);
struct nfs_server *server = NFS_SERVER(inode);
struct nfs_delegation *delegation;
rcu_read_lock();
delegation = rcu_dereference(nfsi->delegation);
if (delegation != NULL)
delegation = nfs_detach_delegation(nfsi, delegation, server);
rcu_read_unlock();
return delegation;
}
static void
nfs_update_delegation_cred(struct nfs_delegation *delegation,
const struct cred *cred)
@ -774,15 +759,23 @@ int nfs_client_return_marked_delegations(struct nfs_client *clp)
*/
void nfs_inode_evict_delegation(struct inode *inode)
{
struct nfs_inode *nfsi = NFS_I(inode);
struct nfs_server *server = NFS_SERVER(inode);
struct nfs_delegation *delegation;
delegation = nfs_inode_detach_delegation(inode);
if (delegation != NULL) {
set_bit(NFS_DELEGATION_RETURNING, &delegation->flags);
set_bit(NFS_DELEGATION_INODE_FREEING, &delegation->flags);
nfs_do_return_delegation(inode, delegation, 1);
nfs_free_delegation(NFS_SERVER(inode), delegation);
}
rcu_read_lock();
delegation = rcu_dereference(nfsi->delegation);
if (delegation)
delegation = nfs_detach_delegation(nfsi, delegation, server);
rcu_read_unlock();
if (!delegation)
return;
set_bit(NFS_DELEGATION_RETURNING, &delegation->flags);
set_bit(NFS_DELEGATION_INODE_FREEING, &delegation->flags);
nfs_do_return_delegation(inode, delegation, 1);
nfs_free_delegation(server, delegation);
}
/**