diff mbox

[2/7] nfsd: convert to idr_alloc()

Message ID 1362513772-15174-3-git-send-email-tj@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Tejun Heo March 5, 2013, 8:02 p.m. UTC
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 <tj@kernel.org>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org
---
 fs/nfsd/nfs4state.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

J. Bruce Fields March 5, 2013, 10:31 p.m. UTC | #1
On Tue, Mar 05, 2013 at 12:02:47PM -0800, Tejun Heo wrote:
> idr_get_new*() and friends are about to be deprecated.  Convert to the
> new idr_alloc() interface.
> 
> Only compile-tested.

Runs fine too--thanks.

Acked-by: J. Bruce Fields <bfields@redhat.com>

--b.

> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: "J. Bruce Fields" <bfields@fieldses.org>
> Cc: linux-nfs@vger.kernel.org
> ---
>  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;
> -- 
> 1.8.1.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;