forked from Minki/linux
nfs4client: convert to idr_alloc()
Convert to the much saner new idr interface. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
94960e8c2e
commit
d687031265
@ -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)
|
if (clp->rpc_ops->version != 4 || minorversion != 0)
|
||||||
return ret;
|
return ret;
|
||||||
retry:
|
idr_preload(GFP_KERNEL);
|
||||||
if (!idr_pre_get(&nn->cb_ident_idr, GFP_KERNEL))
|
|
||||||
return -ENOMEM;
|
|
||||||
spin_lock(&nn->nfs_client_lock);
|
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);
|
spin_unlock(&nn->nfs_client_lock);
|
||||||
if (ret == -EAGAIN)
|
idr_preload_end();
|
||||||
goto retry;
|
return ret < 0 ? ret : 0;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NFS_V4_1
|
#ifdef CONFIG_NFS_V4_1
|
||||||
|
Loading…
Reference in New Issue
Block a user