From patchwork Tue Mar 5 20:02:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 2221391 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 BFD00DF24C for ; Tue, 5 Mar 2013 20:05:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756547Ab3CEUDL (ORCPT ); Tue, 5 Mar 2013 15:03:11 -0500 Received: from mail-qe0-f52.google.com ([209.85.128.52]:45303 "EHLO mail-qe0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756470Ab3CEUDI (ORCPT ); Tue, 5 Mar 2013 15:03:08 -0500 Received: by mail-qe0-f52.google.com with SMTP id s14so4493369qeb.25 for ; Tue, 05 Mar 2013 12:03:08 -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=8I51UKrSIg3nFed0/B4ETY/+Pr8pnqgZsTv0UMy2xl4=; b=uoLIRToyroewbhrwLjsND/vU6qrnuY4oPJ+BaNZQSXkut//m75WsOF7TvYMJf7b9Yb GDySVkA3vAW2zn3Npt+AWotq9Iavq907PmgNgHX8aSUvDgLYrQohDqRN1B/3IYkkNUJo TC9Fuj/aeZ+H/UpvF27qTZp6d6385yLPx6TRGrOayLEtMUvXSpVL/L1TCDNmSOT/1PMI VUENW/5EMMzTKjyYX10C9mANuSgy/ARosmyS7EQtdZnRUDf69rqGS7f8dx+vpu4OXIkw 4dxSn+DRb2Isl4EwdnTHE6DrJuMN7RkJ9bc8RU1gSXX2pKRRp+ZWpbcjk1L90MpFykDl i1RQ== X-Received: by 10.49.121.196 with SMTP id lm4mr43066871qeb.18.1362513785807; Tue, 05 Mar 2013 12:03:05 -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.03 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Mar 2013 12:03:05 -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 2/7] nfsd: convert to idr_alloc() Date: Tue, 5 Mar 2013 12:02:47 -0800 Message-Id: <1362513772-15174-3-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 idr_get_new*() and friends are about to be deprecated. Convert to the new idr_alloc() interface. Only compile-tested. Signed-off-by: Tejun Heo Cc: "J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Acked-by: J. Bruce Fields --- fs/nfsd/nfs4state.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d91d6db..2e27430 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -242,9 +242,8 @@ kmem_cache *slab) if (!stid) return NULL; - if (!idr_pre_get(stateids, GFP_KERNEL)) - goto out_free; - if (idr_get_new_above(stateids, stid, min_stateid, &new_id)) + new_id = idr_alloc(stateids, stid, min_stateid, 0, GFP_KERNEL); + if (new_id < 0) goto out_free; stid->sc_client = cl; stid->sc_type = 0;