From: Trond Myklebust <trondmy@gmail.com>
To: "J. Bruce Fields" <bfields@redhat.com>,
Chuck Lever <chuck.lever@oracle.com>
Cc: Jeff Layton <jlayton@redhat.com>,
linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH 03/16] notify: export symbols for use by the knfsd file cache
Date: Sun, 30 Jun 2019 09:52:27 -0400 [thread overview]
Message-ID: <20190630135240.7490-4-trond.myklebust@hammerspace.com> (raw)
In-Reply-To: <20190630135240.7490-3-trond.myklebust@hammerspace.com>
From: Trond Myklebust <trond.myklebust@primarydata.com>
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>
---
fs/notify/fsnotify.h | 2 --
fs/notify/group.c | 2 ++
fs/notify/mark.c | 6 ++++++
include/linux/fsnotify_backend.h | 2 ++
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)
{
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
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)
if (refcount_dec_and_test(&group->refcnt))
fsnotify_final_destroy_group(group);
}
+EXPORT_SYMBOL_GPL(fsnotify_put_group);
/*
* 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;
}
+EXPORT_SYMBOL_GPL(fsnotify_alloc_group);
int fsnotify_fasync(int fd, struct file *file, int on)
{
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)
queue_delayed_work(system_unbound_wq, &reaper_work,
FSNOTIFY_REAPER_DELAY);
}
+EXPORT_SYMBOL_GPL(fsnotify_put_mark);
/*
* 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);
fsnotify_free_mark(mark);
}
+EXPORT_SYMBOL_GPL(fsnotify_destroy_mark);
/*
* 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);
return ret;
}
+EXPORT_SYMBOL_GPL(fsnotify_add_mark);
/*
* 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);
return NULL;
}
+EXPORT_SYMBOL_GPL(fsnotify_find_mark);
/* Clear any marks in a group with given type mask */
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;
WRITE_ONCE(mark->connector, NULL);
}
+EXPORT_SYMBOL_GPL(fsnotify_init_mark);
/*
* 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);
}
+EXPORT_SYMBOL_GPL(fsnotify_wait_marks_destroyed);
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index d4844cad2c2b..7e096f4dd4ce 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -476,6 +476,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 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 */
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 */
--
2.21.0
next prev parent reply other threads:[~2019-06-30 13:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-30 13:52 [PATCH 00/16] Cache open file descriptors in knfsd Trond Myklebust
2019-06-30 13:52 ` [PATCH 01/16] sunrpc: add a new cache_detail operation for when a cache is flushed Trond Myklebust
2019-06-30 13:52 ` [PATCH 02/16] locks: create a new notifier chain for lease attempts Trond Myklebust
2019-06-30 13:52 ` Trond Myklebust [this message]
2019-06-30 13:52 ` [PATCH 04/16] vfs: Export flush_delayed_fput for use by knfsd Trond Myklebust
2019-06-30 13:52 ` [PATCH 05/16] nfsd: add a new struct file caching facility to nfsd Trond Myklebust
2019-06-30 13:52 ` [PATCH 06/16] nfsd: hook up nfsd_write to the new nfsd_file cache Trond Myklebust
2019-06-30 13:52 ` [PATCH 07/16] nfsd: hook up nfsd_read to the " Trond Myklebust
2019-06-30 13:52 ` [PATCH 08/16] nfsd: hook nfsd_commit up " Trond Myklebust
2019-06-30 13:52 ` [PATCH 09/16] nfsd: convert nfs4_file->fi_fds array to use nfsd_files Trond Myklebust
2019-06-30 13:52 ` [PATCH 10/16] nfsd: convert fi_deleg_file and ls_file fields to nfsd_file Trond Myklebust
2019-06-30 13:52 ` [PATCH 11/16] nfsd: hook up nfs4_preprocess_stateid_op to the nfsd_file cache Trond Myklebust
2019-06-30 13:52 ` [PATCH 12/16] nfsd: have nfsd_test_lock use " Trond Myklebust
2019-06-30 13:52 ` [PATCH 13/16] nfsd: rip out the raparms cache Trond Myklebust
2019-06-30 13:52 ` [PATCH 14/16] nfsd: close cached files prior to a REMOVE or RENAME that would replace target Trond Myklebust
2019-06-30 13:52 ` [PATCH 15/16] nfsd: Fix up some unused variable warnings Trond Myklebust
2019-06-30 13:52 ` [PATCH 16/16] nfsd: Fix the documentation for svcxdr_tmpalloc() Trond Myklebust
2019-06-30 15:57 ` [PATCH 05/16] nfsd: add a new struct file caching facility to nfsd Matthew Wilcox
2019-06-30 16:15 ` Trond Myklebust
2019-06-30 15:27 ` [PATCH 02/16] locks: create a new notifier chain for lease attempts Matthew Wilcox
2019-06-30 15:50 ` Trond Myklebust
2019-07-01 15:02 ` [PATCH 00/16] Cache open file descriptors in knfsd Chuck Lever
2019-07-01 15:17 ` Trond Myklebust
2019-07-01 15:39 ` Chuck Lever
2019-07-31 22:05 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190630135240.7490-4-trond.myklebust@hammerspace.com \
--to=trondmy@gmail.com \
--cc=bfields@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).