diff options
author | Matthew Wilcox <willy@infradead.org> | 2018-06-17 05:37:08 -0400 |
---|---|---|
committer | Matthew Wilcox <willy@infradead.org> | 2018-08-21 23:54:18 -0400 |
commit | 6e77cc471090a2f37802cb328bffe4ce56f4ce18 (patch) | |
tree | 3e67ca59805556a39b7bc754c8909c982a66f859 /net | |
parent | 4c9ca2fd7c402c8eab6e949899af04bc3c249b2b (diff) | |
download | linux-6e77cc471090a2f37802cb328bffe4ce56f4ce18.tar.gz linux-6e77cc471090a2f37802cb328bffe4ce56f4ce18.tar.bz2 linux-6e77cc471090a2f37802cb328bffe4ce56f4ce18.zip |
Convert net_namespace to new IDA API
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/net_namespace.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index a11e03f920d3..f447cebdcea3 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -973,22 +973,18 @@ static int register_pernet_operations(struct list_head *list, int error; if (ops->id) { -again: - error = ida_get_new_above(&net_generic_ids, MIN_PERNET_OPS_ID, ops->id); - if (error < 0) { - if (error == -EAGAIN) { - ida_pre_get(&net_generic_ids, GFP_KERNEL); - goto again; - } + error = ida_alloc_min(&net_generic_ids, MIN_PERNET_OPS_ID, + GFP_KERNEL); + if (error < 0) return error; - } + *ops->id = error; max_gen_ptrs = max(max_gen_ptrs, *ops->id + 1); } error = __register_pernet_operations(list, ops); if (error) { rcu_barrier(); if (ops->id) - ida_remove(&net_generic_ids, *ops->id); + ida_free(&net_generic_ids, *ops->id); } return error; @@ -999,7 +995,7 @@ static void unregister_pernet_operations(struct pernet_operations *ops) __unregister_pernet_operations(ops); rcu_barrier(); if (ops->id) - ida_remove(&net_generic_ids, *ops->id); + ida_free(&net_generic_ids, *ops->id); } /** |