summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2019-08-18 14:18:46 -0400
committerJ. Bruce Fields <bfields@redhat.com>2019-08-19 11:00:39 -0400
commitb72679ee89a0a0ecd26f7b6fcae96cdaababff94 (patch)
treeaf6192a502080a5e7a3bb834ca0dd469a151521c
parent18f6622ebbdea56a83f8e553c159ce2d62d3ad0c (diff)
notify: export symbols for use by the knfsd file cache
The knfsd file cache will need to detect when files are unlinked, so that it can close the associated cached files. Export a minimal set of notifier functions to allow it to do so. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/notify/fsnotify.h2
-rw-r--r--fs/notify/group.c2
-rw-r--r--fs/notify/mark.c6
-rw-r--r--include/linux/fsnotify_backend.h2
4 files changed, 10 insertions, 2 deletions
diff --git a/fs/notify/fsnotify.h b/fs/notify/fsnotify.h
index 5a00121fb219..f3462828a0e2 100644
--- a/fs/notify/fsnotify.h
+++ b/fs/notify/fsnotify.h
@@ -54,8 +54,6 @@ static inline void fsnotify_clear_marks_by_sb(struct super_block *sb)
54{ 54{
55 fsnotify_destroy_marks(&sb->s_fsnotify_marks); 55 fsnotify_destroy_marks(&sb->s_fsnotify_marks);
56} 56}
57/* Wait until all marks queued for destruction are destroyed */
58extern void fsnotify_wait_marks_destroyed(void);
59 57
60/* 58/*
61 * update the dentry->d_flags of all of inode's children to indicate if inode cares 59 * update the dentry->d_flags of all of inode's children to indicate if inode cares
diff --git a/fs/notify/group.c b/fs/notify/group.c
index 0391190305cc..133f723aca07 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -108,6 +108,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
108 if (refcount_dec_and_test(&group->refcnt)) 108 if (refcount_dec_and_test(&group->refcnt))
109 fsnotify_final_destroy_group(group); 109 fsnotify_final_destroy_group(group);
110} 110}
111EXPORT_SYMBOL_GPL(fsnotify_put_group);
111 112
112/* 113/*
113 * Create a new fsnotify_group and hold a reference for the group returned. 114 * Create a new fsnotify_group and hold a reference for the group returned.
@@ -137,6 +138,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
137 138
138 return group; 139 return group;
139} 140}
141EXPORT_SYMBOL_GPL(fsnotify_alloc_group);
140 142
141int fsnotify_fasync(int fd, struct file *file, int on) 143int fsnotify_fasync(int fd, struct file *file, int on)
142{ 144{
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 99ddd126f6f0..1d96216dffd1 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -276,6 +276,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
276 queue_delayed_work(system_unbound_wq, &reaper_work, 276 queue_delayed_work(system_unbound_wq, &reaper_work,
277 FSNOTIFY_REAPER_DELAY); 277 FSNOTIFY_REAPER_DELAY);
278} 278}
279EXPORT_SYMBOL_GPL(fsnotify_put_mark);
279 280
280/* 281/*
281 * Get mark reference when we found the mark via lockless traversal of object 282 * Get mark reference when we found the mark via lockless traversal of object
@@ -430,6 +431,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
430 mutex_unlock(&group->mark_mutex); 431 mutex_unlock(&group->mark_mutex);
431 fsnotify_free_mark(mark); 432 fsnotify_free_mark(mark);
432} 433}
434EXPORT_SYMBOL_GPL(fsnotify_destroy_mark);
433 435
434/* 436/*
435 * Sorting function for lists of fsnotify marks. 437 * Sorting function for lists of fsnotify marks.
@@ -685,6 +687,7 @@ int fsnotify_add_mark(struct fsnotify_mark *mark, fsnotify_connp_t *connp,
685 mutex_unlock(&group->mark_mutex); 687 mutex_unlock(&group->mark_mutex);
686 return ret; 688 return ret;
687} 689}
690EXPORT_SYMBOL_GPL(fsnotify_add_mark);
688 691
689/* 692/*
690 * Given a list of marks, find the mark associated with given group. If found 693 * Given a list of marks, find the mark associated with given group. If found
@@ -711,6 +714,7 @@ struct fsnotify_mark *fsnotify_find_mark(fsnotify_connp_t *connp,
711 spin_unlock(&conn->lock); 714 spin_unlock(&conn->lock);
712 return NULL; 715 return NULL;
713} 716}
717EXPORT_SYMBOL_GPL(fsnotify_find_mark);
714 718
715/* Clear any marks in a group with given type mask */ 719/* Clear any marks in a group with given type mask */
716void fsnotify_clear_marks_by_group(struct fsnotify_group *group, 720void fsnotify_clear_marks_by_group(struct fsnotify_group *group,
@@ -809,6 +813,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
809 mark->group = group; 813 mark->group = group;
810 WRITE_ONCE(mark->connector, NULL); 814 WRITE_ONCE(mark->connector, NULL);
811} 815}
816EXPORT_SYMBOL_GPL(fsnotify_init_mark);
812 817
813/* 818/*
814 * Destroy all marks in destroy_list, waits for SRCU period to finish before 819 * Destroy all marks in destroy_list, waits for SRCU period to finish before
@@ -837,3 +842,4 @@ void fsnotify_wait_marks_destroyed(void)
837{ 842{
838 flush_delayed_work(&reaper_work); 843 flush_delayed_work(&reaper_work);
839} 844}
845EXPORT_SYMBOL_GPL(fsnotify_wait_marks_destroyed);
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 2de3b2ddd19a..1915bdba2fad 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -475,6 +475,8 @@ extern void fsnotify_destroy_mark(struct fsnotify_mark *mark,
475extern void fsnotify_detach_mark(struct fsnotify_mark *mark); 475extern void fsnotify_detach_mark(struct fsnotify_mark *mark);
476/* free mark */ 476/* free mark */
477extern void fsnotify_free_mark(struct fsnotify_mark *mark); 477extern void fsnotify_free_mark(struct fsnotify_mark *mark);
478/* Wait until all marks queued for destruction are destroyed */
479extern void fsnotify_wait_marks_destroyed(void);
478/* run all the marks in a group, and clear all of the marks attached to given object type */ 480/* run all the marks in a group, and clear all of the marks attached to given object type */
479extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned int type); 481extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned int type);
480/* run all the marks in a group, and clear all of the vfsmount marks */ 482/* run all the marks in a group, and clear all of the vfsmount marks */