From patchwork Tue Oct 15 06:58:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 3043641 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8A6869F2B6 for ; Tue, 15 Oct 2013 06:58:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39F9720263 for ; Tue, 15 Oct 2013 06:58:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D47E20266 for ; Tue, 15 Oct 2013 06:58:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753832Ab3JOG6F (ORCPT ); Tue, 15 Oct 2013 02:58:05 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:59938 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206Ab3JOG6E (ORCPT ); Tue, 15 Oct 2013 02:58:04 -0400 Received: by mail-wg0-f44.google.com with SMTP id n12so6963209wgh.11 for ; Mon, 14 Oct 2013 23:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CvOobB67ZIGqinrGE2++zHcIXkfCTBT5bs73IF/Sx+U=; b=eFvCj/PEPNaugaTaIAfxPyXj1Ef5jsEZlHt0CeyeZBasiHsMG0MxN0eV8eLIfJ57bg vH4FQub96fWBNxc3d9aMRzBwo7e3z5pD/hig9tFy7fFoB2IBUdPQiopGMsXg80cJ3/f8 8xK4nmqqHVUB1LhQbfKIueLD124f+pZ7BkGaMUqyTQxvkHM3VNRLW940G6KOm2y44cg3 B4wNR0y+lTz+7seZrjwHy1+gC7q0dagImohYhipYYCBAyLOpXaNdtoyMxqESzVso31KC NawVcebWVmxW+rc2JZqN6HvJVc/dEX+0b4OnNuNM4BCgujqwz6SSKio8XYwtvdKVLaEB gK/g== X-Received: by 10.180.20.46 with SMTP id k14mr17922795wie.39.1381820283381; Mon, 14 Oct 2013 23:58:03 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com (bzq-80-49-130.static.bezeqint.net. [82.80.49.130]) by mx.google.com with ESMTPSA id s4sm3145404wiy.1.2013.10.14.23.58.01 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Mon, 14 Oct 2013 23:58:02 -0700 (PDT) From: Benny Halevy To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org, Benny Halevy Subject: [PATCH 2/2] nfsd: remove_stid can be incorporated into nfs4_put_delegation Date: Tue, 15 Oct 2013 09:58:00 +0300 Message-Id: <1381820280-14120-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <525CE711.1040107@primarydata.com> References: <525CE711.1040107@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All calls to nfs4_put_delegation are preceded with remove_stid. Signed-off-by: Benny Halevy --- fs/nfsd/nfs4state.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index b8f3c7e..93160b6 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -410,6 +410,7 @@ static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s) void nfs4_put_delegation(struct nfs4_delegation *dp) { + remove_stid(&dp->dl_stid); if (atomic_dec_and_test(&dp->dl_count)) { nfs4_free_stid(deleg_slab, &dp->dl_stid); num_delegations--; @@ -450,14 +451,12 @@ static void unhash_stid(struct nfs4_stid *s) static void destroy_revoked_delegation(struct nfs4_delegation *dp) { list_del_init(&dp->dl_recall_lru); - remove_stid(&dp->dl_stid); nfs4_put_delegation(dp); } static void destroy_delegation(struct nfs4_delegation *dp) { unhash_delegation(dp); - remove_stid(&dp->dl_stid); nfs4_put_delegation(dp); } @@ -3157,7 +3156,6 @@ static void nfsd4_open_deleg_none_ext(struct nfsd4_open *open, int status) open->op_delegate_type = NFS4_OPEN_DELEGATE_READ; return; out_free: - remove_stid(&dp->dl_stid); nfs4_put_delegation(dp); out_no_deleg: open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE;