SUNRPC: Directly use ida_alloc()/free()
Use ida_alloc()/ida_free() instead of ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Bo Liu <liubo03@inspur.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
f76349cf41
commit
9947e57b22
net/sunrpc
|
@ -345,7 +345,7 @@ static int rpc_alloc_clid(struct rpc_clnt *clnt)
|
||||||
{
|
{
|
||||||
int clid;
|
int clid;
|
||||||
|
|
||||||
clid = ida_simple_get(&rpc_clids, 0, 0, GFP_KERNEL);
|
clid = ida_alloc(&rpc_clids, GFP_KERNEL);
|
||||||
if (clid < 0)
|
if (clid < 0)
|
||||||
return clid;
|
return clid;
|
||||||
clnt->cl_clid = clid;
|
clnt->cl_clid = clid;
|
||||||
|
@ -354,7 +354,7 @@ static int rpc_alloc_clid(struct rpc_clnt *clnt)
|
||||||
|
|
||||||
static void rpc_free_clid(struct rpc_clnt *clnt)
|
static void rpc_free_clid(struct rpc_clnt *clnt)
|
||||||
{
|
{
|
||||||
ida_simple_remove(&rpc_clids, clnt->cl_clid);
|
ida_free(&rpc_clids, clnt->cl_clid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args,
|
static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args,
|
||||||
|
|
|
@ -1788,7 +1788,7 @@ static int xprt_alloc_id(struct rpc_xprt *xprt)
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
id = ida_simple_get(&rpc_xprt_ids, 0, 0, GFP_KERNEL);
|
id = ida_alloc(&rpc_xprt_ids, GFP_KERNEL);
|
||||||
if (id < 0)
|
if (id < 0)
|
||||||
return id;
|
return id;
|
||||||
|
|
||||||
|
@ -1798,7 +1798,7 @@ static int xprt_alloc_id(struct rpc_xprt *xprt)
|
||||||
|
|
||||||
static void xprt_free_id(struct rpc_xprt *xprt)
|
static void xprt_free_id(struct rpc_xprt *xprt)
|
||||||
{
|
{
|
||||||
ida_simple_remove(&rpc_xprt_ids, xprt->id);
|
ida_free(&rpc_xprt_ids, xprt->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct rpc_xprt *xprt_alloc(struct net *net, size_t size,
|
struct rpc_xprt *xprt_alloc(struct net *net, size_t size,
|
||||||
|
|
|
@ -103,7 +103,7 @@ static int xprt_switch_alloc_id(struct rpc_xprt_switch *xps, gfp_t gfp_flags)
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
id = ida_simple_get(&rpc_xprtswitch_ids, 0, 0, gfp_flags);
|
id = ida_alloc(&rpc_xprtswitch_ids, gfp_flags);
|
||||||
if (id < 0)
|
if (id < 0)
|
||||||
return id;
|
return id;
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ static int xprt_switch_alloc_id(struct rpc_xprt_switch *xps, gfp_t gfp_flags)
|
||||||
|
|
||||||
static void xprt_switch_free_id(struct rpc_xprt_switch *xps)
|
static void xprt_switch_free_id(struct rpc_xprt_switch *xps)
|
||||||
{
|
{
|
||||||
ida_simple_remove(&rpc_xprtswitch_ids, xps->xps_id);
|
ida_free(&rpc_xprtswitch_ids, xps->xps_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue