]> git.karo-electronics.de Git - karo-tx-linux.git/commit
inotify: convert to idr_alloc()
authorTejun Heo <tj@kernel.org>
Thu, 7 Feb 2013 01:31:49 +0000 (12:31 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:47:37 +0000 (16:47 +1100)
commit05d1c7e84fd1bb0435f6d5b96f6ef1465483bac3
tree57ee5b7bd984b0e21e19f149d8a5a0d0a5ae9d7f
parent719bddd13c93c00f2d6599bc9e64e7659ed70df6
inotify: convert to idr_alloc()

Convert to the much saner new idr interface.

Note that the adhoc cyclic id allocation is buggy.  If wraparound
happens, the previous code with idr_get_new_above() may segfault and
the converted code will trigger WARN and return -EINVAL.  Even if it's
fixed to wrap to zero, the code will be prone to unnecessary -ENOSPC
failures after the first wraparound.  We probably need to implement
proper cyclic support in idr.

Only compile tested.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: John McCutchan <john@johnmccutchan.com>
Cc: Robert Love <rlove@rlove.org>
Cc: Eric Paris <eparis@parisplace.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/notify/inotify/inotify_user.c