Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359371
b: refs/heads/master
c: 4542da6
h: refs/heads/master
i:
  359369: 90bb91d
  359367: 12fee83
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 71fb116 commit 9818a0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a86b3e74f12bcdd13ceb1bf333bc2d5f43b3c02
refs/heads/master: 4542da631ad210716d097aa803a0828f9fed5e87
24 changes: 11 additions & 13 deletions trunk/fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,22 +364,20 @@ static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock,
{
int ret;

do {
if (unlikely(!idr_pre_get(idr, GFP_KERNEL)))
return -ENOMEM;
idr_preload(GFP_KERNEL);
spin_lock(idr_lock);

spin_lock(idr_lock);
ret = idr_get_new_above(idr, i_mark, *last_wd + 1,
&i_mark->wd);
ret = idr_alloc(idr, i_mark, *last_wd + 1, 0, GFP_NOWAIT);
if (ret >= 0) {
/* we added the mark to the idr, take a reference */
if (!ret) {
*last_wd = i_mark->wd;
fsnotify_get_mark(&i_mark->fsn_mark);
}
spin_unlock(idr_lock);
} while (ret == -EAGAIN);
i_mark->wd = ret;
*last_wd = i_mark->wd;
fsnotify_get_mark(&i_mark->fsn_mark);
}

return ret;
spin_unlock(idr_lock);
idr_preload_end();
return ret < 0 ? ret : 0;
}

static struct inotify_inode_mark *inotify_idr_find_locked(struct fsnotify_group *group,
Expand Down

0 comments on commit 9818a0b

Please sign in to comment.