Skip to content

Commit

Permalink
inotify: clean up the inotify_add_watch out path
Browse files Browse the repository at this point in the history
inotify_add_watch explictly frees the unused inode mark, but it can just
use the generic code.  Just do that.

Signed-off-by: Eric Paris <eparis@redhat.com>
  • Loading branch information
Eric Paris committed May 14, 2010
1 parent e7b702b commit 3dbc6fb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,16 +578,13 @@ static int inotify_new_watch(struct fsnotify_group *group,
/* return the watch descriptor for this new entry */
ret = tmp_ientry->wd;

/* match the ref from fsnotify_init_markentry() */
fsnotify_put_mark(&tmp_ientry->fsn_entry);

/* if this mark added a new event update the group mask */
if (mask & ~group->mask)
fsnotify_recalc_group_mask(group);

out_err:
if (ret < 0)
kmem_cache_free(inotify_inode_mark_cachep, tmp_ientry);
/* match the ref from fsnotify_init_markentry() */
fsnotify_put_mark(&tmp_ientry->fsn_entry);

return ret;
}
Expand Down

0 comments on commit 3dbc6fb

Please sign in to comment.