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>
This commit is contained in:
Trond Myklebust 2019-08-18 14:18:46 -04:00 committed by J. Bruce Fields
parent 18f6622ebb
commit b72679ee89
4 changed files with 10 additions and 2 deletions

View File

@ -54,8 +54,6 @@ static inline void fsnotify_clear_marks_by_sb(struct super_block *sb)
{ {
fsnotify_destroy_marks(&sb->s_fsnotify_marks); fsnotify_destroy_marks(&sb->s_fsnotify_marks);
} }
/* Wait until all marks queued for destruction are destroyed */
extern void fsnotify_wait_marks_destroyed(void);
/* /*
* update the dentry->d_flags of all of inode's children to indicate if inode cares * update the dentry->d_flags of all of inode's children to indicate if inode cares

View File

@ -108,6 +108,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
if (refcount_dec_and_test(&group->refcnt)) if (refcount_dec_and_test(&group->refcnt))
fsnotify_final_destroy_group(group); fsnotify_final_destroy_group(group);
} }
EXPORT_SYMBOL_GPL(fsnotify_put_group);
/* /*
* Create a new fsnotify_group and hold a reference for the group returned. * 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)
return group; return group;
} }
EXPORT_SYMBOL_GPL(fsnotify_alloc_group);
int fsnotify_fasync(int fd, struct file *file, int on) int fsnotify_fasync(int fd, struct file *file, int on)
{ {

View File

@ -276,6 +276,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
queue_delayed_work(system_unbound_wq, &reaper_work, queue_delayed_work(system_unbound_wq, &reaper_work,
FSNOTIFY_REAPER_DELAY); FSNOTIFY_REAPER_DELAY);
} }
EXPORT_SYMBOL_GPL(fsnotify_put_mark);
/* /*
* Get mark reference when we found the mark via lockless traversal of object * 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,
mutex_unlock(&group->mark_mutex); mutex_unlock(&group->mark_mutex);
fsnotify_free_mark(mark); fsnotify_free_mark(mark);
} }
EXPORT_SYMBOL_GPL(fsnotify_destroy_mark);
/* /*
* Sorting function for lists of fsnotify marks. * Sorting function for lists of fsnotify marks.
@ -685,6 +687,7 @@ int fsnotify_add_mark(struct fsnotify_mark *mark, fsnotify_connp_t *connp,
mutex_unlock(&group->mark_mutex); mutex_unlock(&group->mark_mutex);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(fsnotify_add_mark);
/* /*
* Given a list of marks, find the mark associated with given group. If found * 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,
spin_unlock(&conn->lock); spin_unlock(&conn->lock);
return NULL; return NULL;
} }
EXPORT_SYMBOL_GPL(fsnotify_find_mark);
/* Clear any marks in a group with given type mask */ /* Clear any marks in a group with given type mask */
void fsnotify_clear_marks_by_group(struct fsnotify_group *group, void fsnotify_clear_marks_by_group(struct fsnotify_group *group,
@ -809,6 +813,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
mark->group = group; mark->group = group;
WRITE_ONCE(mark->connector, NULL); WRITE_ONCE(mark->connector, NULL);
} }
EXPORT_SYMBOL_GPL(fsnotify_init_mark);
/* /*
* Destroy all marks in destroy_list, waits for SRCU period to finish before * Destroy all marks in destroy_list, waits for SRCU period to finish before
@ -837,3 +842,4 @@ void fsnotify_wait_marks_destroyed(void)
{ {
flush_delayed_work(&reaper_work); flush_delayed_work(&reaper_work);
} }
EXPORT_SYMBOL_GPL(fsnotify_wait_marks_destroyed);

View File

@ -475,6 +475,8 @@ extern void fsnotify_destroy_mark(struct fsnotify_mark *mark,
extern void fsnotify_detach_mark(struct fsnotify_mark *mark); extern void fsnotify_detach_mark(struct fsnotify_mark *mark);
/* free mark */ /* free mark */
extern void fsnotify_free_mark(struct fsnotify_mark *mark); extern void fsnotify_free_mark(struct fsnotify_mark *mark);
/* Wait until all marks queued for destruction are destroyed */
extern void fsnotify_wait_marks_destroyed(void);
/* run all the marks in a group, and clear all of the marks attached to given object type */ /* run all the marks in a group, and clear all of the marks attached to given object type */
extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned int type); extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned int type);
/* run all the marks in a group, and clear all of the vfsmount marks */ /* run all the marks in a group, and clear all of the vfsmount marks */