Skip to content

Commit

Permalink
inotify: use container_of instead of casting
Browse files Browse the repository at this point in the history
inotify_free_mark casts directly from an fsnotify_mark_entry to an
inotify_inode_mark_entry.  This works, but should use container_of instead
for future proofing.

Signed-off-by: Eric Paris <eparis@redhat.com>
  • Loading branch information
Eric Paris committed Jul 28, 2010
1 parent b4277d3 commit 31ddd32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,9 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
/* ding dong the mark is dead */
static void inotify_free_mark(struct fsnotify_mark_entry *entry)
{
struct inotify_inode_mark_entry *ientry = (struct inotify_inode_mark_entry *)entry;
struct inotify_inode_mark_entry *ientry;

ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);

kmem_cache_free(inotify_inode_mark_cachep, ientry);
}
Expand Down

0 comments on commit 31ddd32

Please sign in to comment.