Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp79176ybx; Thu, 31 Oct 2019 16:15:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3qvWYWuFIDDT66fomJC6HObLJdrtrZSMPhxDCCJEJon4DFWxlDk7jG/Hv/tbYL67VMhWq X-Received: by 2002:aa7:dd87:: with SMTP id g7mr6578812edv.295.1572563757414; Thu, 31 Oct 2019 16:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572563757; cv=none; d=google.com; s=arc-20160816; b=dGIRzlaweNlXsA8MbFpns/WyXYXbE3T+50MnuGVfVsyXU1BxEVk3IZoRela9LFCDfR U+/pHW8+f4i4XFuWxfGekpHmAt08qUVcTvZ9h1g+pCEUBZ7JKghef7/Zms7u/hgMSnxv yKF3ulNm9ORXOjVPWJB7ja0JDncMKZdjsepdaESVxvkIKb5ZHHqMTw1s0ytByLWZyIFo uzcJCU/H5LIKQaxU7dik8ZcWzDyBn9Bg0GsX3Cp9Ec4T5Sg5uuuvlvV/oU7xl2fShnRV 1iTEN+h7l33ZSVA1zVF+8M+afDsjkC0Q2mK+7I6aSJwoHu23hLd3hfA7bBZ+RUWHSUE0 z8jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=JF4c76sI+h5J2OwX5ENMfoC6j5DXu//F/qWIv+iv3q0=; b=oUDJNq49jdlnKVs5WWi+KY1SneTdA/qWGyZN1Pi4EPmzLIgor1UmrfHVaKXYLZhbi5 S1mma+0i6pipsUpAL65sSaUMtNZWov6/s6iAAbWVc10HHL3V224tZVI22b5CqodtbZAk aQvEQ/+y6WrUcwbItW7jJLhIxN+yKaGkGkS3jG+AVk1JVC/5C8B/Hdjj4Nl3CeZCx/oj kOAQM3BqeMXQOJJ9XTsKNkZOaqLWTnhbmxUD3GZNfdSmvUgpc/Q3mWe5Lfd+3WIiM2uy ee84ZoG9PU1ZTv8j2o2UuUXauZUWlZ30saTBq5kda8jcqR77zqdufv6B1mYVGcykVlbL nRLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Gy5p46Tl; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si6752699edi.272.2019.10.31.16.15.24; Thu, 31 Oct 2019 16:15:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Gy5p46Tl; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727624AbfJaWnO (ORCPT + 99 others); Thu, 31 Oct 2019 18:43:14 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:38265 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727611AbfJaWnO (ORCPT ); Thu, 31 Oct 2019 18:43:14 -0400 Received: by mail-yb1-f194.google.com with SMTP id w6so1529775ybj.5 for ; Thu, 31 Oct 2019 15:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=JF4c76sI+h5J2OwX5ENMfoC6j5DXu//F/qWIv+iv3q0=; b=Gy5p46Tl1+G3B5erIQTB/OsufbXW8OXFq6QT9HGnbys4Wwzr+pQdF3ueq1OahMRIQW 2khs0Z+NyXEFqpuw5jeXqFJ8Q0cdnVHNs7vodgj4LOlwNlNIdp6EGOJS8zuAjQUnnacz ror96Sn7kYvPmYVUW4Tjv6kgzY2bAAt5Lgc216f1QtX3EZdD+T+TtDlhglTbH5XbhXYS ONR0sutsi6RpbaMa977MJnZ6kAIy+M4VUDNLo59JSkfdC9/Rqt0gQPAltGrSa2HMeWk+ qoZFimGKPIpvJnl26zBkvP5XBza2Oc02L+vBSXSw8H0wknTq59brs7bKvq3jrRhi3vdV Dk7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JF4c76sI+h5J2OwX5ENMfoC6j5DXu//F/qWIv+iv3q0=; b=LeMOhGfq1y8K3h+D/I9tzlML4n/j6Qtqwp0bBk4x2XYxJy9+oJR4Ud9KsrpdcCAPoG V1k1fJjxO4km8p6BcoUpMri37eLUQfGGA7msDS3E021jQz+oWLUNBi4vS54XAN6wPUpG qWS+AI6I0qLoxxNHhExWgQRfoCvg7d8RtTF64QG5uMycAPSBVM7MAeB8zzy1ESgeRqAY 3EfZ1eKx08+u7kAqb8PXgqAFmrEErR3WkK60t4+Om9uJP1oyqYgp1o481Bw9i78jWC/q xaNagy3wvVqYO1Hg7kCbgyKXghonZRImu15aJYi+gHbeT9oK9E2bIU03zK0T/Q6pMctq Am9Q== X-Gm-Message-State: APjAAAVP0o3If7Q3rY9BVad0drWtYLRQhI8a4OKf9q39rQYWJyqLW35m LWK+MTED4TTwTgBQaWqpz/5h7t4= X-Received: by 2002:a25:7395:: with SMTP id o143mr6734752ybc.190.1572561792910; Thu, 31 Oct 2019 15:43:12 -0700 (PDT) Received: from localhost.localdomain ([50.105.87.1]) by smtp.gmail.com with ESMTPSA id d192sm1720287ywb.3.2019.10.31.15.43.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 15:43:11 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH v2 07/20] NFS: Rename nfs_inode_return_delegation_noreclaim() Date: Thu, 31 Oct 2019 18:40:38 -0400 Message-Id: <20191031224051.8923-8-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191031224051.8923-7-trond.myklebust@hammerspace.com> References: <20191031224051.8923-1-trond.myklebust@hammerspace.com> <20191031224051.8923-2-trond.myklebust@hammerspace.com> <20191031224051.8923-3-trond.myklebust@hammerspace.com> <20191031224051.8923-4-trond.myklebust@hammerspace.com> <20191031224051.8923-5-trond.myklebust@hammerspace.com> <20191031224051.8923-6-trond.myklebust@hammerspace.com> <20191031224051.8923-7-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Rename nfs_inode_return_delegation_noreclaim() to nfs_inode_evict_delegation(), which better describes what it does. Signed-off-by: Trond Myklebust --- fs/nfs/delegation.c | 11 +++++++---- fs/nfs/delegation.h | 2 +- fs/nfs/nfs4super.c | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 630167e243be..0c9339d559f5 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -585,19 +585,22 @@ int nfs_client_return_marked_delegations(struct nfs_client *clp) } /** - * nfs_inode_return_delegation_noreclaim - return delegation, don't reclaim opens + * nfs_inode_evict_delegation - return delegation, don't reclaim opens * @inode: inode to process * * Does not protect against delegation reclaims, therefore really only safe - * to be called from nfs4_clear_inode(). + * to be called from nfs4_clear_inode(). Guaranteed to always free + * the delegation structure. */ -void nfs_inode_return_delegation_noreclaim(struct inode *inode) +void nfs_inode_evict_delegation(struct inode *inode) { struct nfs_delegation *delegation; delegation = nfs_inode_detach_delegation(inode); - if (delegation != NULL) + if (delegation != NULL) { + set_bit(NFS_DELEGATION_INODE_FREEING, &delegation->flags); nfs_do_return_delegation(inode, delegation, 1); + } } /** diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h index 8b14d441e699..74b7fb601365 100644 --- a/fs/nfs/delegation.h +++ b/fs/nfs/delegation.h @@ -43,7 +43,7 @@ void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred, fmode_t type, const nfs4_stateid *stateid, unsigned long pagemod_limit); int nfs4_inode_return_delegation(struct inode *inode); int nfs_async_inode_return_delegation(struct inode *inode, const nfs4_stateid *stateid); -void nfs_inode_return_delegation_noreclaim(struct inode *inode); +void nfs_inode_evict_delegation(struct inode *inode); struct inode *nfs_delegation_find_inode(struct nfs_client *clp, const struct nfs_fh *fhandle); void nfs_server_return_all_delegations(struct nfs_server *); diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 04c57066a11a..2c9cbade561a 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -92,8 +92,8 @@ static void nfs4_evict_inode(struct inode *inode) { truncate_inode_pages_final(&inode->i_data); clear_inode(inode); - /* If we are holding a delegation, return it! */ - nfs_inode_return_delegation_noreclaim(inode); + /* If we are holding a delegation, return and free it */ + nfs_inode_evict_delegation(inode); /* Note that above delegreturn would trigger pnfs return-on-close */ pnfs_return_layout(inode); pnfs_destroy_layout(NFS_I(inode)); -- 2.23.0