History

inotify: clean up the inotify_add_watch out path

inotify_add_watch explictly frees the unused inode mark, but it can just use the generic code. Just do that.

Eric Paris committed 16 years ago

Commit 3dbc6fb1 parent e7b702b1 file · +2 −5Browse files

Unified · Split

fs/notify/inotify/inotify_user.c+2−5
@@ -578,16 +578,13 @@ retry: · 577 unmodified lines
578578 /* return the watch descriptor for this new entry */
579579 ret = tmp_ientry->wd;
580580
581− /* match the ref from fsnotify_init_markentry() */
582− fsnotify_put_mark(&tmp_ientry->fsn_entry);
583−
584581 /* if this mark added a new event update the group mask */
585582 if (mask & ~group->mask)
586583 fsnotify_recalc_group_mask(group);
587584
588585 out_err:
589− if (ret < 0)
590− kmem_cache_free(inotify_inode_mark_cachep, tmp_ientry);
586+ /* match the ref from fsnotify_init_markentry() */
587+ fsnotify_put_mark(&tmp_ientry->fsn_entry);
591588
592589 return ret;
593590 }