summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2013-06-14 10:34:34 -0700
committerKent Overstreet <koverstreet@google.com>2013-06-14 15:55:34 -0700
commit051e7984c5360c55784150d204f6dd425de1f2d2 (patch)
treea75a74e0dbd77f3740404f83511a23d5dca312f4
parent9b1a1a53a37f1a377ffde822dbf6b1585641dac7 (diff)
ida_simple_get() -> ida_get_range()
-rw-r--r--arch/powerpc/mm/icswx_pid.c2
-rw-r--r--arch/powerpc/mm/mmu_context_hash64.c2
-rw-r--r--drivers/block/virtio_blk.c2
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c2
-rw-r--r--drivers/input/input.c8
-rw-r--r--drivers/ptp/ptp_clock.c2
-rw-r--r--drivers/watchdog/watchdog_core.c4
-rw-r--r--fs/devpts/inode.c2
-rw-r--r--fs/namespace.c2
-rw-r--r--fs/proc/generic.c2
-rw-r--r--fs/super.c3
-rw-r--r--fs/sysfs/dir.c2
-rw-r--r--include/linux/idr.h6
-rw-r--r--kernel/cgroup.c2
-rw-r--r--lib/idr.c10
-rw-r--r--mm/memcontrol.c2
-rw-r--r--net/bluetooth/hci_core.c2
-rw-r--r--net/core/net_namespace.c2
18 files changed, 27 insertions, 30 deletions
diff --git a/arch/powerpc/mm/icswx_pid.c b/arch/powerpc/mm/icswx_pid.c
index b80f877e644a..32343e0ff76f 100644
--- a/arch/powerpc/mm/icswx_pid.c
+++ b/arch/powerpc/mm/icswx_pid.c
@@ -27,7 +27,7 @@ static DEFINE_IDA(cop_ida);
static int new_cop_pid(struct ida *ida)
{
- return ida_simple_get(ida, COP_PID_MIN, COP_PID_MAX, GFP_KERNEL);
+ return ida_get_range(ida, COP_PID_MIN, COP_PID_MAX, GFP_KERNEL);
}
int get_cop_pid(struct mm_struct *mm)
diff --git a/arch/powerpc/mm/mmu_context_hash64.c b/arch/powerpc/mm/mmu_context_hash64.c
index 2a544152e4fb..2efac6cd4372 100644
--- a/arch/powerpc/mm/mmu_context_hash64.c
+++ b/arch/powerpc/mm/mmu_context_hash64.c
@@ -31,7 +31,7 @@ static DEFINE_IDA(mmu_context_ida);
int __init_new_context(void)
{
- return ida_simple_get(ida, 1, MAX_USER_CONTEXT, GFP_KERNEL);
+ return ida_get_range(ida, 1, MAX_USER_CONTEXT, GFP_KERNEL);
}
EXPORT_SYMBOL_GPL(__init_new_context);
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 5dbd5389ca85..a1a48ec004ff 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -692,7 +692,7 @@ static int virtblk_probe(struct virtio_device *vdev)
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),
+ err = ida_get_range(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),
GFP_KERNEL);
if (err < 0)
goto out;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
index aa6ef6f548f3..ef9f81e87654 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
@@ -64,7 +64,7 @@ static int vmw_gmrid_man_get_node(struct ttm_mem_type_manager *man,
}
spin_unlock(&gman->lock);
- ret = ida_simple_get(&gman->gmr_ida, 0, gman->max_gmr_ids, GFP_KERNEL);
+ ret = ida_get_range(&gman->gmr_ida, 0, gman->max_gmr_ids, GFP_KERNEL);
spin_lock(&gman->lock);
if (ret < 0)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 982a82b72059..9f3df7a226d5 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -2329,17 +2329,15 @@ int input_get_new_minor(int legacy_base, unsigned int legacy_num,
* locking is needed here.
*/
if (legacy_base >= 0) {
- int minor = ida_simple_get(&input_ida,
- legacy_base,
+ int minor = ida_get_range(&input_ida, legacy_base,
legacy_base + legacy_num,
GFP_KERNEL);
if (minor >= 0 || !allow_dynamic)
return minor;
}
- return ida_simple_get(&input_ida,
- INPUT_FIRST_DYNAMIC_DEV, INPUT_MAX_CHAR_DEVICES,
- GFP_KERNEL);
+ return ida_get_range(&input_ida, INPUT_FIRST_DYNAMIC_DEV,
+ INPUT_MAX_CHAR_DEVICES, GFP_KERNEL);
}
EXPORT_SYMBOL(input_get_new_minor);
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index e5cf7b6c6d65..d74fd38c8424 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -190,7 +190,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
if (ptp == NULL)
goto no_memory;
- index = ida_simple_get(&ptp_clocks_map, 0, MINORMASK + 1, GFP_KERNEL);
+ index = ida_get_range(&ptp_clocks_map, 0, MINORMASK + 1, GFP_KERNEL);
if (index < 0) {
err = index;
goto no_slot;
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index 66199f271609..8420a95c14ac 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -128,7 +128,7 @@ int watchdog_register_device(struct watchdog_device *wdd)
*/
mutex_init(&wdd->lock);
- id = ida_simple_get(&watchdog_ida, 0, MAX_DOGS, GFP_KERNEL);
+ id = ida_get_range(&watchdog_ida, 0, MAX_DOGS, GFP_KERNEL);
if (id < 0)
return id;
wdd->id = id;
@@ -140,7 +140,7 @@ int watchdog_register_device(struct watchdog_device *wdd)
return ret;
/* Retry in case a legacy watchdog module exists */
- id = ida_simple_get(&watchdog_ida, 1, MAX_DOGS, GFP_KERNEL);
+ id = ida_get_range(&watchdog_ida, 1, MAX_DOGS, GFP_KERNEL);
if (id < 0)
return id;
wdd->id = id;
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index c85f365c13af..e2a4ea3870ab 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -522,7 +522,7 @@ int devpts_new_index(struct inode *ptmx_inode)
struct pts_fs_info *fsi = DEVPTS_SB(sb);
int index;
- index = ida_simple_get(&fsi->allocated_ptys, 0,
+ index = ida_get_range(&fsi->allocated_ptys, 0,
fsi->mount_opts.max, GFP_KERNEL);
if (index < 0)
return index;
diff --git a/fs/namespace.c b/fs/namespace.c
index 001e4762b655..ce6a9a1cb300 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -88,7 +88,7 @@ static void mnt_free_id(struct mount *mnt)
*/
static int mnt_alloc_group_id(struct mount *mnt)
{
- int res = ida_simple_get(&mnt_id_ida, 1, 0, GFP_KERNEL);
+ int res = ida_get_range(&mnt_id_ida, 1, 0, GFP_KERNEL);
if (res < 0)
return res;
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 3d5e78e06f9a..bd15a4d013e6 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -129,7 +129,7 @@ static DEFINE_IDA(proc_inum_ida);
*/
int proc_alloc_inum(unsigned int *inum)
{
- int i = ida_simple_get(&proc_inum_ida, 0,
+ int i = ida_get_range(&proc_inum_ida, 0,
UINT_MAX - PROC_DYNAMIC_FIRST,
GFP_KERNEL);
if (i < 0)
diff --git a/fs/super.c b/fs/super.c
index 9c2febd1c56a..4c8401067155 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -823,8 +823,7 @@ int get_anon_bdev(dev_t *p)
{
int dev;
- dev = ida_simple_get(&unnamed_dev_ida, 0,
- 1 << MINORBITS, GFP_ATOMIC);
+ dev = ida_get_range(&unnamed_dev_ida, 0, 1 << MINORBITS, GFP_ATOMIC);
if (dev == -ENOSPC)
return -EMFILE;
if (dev < 0)
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 4bb747eb2b64..d7c8896da5ea 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -233,7 +233,7 @@ static void sysfs_deactivate(struct sysfs_dirent *sd)
static int sysfs_alloc_ino(unsigned int *pino)
{
- return ida_simple_get(&sysfs_ino_ida, 2, 0, GFP_KERNEL);
+ return ida_get_range(&sysfs_ino_ida, 2, 0, GFP_KERNEL);
}
static void sysfs_free_ino(unsigned int ino)
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 6f519dc66d72..6e597a3478c3 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -223,12 +223,12 @@ void ida_remove(struct ida *ida, unsigned id);
void ida_destroy(struct ida *ida);
void ida_init(struct ida *ida);
-int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
- gfp_t gfp_mask);
+int ida_get_range(struct ida *ida, unsigned int start,
+ unsigned int end, gfp_t gfp_mask);
static inline int ida_get(struct ida *ida, gfp_t gfp_mask)
{
- return ida_simple_get(ida, 0, 0, gfp_mask);
+ return ida_get_range(ida, 0, 0, gfp_mask);
}
void __init idr_init_cache(void);
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3ed66110e9ee..72ff87b1a88b 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4100,7 +4100,7 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
goto err_free_cgrp;
rcu_assign_pointer(cgrp->name, name);
- cgrp->id = ida_simple_get(&root->cgroup_ida, 1, 0, GFP_KERNEL);
+ cgrp->id = ida_get_range(&root->cgroup_ida, 1, 0, GFP_KERNEL);
if (cgrp->id < 0)
goto err_free_name;
diff --git a/lib/idr.c b/lib/idr.c
index 647e56b39052..864735a9955c 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -1073,7 +1073,7 @@ void ida_destroy(struct ida *ida)
EXPORT_SYMBOL(ida_destroy);
/**
- * ida_simple_get - get a new id.
+ * ida_get_range - get a new id.
* @ida: the (initialized) ida.
* @start: the minimum id (inclusive, < 0x8000000)
* @end: the maximum id (exclusive, < 0x8000000 or 0)
@@ -1084,8 +1084,8 @@ EXPORT_SYMBOL(ida_destroy);
*
* Use ida_remove() to get rid of an id.
*/
-int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
- gfp_t gfp_mask)
+int ida_get_range(struct ida *ida, unsigned int start,
+ unsigned int end, gfp_t gfp_mask)
{
int ret, id;
unsigned int max;
@@ -1122,12 +1122,12 @@ again:
return ret;
}
-EXPORT_SYMBOL(ida_simple_get);
+EXPORT_SYMBOL(ida_get_range);
/**
* ida_remove - remove an allocated id.
* @ida: the (initialized) ida.
- * @id: the id returned by ida_simple_get.
+ * @id: the id returned by ida_get_range.
*/
void ida_remove(struct ida *ida, unsigned int id)
{
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 8d8b6658ca08..8a6f8501235d 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3068,7 +3068,7 @@ int memcg_update_cache_sizes(struct mem_cgroup *memcg)
{
int num, ret;
- num = ida_simple_get(&kmem_limited_groups,
+ num = ida_get_range(&kmem_limited_groups,
0, MEMCG_CACHES_MAX_SIZE, GFP_KERNEL);
if (num < 0)
return num;
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index b96e38f53bda..3c61df94f63d 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2184,7 +2184,7 @@ int hci_register_dev(struct hci_dev *hdev)
id = ida_get(&hci_index_ida, GFP_KERNEL);
break;
case HCI_AMP:
- id = ida_simple_get(&hci_index_ida, 1, 0, GFP_KERNEL);
+ id = ida_get_range(&hci_index_ida, 1, 0, GFP_KERNEL);
break;
default:
return -EINVAL;
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 899a976cafdd..fec5a7f59d05 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -500,7 +500,7 @@ static int register_pernet_operations(struct list_head *list,
int error;
if (ops->id) {
- int id = ida_simple_get(&net_generic_ids, 1, 0, GFP_KERNEL);
+ int id = ida_get_range(&net_generic_ids, 1, 0, GFP_KERNEL);
if (id < 0)
return id;