[PATCH v1 09/38] fsnotify: add a srcu barrier for fsnotify

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

 



For nfsd, we'll need to be able to ensure that all fsnotify_mark
callbacks have run before we can tear down the nfsd_file_mark_cache.
That's simple now that we're using call_srcu directly. Just use
srcu_barrier to ensure that all the callbacks have completed.

Signed-off-by: Jeff Layton <jeff.layton@xxxxxxxxxxxxxxx>
---
 fs/notify/mark.c                 | 7 +++++++
 include/linux/fsnotify_backend.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 00e7072d3c95..6b6b99447348 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -204,6 +204,13 @@ void fsnotify_free_mark(struct fsnotify_mark *mark)
 		group->ops->freeing_mark(mark, group);
 }
 
+void
+fsnotify_srcu_barrier(void)
+{
+	srcu_barrier(&fsnotify_mark_srcu);
+}
+EXPORT_SYMBOL_GPL(fsnotify_srcu_barrier);
+
 void fsnotify_destroy_mark(struct fsnotify_mark *mark,
 			   struct fsnotify_group *group)
 {
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 1c582747b410..b211eda20842 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -360,6 +360,8 @@ extern void fsnotify_destroy_mark(struct fsnotify_mark *mark,
 extern void fsnotify_detach_mark(struct fsnotify_mark *mark);
 /* free mark */
 extern void fsnotify_free_mark(struct fsnotify_mark *mark);
+/* wait for all in-flight fsnotify srcu callbacks to run */
+extern void fsnotify_srcu_barrier(void);
 /* run all the marks in a group, and clear all of the vfsmount marks */
 extern void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group);
 /* run all the marks in a group, and clear all of the inode marks */
-- 
2.4.3

--
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