[PATCH 2/5] fsnotify: pass inode/mount as a parameter to fsnotify_destroy_[inode|vfsmount]_mark()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pass the fsobject (inode/mount) as a parameter to fsnotify_destroy_[inode|vfsmount]_mark()
instead of taking it from the passed mark.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@xxxxxx>
---
 fs/notify/fsnotify.h      |    6 ++++--
 fs/notify/inode_mark.c    |    5 ++---
 fs/notify/mark.c          |    8 ++++----
 fs/notify/vfsmount_mark.c |    5 ++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/fs/notify/fsnotify.h b/fs/notify/fsnotify.h
index 85e7d2b..8e2fc42 100644
--- a/fs/notify/fsnotify.h
+++ b/fs/notify/fsnotify.h
@@ -27,9 +27,11 @@ extern int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark,
 extern void fsnotify_final_destroy_group(struct fsnotify_group *group);
 
 /* vfsmount specific destruction of a mark */
-extern void fsnotify_destroy_vfsmount_mark(struct fsnotify_mark *mark);
+extern void fsnotify_destroy_vfsmount_mark(struct fsnotify_mark *mark,
+					   struct vfsmount *mnt);
 /* inode specific destruction of a mark */
-extern void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark);
+extern void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark,
+					struct inode *inode);
 /* run the list of all marks associated with inode and flag them to be freed */
 extern void fsnotify_clear_marks_by_inode(struct inode *inode);
 /* run the list of all marks associated with vfsmount and flag them to be freed */
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
index 168a242..a9b8661 100644
--- a/fs/notify/inode_mark.c
+++ b/fs/notify/inode_mark.c
@@ -58,10 +58,9 @@ void fsnotify_recalc_inode_mask(struct inode *inode)
 	__fsnotify_update_child_dentry_flags(inode);
 }
 
-void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark)
+void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark,
+				 struct inode *inode)
 {
-	struct inode *inode = mark->i.inode;
-
 	assert_spin_locked(&mark->lock);
 
 	spin_lock(&inode->i_lock);
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 422de6e..6d9bf1d 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -131,9 +131,9 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
 
 	if (mark->flags & FSNOTIFY_MARK_FLAG_INODE) {
 		inode = mark->i.inode;
-		fsnotify_destroy_inode_mark(mark);
+		fsnotify_destroy_inode_mark(mark, inode);
 	} else if (mark->flags & FSNOTIFY_MARK_FLAG_VFSMOUNT)
-		fsnotify_destroy_vfsmount_mark(mark);
+		fsnotify_destroy_vfsmount_mark(mark, mark->m.mnt);
 	else
 		BUG();
 	spin_unlock(&mark->lock);
@@ -290,9 +290,9 @@ void fsnotify_remove_mark_locked(struct fsnotify_mark *mark,
 
 	if (mark->flags & FSNOTIFY_MARK_FLAG_INODE) {
 		inode = mark->i.inode;
-		fsnotify_destroy_inode_mark(mark);
+		fsnotify_destroy_inode_mark(mark, inode);
 	} else if (mark->flags & FSNOTIFY_MARK_FLAG_VFSMOUNT)
-		fsnotify_destroy_vfsmount_mark(mark);
+		fsnotify_destroy_vfsmount_mark(mark, mark->m.mnt);
 	else
 		BUG();
 	spin_unlock(&mark->lock);
diff --git a/fs/notify/vfsmount_mark.c b/fs/notify/vfsmount_mark.c
index c43c310..b33e78b 100644
--- a/fs/notify/vfsmount_mark.c
+++ b/fs/notify/vfsmount_mark.c
@@ -82,10 +82,9 @@ void fsnotify_recalc_vfsmount_mask(struct vfsmount *mnt)
 	spin_unlock(&mnt->mnt_root->d_lock);
 }
 
-void fsnotify_destroy_vfsmount_mark(struct fsnotify_mark *mark)
+void fsnotify_destroy_vfsmount_mark(struct fsnotify_mark *mark,
+				    struct vfsmount *mnt)
 {
-	struct vfsmount *mnt = mark->m.mnt;
-
 	assert_spin_locked(&mark->lock);
 
 	spin_lock(&mnt->mnt_root->d_lock);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux