summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-08-10 12:34:49 +0000
committerkib <kib@FreeBSD.org>2016-08-10 12:34:49 +0000
commitf9ae0e0f17867afc5455c0e4a12c2e0380f9a420 (patch)
treec75293fb961908eca1bbb6fed0ea96479b510df1
parent5baa006f3e0801772ee6c178754a08422a6bd223 (diff)
downloadFreeBSD-src-f9ae0e0f17867afc5455c0e4a12c2e0380f9a420.zip
FreeBSD-src-f9ae0e0f17867afc5455c0e4a12c2e0380f9a420.tar.gz
MFC r303704:
Some style changes. Fix a typo in comment. MFC r303705: Remove Giant asserts. Update comment. Approved by: re (gjb)
-rw-r--r--sys/fs/pseudofs/pseudofs.c6
-rw-r--r--sys/fs/pseudofs/pseudofs.h14
-rw-r--r--sys/fs/pseudofs/pseudofs_fileno.c2
-rw-r--r--sys/fs/pseudofs/pseudofs_vncache.c2
4 files changed, 8 insertions, 16 deletions
diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c
index 1824d0b..b2ae67f 100644
--- a/sys/fs/pseudofs/pseudofs.c
+++ b/sys/fs/pseudofs/pseudofs.c
@@ -383,11 +383,9 @@ pfs_init(struct pfs_info *pi, struct vfsconf *vfc)
struct pfs_node *root;
int error;
- mtx_assert(&Giant, MA_OWNED);
-
pfs_fileno_init(pi);
- /* set up the root diretory */
+ /* set up the root directory */
root = pfs_alloc_node(pi, "/", pfstype_root);
pi->pi_root = root;
pfs_fileno_alloc(root);
@@ -414,8 +412,6 @@ pfs_uninit(struct pfs_info *pi, struct vfsconf *vfc)
{
int error;
- mtx_assert(&Giant, MA_OWNED);
-
pfs_destroy(pi->pi_root);
pi->pi_root = NULL;
pfs_fileno_uninit(pi);
diff --git a/sys/fs/pseudofs/pseudofs.h b/sys/fs/pseudofs/pseudofs.h
index e2aeed6..cc9b841 100644
--- a/sys/fs/pseudofs/pseudofs.h
+++ b/sys/fs/pseudofs/pseudofs.h
@@ -189,16 +189,16 @@ typedef int (*pfs_destroy_t)(PFS_DESTROY_ARGS);
/*
* pfs_info: describes a pseudofs instance
*
- * The pi_mutex is only used to avoid using the global subr_unit lock for
- * unrhdr. The rest of struct pfs_info is only modified while Giant is
- * held (during vfs_init() and vfs_uninit()).
+ * The pi_mutex is only used to avoid using the global subr_unit lock
+ * for unrhdr. The rest of struct pfs_info is only modified during
+ * vfs_init() and vfs_uninit() of the consumer filesystem.
*/
struct pfs_info {
char pi_name[PFS_FSNAMELEN];
pfs_init_t pi_init;
pfs_init_t pi_uninit;
- /* members below this line are initialized at run time*/
+ /* members below this line are initialized at run time */
struct pfs_node *pi_root;
struct mtx pi_mutex;
struct unrhdr *pi_unrhdr;
@@ -285,17 +285,17 @@ static int \
_##name##_mount(struct mount *mp) { \
if (jflag && !prison_allow(curthread->td_ucred, jflag)) \
return (EPERM); \
- return pfs_mount(&name##_info, mp); \
+ return (pfs_mount(&name##_info, mp)); \
} \
\
static int \
_##name##_init(struct vfsconf *vfc) { \
- return pfs_init(&name##_info, vfc); \
+ return (pfs_init(&name##_info, vfc)); \
} \
\
static int \
_##name##_uninit(struct vfsconf *vfc) { \
- return pfs_uninit(&name##_info, vfc); \
+ return (pfs_uninit(&name##_info, vfc)); \
} \
\
static struct vfsops name##_vfsops = { \
diff --git a/sys/fs/pseudofs/pseudofs_fileno.c b/sys/fs/pseudofs/pseudofs_fileno.c
index a8c034f..f57731c 100644
--- a/sys/fs/pseudofs/pseudofs_fileno.c
+++ b/sys/fs/pseudofs/pseudofs_fileno.c
@@ -52,7 +52,6 @@ void
pfs_fileno_init(struct pfs_info *pi)
{
- mtx_assert(&Giant, MA_OWNED);
mtx_init(&pi->pi_mutex, "pfs_fileno", NULL, MTX_DEF);
pi->pi_unrhdr = new_unrhdr(3, INT_MAX / NO_PID, &pi->pi_mutex);
}
@@ -64,7 +63,6 @@ void
pfs_fileno_uninit(struct pfs_info *pi)
{
- mtx_assert(&Giant, MA_OWNED);
delete_unrhdr(pi->pi_unrhdr);
pi->pi_unrhdr = NULL;
mtx_destroy(&pi->pi_mutex);
diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c
index 1f9c043..1bec5a4 100644
--- a/sys/fs/pseudofs/pseudofs_vncache.c
+++ b/sys/fs/pseudofs/pseudofs_vncache.c
@@ -84,7 +84,6 @@ void
pfs_vncache_load(void)
{
- mtx_assert(&Giant, MA_OWNED);
mtx_init(&pfs_vncache_mutex, "pfs_vncache", NULL, MTX_DEF);
pfs_exit_tag = EVENTHANDLER_REGISTER(process_exit, pfs_exit, NULL,
EVENTHANDLER_PRI_ANY);
@@ -97,7 +96,6 @@ void
pfs_vncache_unload(void)
{
- mtx_assert(&Giant, MA_OWNED);
EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag);
KASSERT(pfs_vncache_entries == 0,
("%d vncache entries remaining", pfs_vncache_entries));
OpenPOWER on IntegriCloud