From patchwork Mon Oct 14 10:44:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 3035341 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EF0FEBF924 for ; Mon, 14 Oct 2013 10:46:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED29120161 for ; Mon, 14 Oct 2013 10:46:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B02FD2014A for ; Mon, 14 Oct 2013 10:46:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932070Ab3JNKqv (ORCPT ); Mon, 14 Oct 2013 06:46:51 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:44741 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755951Ab3JNKo6 (ORCPT ); Mon, 14 Oct 2013 06:44:58 -0400 Received: by mail-wi0-f170.google.com with SMTP id l12so3809848wiv.1 for ; Mon, 14 Oct 2013 03:44:57 -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=UwubvpUL7p7MmWyEvRSDGDABHp7WM2uyVI/EEAJstEY=; b=ypg0sQP194y1jeFW36lDP2UoVoNGHi58ApN5sIx7vJrMXQTCZcXhP+wNAi4SjVJ9OX 93OWmA8LEcEfuP/K8HOM6XW7iAzuj5m4zq7IgPrUGr0+yEW0vaAM26yIt+hvTxOtP1BX x6ORcQZkJROKgQP7e5vXwV2s9R5neEUOLYG8XgFg1VNc+xGpofHlo2Z1EtmpGlE4cgLP 8Mxt05cTaxMCZVKpx+iJR8Uv262p6FbkSgmb4LAvY9QCCI0KzovyU42V70Cx3w8rZndW kl9O+wLwY+wvRNzh59Jo8Y2F2pmbgukHIV2KR94cXFQEhJWtV95VeUe+WTkYzbRpXSM8 YP6A== X-Received: by 10.180.187.175 with SMTP id ft15mr14246500wic.20.1381747497299; Mon, 14 Oct 2013 03:44:57 -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 gp9sm32950583wib.8.2013.10.14.03.44.54 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Mon, 14 Oct 2013 03:44:55 -0700 (PDT) From: Benny Halevy To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org, Benny Halevy Subject: [PATCH v2] nfsd: nfs4_free_stid Date: Mon, 14 Oct 2013 13:44:52 +0300 Message-Id: <1381747492-14026-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1381730691-18105-1-git-send-email-bhalevy@primarydata.com> References: <1381730691-18105-1-git-send-email-bhalevy@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 Make it symmetric to nfs4_alloc_stid. Signed-off-by: Benny Halevy --- fs/nfsd/nfs4state.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 06984e3..64c167f 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -402,11 +402,16 @@ static void remove_stid(struct nfs4_stid *s) idr_remove(stateids, s->sc_stateid.si_opaque.so_id); } +static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s) +{ + kmem_cache_free(slab, s); +} + void nfs4_put_delegation(struct nfs4_delegation *dp) { if (atomic_dec_and_test(&dp->dl_count)) { - kmem_cache_free(deleg_slab, dp); + nfs4_free_stid(deleg_slab, &dp->dl_stid); num_delegations--; } } @@ -610,7 +615,7 @@ static void close_generic_stateid(struct nfs4_ol_stateid *stp) static void free_generic_stateid(struct nfs4_ol_stateid *stp) { remove_stid(&stp->st_stid); - kmem_cache_free(stateid_slab, stp); + nfs4_free_stid(stateid_slab, &stp->st_stid); } static void release_lock_stateid(struct nfs4_ol_stateid *stp)