projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
inotify: convert inotify_add_to_idr() to use idr_alloc_cyclic()
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
fs
/
notify
/
inotify
/
inotify_user.c
diff --git
a/fs/notify/inotify/inotify_user.c
b/fs/notify/inotify/inotify_user.c
index
e0f7c12
..
8562bd3
100644
(file)
--- a/
fs/notify/inotify/inotify_user.c
+++ b/
fs/notify/inotify/inotify_user.c
@@
-359,7
+359,6
@@
static int inotify_find_inode(const char __user *dirname, struct path *path, uns
}
static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock,
}
static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock,
- int *last_wd,
struct inotify_inode_mark *i_mark)
{
int ret;
struct inotify_inode_mark *i_mark)
{
int ret;
@@
-367,11
+366,10
@@
static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock,
idr_preload(GFP_KERNEL);
spin_lock(idr_lock);
idr_preload(GFP_KERNEL);
spin_lock(idr_lock);
- ret = idr_alloc
(idr, i_mark, *last_wd +
1, 0, GFP_NOWAIT);
+ ret = idr_alloc
_cyclic(idr, i_mark,
1, 0, GFP_NOWAIT);
if (ret >= 0) {
/* we added the mark to the idr, take a reference */
i_mark->wd = ret;
if (ret >= 0) {
/* we added the mark to the idr, take a reference */
i_mark->wd = ret;
- *last_wd = i_mark->wd;
fsnotify_get_mark(&i_mark->fsn_mark);
}
fsnotify_get_mark(&i_mark->fsn_mark);
}
@@
-638,8
+636,7
@@
static int inotify_new_watch(struct fsnotify_group *group,
if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches)
goto out_err;
if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches)
goto out_err;
- ret = inotify_add_to_idr(idr, idr_lock, &group->inotify_data.last_wd,
- tmp_i_mark);
+ ret = inotify_add_to_idr(idr, idr_lock, tmp_i_mark);
if (ret)
goto out_err;
if (ret)
goto out_err;
@@
-697,7
+694,6
@@
static struct fsnotify_group *inotify_new_group(unsigned int max_events)
spin_lock_init(&group->inotify_data.idr_lock);
idr_init(&group->inotify_data.idr);
spin_lock_init(&group->inotify_data.idr_lock);
idr_init(&group->inotify_data.idr);
- group->inotify_data.last_wd = 0;
group->inotify_data.user = get_current_user();
if (atomic_inc_return(&group->inotify_data.user->inotify_devs) >
group->inotify_data.user = get_current_user();
if (atomic_inc_return(&group->inotify_data.user->inotify_devs) >