Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31ddd326 authored by Eric Paris's avatar Eric Paris
Browse files

inotify: use container_of instead of casting



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: default avatarEric Paris <eparis@redhat.com>
parent b4277d3d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);
}