From patchwork Fri Sep 21 01:35:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 1488711 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A58F1DF2D2 for ; Fri, 21 Sep 2012 01:36:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754833Ab2IUBgf (ORCPT ); Thu, 20 Sep 2012 21:36:35 -0400 Received: from mx2.netapp.com ([216.240.18.37]:26053 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754713Ab2IUBgJ (ORCPT ); Thu, 20 Sep 2012 21:36:09 -0400 X-IronPort-AV: E=Sophos;i="4.80,458,1344236400"; d="scan'208";a="692166529" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 20 Sep 2012 18:36:09 -0700 Received: from lade.trondhjem.org.com (lade.trondhjem.org [10.63.233.1] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id q8L1a0c9022580; Thu, 20 Sep 2012 18:36:08 -0700 (PDT) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 11/14] NFSv4.1: Clean up pnfs_put_lseg() Date: Thu, 20 Sep 2012 21:35:54 -0400 Message-Id: <1348191357-44503-11-git-send-email-Trond.Myklebust@netapp.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348191357-44503-10-git-send-email-Trond.Myklebust@netapp.com> References: <1348191357-44503-1-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-2-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-3-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-4-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-5-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-6-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-7-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-8-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-9-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-10-git-send-email-Trond.Myklebust@netapp.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org There is no longer a need to use pnfs_free_lseg_list(). Just call pnfs_free_lseg() directly. Signed-off-by: Trond Myklebust --- fs/nfs/pnfs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 557faaf..ed8d674 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -290,7 +290,7 @@ init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg) lseg->pls_layout = lo; } -static void free_lseg(struct pnfs_layout_segment *lseg) +static void pnfs_free_lseg(struct pnfs_layout_segment *lseg) { struct inode *ino = lseg->pls_layout->plh_inode; @@ -327,12 +327,9 @@ pnfs_put_lseg(struct pnfs_layout_segment *lseg) lo = lseg->pls_layout; inode = lo->plh_inode; if (atomic_dec_and_lock(&lseg->pls_refcount, &inode->i_lock)) { - LIST_HEAD(free_me); - pnfs_layout_remove_lseg(lo, lseg); spin_unlock(&inode->i_lock); - list_add(&lseg->pls_list, &free_me); - pnfs_free_lseg_list(&free_me); + pnfs_free_lseg(lseg); } } EXPORT_SYMBOL_GPL(pnfs_put_lseg); @@ -469,7 +466,7 @@ pnfs_free_lseg_list(struct list_head *free_me) list_for_each_entry_safe(lseg, tmp, free_me, pls_list) { list_del(&lseg->pls_list); - free_lseg(lseg); + pnfs_free_lseg(lseg); } }