From patchwork Tue Mar 5 20:02:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 2221401 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 59D79DF24C for ; Tue, 5 Mar 2013 20:05:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756153Ab3CEUDF (ORCPT ); Tue, 5 Mar 2013 15:03:05 -0500 Received: from mail-qc0-f175.google.com ([209.85.216.175]:58147 "EHLO mail-qc0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244Ab3CEUDE (ORCPT ); Tue, 5 Mar 2013 15:03:04 -0500 Received: by mail-qc0-f175.google.com with SMTP id j3so1236624qcs.6 for ; Tue, 05 Mar 2013 12:03:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=THQSsLIZG6cA9WhFKtgeGTwb132TscCe2xEaMjDTXoU=; b=e8B30agN4zH+9UF1R+e+9PK/+b+jVjdxXuWBln988v8irG5rjLeYNcbjTWdCfUVfhF yrWwwfyVTw+DaBGHTg69M7dbXLkV/tknXihc1sN43WPj8e2qAe3x2VxC1dCpRTRO5EYI pIlPhNPJvyvVRVj13F8l60YQ3orAUJ0gegKr3hoT8NP4pt/xV9j7RhWrds8SXPwTq7Je oOd7Ewcx5+8Ck15QREEYFmN5Q/+nUZVB5dCNZC4masP90IuO0ibLq8WcKpbiFTUO3sX5 Qsd2zl3Q0ozp/sL7BtjfhOkdejj6ODhEpdChuOZ1FwRA9ZXEMG5uE1Z1CeK+Vp3fXXHl LjeA== X-Received: by 10.49.127.180 with SMTP id nh20mr44214578qeb.19.1362513783245; Tue, 05 Mar 2013 12:03:03 -0800 (PST) Received: from htj.dyndns.org.com (c-69-181-251-227.hsd1.ca.comcast.net. [69.181.251.227]) by mx.google.com with ESMTPS id fr4sm44451154qab.3.2013.03.05.12.03.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Mar 2013 12:03:02 -0800 (PST) From: Tejun Heo To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, bfields@fieldses.org, jackm@dev.mellanox.co.il, ogerlitz@mellanox.com, roland@purestorage.com, dan.magenheimer@oracle.com, gregkh@linuxfoundation.org, vjaquez@igalia.com, rene.sapiens@ti.com, x0095078@ti.com, omar.ramirez@ti.com, Tejun Heo , linux-nfs@vger.kernel.org Subject: [PATCH 1/7] nfsd: remove unused get_new_stid() Date: Tue, 5 Mar 2013 12:02:46 -0800 Message-Id: <1362513772-15174-2-git-send-email-tj@kernel.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1362513772-15174-1-git-send-email-tj@kernel.org> References: <1362513772-15174-1-git-send-email-tj@kernel.org> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org get_new_stid() is no longer used since 3abdb607125 ("nfsd4: simplify idr allocation"). Remove it. Signed-off-by: Tejun Heo Cc: "J. Bruce Fields" Cc: linux-nfs@vger.kernel.org --- fs/nfsd/nfs4state.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 16d39c6..d91d6db 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -230,37 +230,6 @@ static void nfs4_file_put_access(struct nfs4_file *fp, int oflag) __nfs4_file_put_access(fp, oflag); } -static inline int get_new_stid(struct nfs4_stid *stid) -{ - static int min_stateid = 0; - struct idr *stateids = &stid->sc_client->cl_stateids; - int new_stid; - int error; - - error = idr_get_new_above(stateids, stid, min_stateid, &new_stid); - /* - * Note: the necessary preallocation was done in - * nfs4_alloc_stateid(). The idr code caps the number of - * preallocations that can exist at a time, but the state lock - * prevents anyone from using ours before we get here: - */ - WARN_ON_ONCE(error); - /* - * It shouldn't be a problem to reuse an opaque stateid value. - * I don't think it is for 4.1. But with 4.0 I worry that, for - * example, a stray write retransmission could be accepted by - * the server when it should have been rejected. Therefore, - * adopt a trick from the sctp code to attempt to maximize the - * amount of time until an id is reused, by ensuring they always - * "increase" (mod INT_MAX): - */ - - min_stateid = new_stid+1; - if (min_stateid == INT_MAX) - min_stateid = 0; - return new_stid; -} - static struct nfs4_stid *nfs4_alloc_stid(struct nfs4_client *cl, struct kmem_cache *slab) {