summaryrefslogtreecommitdiffstats
path: root/sys/fs/autofs
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2015-03-07 19:36:06 +0000
committertrasz <trasz@FreeBSD.org>2015-03-07 19:36:06 +0000
commit1fbf58cee98e23d69f8bd11d2038910d33b4eee5 (patch)
tree2b1a95672f3fa645347d40114e1dd4d124ba2de6 /sys/fs/autofs
parent97710cbe33ec6723cc9fca56b97045a54a06e1a7 (diff)
downloadFreeBSD-src-1fbf58cee98e23d69f8bd11d2038910d33b4eee5.zip
FreeBSD-src-1fbf58cee98e23d69f8bd11d2038910d33b4eee5.tar.gz
MFC r274859:
Implement "automount -c". Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/fs/autofs')
-rw-r--r--sys/fs/autofs/autofs.c12
-rw-r--r--sys/fs/autofs/autofs.h1
-rw-r--r--sys/fs/autofs/autofs_vfsops.c4
3 files changed, 16 insertions, 1 deletions
diff --git a/sys/fs/autofs/autofs.c b/sys/fs/autofs/autofs.c
index 0393d13..235d09d 100644
--- a/sys/fs/autofs/autofs.c
+++ b/sys/fs/autofs/autofs.c
@@ -318,6 +318,18 @@ autofs_cache_callout(void *context)
anp->an_cached = false;
}
+void
+autofs_flush(struct autofs_mount *amp)
+{
+
+ /*
+ * XXX: This will do for now, but ideally we should iterate
+ * over all the nodes.
+ */
+ amp->am_root->an_cached = false;
+ AUTOFS_DEBUG("%s flushed", amp->am_mountpoint);
+}
+
/*
* The set/restore sigmask functions are used to (temporarily) overwrite
* the thread td_sigmask during triggering.
diff --git a/sys/fs/autofs/autofs.h b/sys/fs/autofs/autofs.h
index 6ea198c..4d16509 100644
--- a/sys/fs/autofs/autofs.h
+++ b/sys/fs/autofs/autofs.h
@@ -133,6 +133,7 @@ int autofs_trigger(struct autofs_node *anp, const char *component,
int componentlen);
bool autofs_cached(struct autofs_node *anp, const char *component,
int componentlen);
+void autofs_flush(struct autofs_mount *amp);
bool autofs_ignore_thread(const struct thread *td);
int autofs_node_new(struct autofs_node *parent, struct autofs_mount *amp,
const char *name, int namelen, struct autofs_node **anpp);
diff --git a/sys/fs/autofs/autofs_vfsops.c b/sys/fs/autofs/autofs_vfsops.c
index 13a5a89..e84f6b8 100644
--- a/sys/fs/autofs/autofs_vfsops.c
+++ b/sys/fs/autofs/autofs_vfsops.c
@@ -61,8 +61,10 @@ autofs_mount(struct mount *mp)
if (vfs_filteropt(mp->mnt_optnew, autofs_opts))
return (EINVAL);
- if (mp->mnt_flag & MNT_UPDATE)
+ if (mp->mnt_flag & MNT_UPDATE) {
+ autofs_flush(VFSTOAUTOFS(mp));
return (0);
+ }
if (vfs_getopt(mp->mnt_optnew, "from", (void **)&from, NULL))
return (EINVAL);
OpenPOWER on IntegriCloud