From patchwork Wed Feb 6 19:40:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 2107331 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 DE4A9DF2A1 for ; Wed, 6 Feb 2013 20:02:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758575Ab3BFUBt (ORCPT ); Wed, 6 Feb 2013 15:01:49 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:61913 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758228Ab3BFUBq (ORCPT ); Wed, 6 Feb 2013 15:01:46 -0500 Received: by mail-pa0-f44.google.com with SMTP id kp1so999660pab.31 for ; Wed, 06 Feb 2013 12:01:45 -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=gvvZHY8dU1/J41fo8FnV7wHDJ6VezBudoos1H8bm9mg=; b=oVIEmUrsd4Z2C5Dcd3MOSWFFTQhCF+q8zWAhZB9+THW1tYt5sCSMonFu41hEv6vyJM mH8cgRy2CMecXkpEdYpMhppFy3BgSvq1xnH78Dekn6+F9Y6u7JNB/HVSpxcxlHR2KxSe 3tp1SIWn8mIzE6MfiIp6Grj5JYF+XW5bLFuNqDylJcPfG9eska8fLpma0fFBNko8u4WG EbnYzgFWLQZGB9KreMnLvWV41iWJLqygL88yvmMDVfMeCMoocR6aw4lpBNtQ3ePzzEP7 NNj+gYnNw2FOvIeSEsOhrHnWjKaY9iS0nYwq1W3vcQzP0pldmwmUSirelAdQZvqT3Rvs dCEg== X-Received: by 10.66.74.234 with SMTP id x10mr36339912pav.10.1360180288455; Wed, 06 Feb 2013 11:51:28 -0800 (PST) Received: from htj.dyndns.org (c-69-181-251-227.hsd1.ca.comcast.net. [69.181.251.227]) by mx.google.com with ESMTPS id l5sm39989590pax.10.2013.02.06.11.51.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 06 Feb 2013 11:51:27 -0800 (PST) From: Tejun Heo To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Tejun Heo , Trond Myklebust , linux-nfs@vger.kernel.org Subject: [PATCH 77/77] nfs4client: convert to idr_alloc() Date: Wed, 6 Feb 2013 11:40:49 -0800 Message-Id: <1360179649-22465-78-git-send-email-tj@kernel.org> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1360179649-22465-1-git-send-email-tj@kernel.org> References: <1360179649-22465-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 Convert to the much saner new idr interface. Only compile tested. Signed-off-by: Tejun Heo Signed-off-by: Tejun Heo Cc: Trond Myklebust Cc: linux-nfs@vger.kernel.org --- fs/nfs/nfs4client.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 2e9779b..47d1008 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -29,15 +29,14 @@ static int nfs_get_cb_ident_idr(struct nfs_client *clp, int minorversion) if (clp->rpc_ops->version != 4 || minorversion != 0) return ret; -retry: - if (!idr_pre_get(&nn->cb_ident_idr, GFP_KERNEL)) - return -ENOMEM; + idr_preload(GFP_KERNEL); spin_lock(&nn->nfs_client_lock); - ret = idr_get_new(&nn->cb_ident_idr, clp, &clp->cl_cb_ident); + ret = idr_alloc(&nn->cb_ident_idr, clp, 0, 0, GFP_NOWAIT); + if (ret >= 0) + clp->cl_cb_ident = ret; spin_unlock(&nn->nfs_client_lock); - if (ret == -EAGAIN) - goto retry; - return ret; + idr_preload_end(); + return ret < 0 ? ret : 0; } #ifdef CONFIG_NFS_V4_1