@@ -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)
{
@@ -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 */
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@primarydata.com> --- fs/notify/mark.c | 7 +++++++ include/linux/fsnotify_backend.h | 2 ++ 2 files changed, 9 insertions(+)