From patchwork Thu Sep 26 18:41:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950291 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 ED02D9F288 for ; Thu, 26 Sep 2013 18:41:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F3A6B202DD for ; Thu, 26 Sep 2013 18:41:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4E9D20164 for ; Thu, 26 Sep 2013 18:41:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753078Ab3IZSlY (ORCPT ); Thu, 26 Sep 2013 14:41:24 -0400 Received: from mail-qe0-f53.google.com ([209.85.128.53]:49331 "EHLO mail-qe0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440Ab3IZSlY (ORCPT ); Thu, 26 Sep 2013 14:41:24 -0400 Received: by mail-qe0-f53.google.com with SMTP id jy17so1105917qeb.26 for ; Thu, 26 Sep 2013 11:41:23 -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=BjOms6vi6VfhS33HnD17by8+p+8jq7HBz53g6ukMuuY=; b=DZcSd4jH7uCvtfmI3C2Sz2zUlyy+fmnZSRYl194TBllFldo/rC37HbOcrzfRiVfYeq Iz6iUbrPCmoJG1icqdslKO/24FQdeHjdHO1EZT7axMinq3bV0GlAzbCdLGTL7QXdcyL3 tC/v1tzlU5m4LLNQk9TLcTb4EhYzSzBaNRy//i2mdFZL1I7+FGs683rNc6Lj2tMyOeIg uaukrKXW04cI7VSYhM0XfYcRJB9Qjad0jE6FXMdV8WvZDnRpTxdjibx4647jO4/PiIcI CZRAYjloRIDUukO5N88tZFoGKzKJ08ftv3NY4fWEQ/JUOBUvieSixBN1cuiigQNuuSPi WWag== X-Received: by 10.229.127.74 with SMTP id f10mr3672183qcs.16.1380220883628; Thu, 26 Sep 2013 11:41:23 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com.com (nat-pool-bos-u.redhat.com. [66.187.233.207]) by mx.google.com with ESMTPSA id a2sm5114144qek.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:41:23 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 22/49] nfsd: cleanup free_stid Date: Thu, 26 Sep 2013 14:41:21 -0400 Message-Id: <1380220881-13687-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <52447EA0.7070004@primarydata.com> References: <52447EA0.7070004@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=-9.2 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 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 214e42d..099976e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -411,11 +411,16 @@ static void remove_stid(struct nfs4_stid *s) idr_remove(stateids, s->sc_stateid.si_opaque.so_id); } +static void 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); + free_stid(deleg_slab, &dp->dl_stid); num_delegations--; } } @@ -619,7 +624,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); + free_stid(stateid_slab, &stp->st_stid); } static void release_lock_stateid(struct nfs4_ol_stateid *stp)