Skip to content

Commit b72679e

Browse files
trondmypdJ. Bruce Fields
authored andcommitted
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>
1 parent 18f6622 commit b72679e

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

fs/notify/fsnotify.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ static inline void fsnotify_clear_marks_by_sb(struct super_block *sb)
5454
{
5555
fsnotify_destroy_marks(&sb->s_fsnotify_marks);
5656
}
57-
/* Wait until all marks queued for destruction are destroyed */
58-
extern void fsnotify_wait_marks_destroyed(void);
5957

6058
/*
6159
* update the dentry->d_flags of all of inode's children to indicate if inode cares

fs/notify/group.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
108108
if (refcount_dec_and_test(&group->refcnt))
109109
fsnotify_final_destroy_group(group);
110110
}
111+
EXPORT_SYMBOL_GPL(fsnotify_put_group);
111112

112113
/*
113114
* 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)
137138

138139
return group;
139140
}
141+
EXPORT_SYMBOL_GPL(fsnotify_alloc_group);
140142

141143
int fsnotify_fasync(int fd, struct file *file, int on)
142144
{

fs/notify/mark.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
276276
queue_delayed_work(system_unbound_wq, &reaper_work,
277277
FSNOTIFY_REAPER_DELAY);
278278
}
279+
EXPORT_SYMBOL_GPL(fsnotify_put_mark);
279280

280281
/*
281282
* 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,
430431
mutex_unlock(&group->mark_mutex);
431432
fsnotify_free_mark(mark);
432433
}
434+
EXPORT_SYMBOL_GPL(fsnotify_destroy_mark);
433435

434436
/*
435437
* Sorting function for lists of fsnotify marks.
@@ -685,6 +687,7 @@ int fsnotify_add_mark(struct fsnotify_mark *mark, fsnotify_connp_t *connp,
685687
mutex_unlock(&group->mark_mutex);
686688
return ret;
687689
}
690+
EXPORT_SYMBOL_GPL(fsnotify_add_mark);
688691

689692
/*
690693
* 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,
711714
spin_unlock(&conn->lock);
712715
return NULL;
713716
}
717+
EXPORT_SYMBOL_GPL(fsnotify_find_mark);
714718

715719
/* Clear any marks in a group with given type mask */
716720
void fsnotify_clear_marks_by_group(struct fsnotify_group *group,
@@ -809,6 +813,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
809813
mark->group = group;
810814
WRITE_ONCE(mark->connector, NULL);
811815
}
816+
EXPORT_SYMBOL_GPL(fsnotify_init_mark);
812817

813818
/*
814819
* Destroy all marks in destroy_list, waits for SRCU period to finish before
@@ -837,3 +842,4 @@ void fsnotify_wait_marks_destroyed(void)
837842
{
838843
flush_delayed_work(&reaper_work);
839844
}
845+
EXPORT_SYMBOL_GPL(fsnotify_wait_marks_destroyed);

include/linux/fsnotify_backend.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ extern void fsnotify_destroy_mark(struct fsnotify_mark *mark,
475475
extern void fsnotify_detach_mark(struct fsnotify_mark *mark);
476476
/* free mark */
477477
extern void fsnotify_free_mark(struct fsnotify_mark *mark);
478+
/* Wait until all marks queued for destruction are destroyed */
479+
extern void fsnotify_wait_marks_destroyed(void);
478480
/* run all the marks in a group, and clear all of the marks attached to given object type */
479481
extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned int type);
480482
/* run all the marks in a group, and clear all of the vfsmount marks */

0 commit comments

Comments
 (0)