mntvfsops.c revision a51518b114948c25adf55d3b4393ccc00ba2b5b8
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <sys/vfs_opreg.h>
/*
* This is the loadable module wrapper.
*/
static int mntinit(int, char *);
static mntopts_t mnt_mntopts = {
0,
};
"mntfs",
};
/*
* Module linkage information for the kernel.
*/
};
static struct modlinkage modlinkage = {
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
{
}
/*
* N.B.
* No _fini routine. The module cannot be unloaded once loaded.
* The NO_UNLOAD_STUB in modstubs.s must change if this module
* is ever modified to become unloadable.
*/
extern int mntfstype;
static kmutex_t mnt_minor_lock;
extern struct vnode *mntdummyvp;
struct vnodeops *mntdummyvnodeops;
/*
* /mnttab VFS operations vector.
*/
static void
{
}
static int
{
static const fs_operation_def_t mnt_vfsops_template[] = {
};
extern const fs_operation_def_t mnt_vnodeops_template[];
extern const fs_operation_def_t mnt_dummyvnodeops_template[];
int error;
/*
* Associate VFS ops vector with this fstype.
*/
if (error != 0) {
return (error);
}
/* Vnode ops too. */
if (!error) {
}
if (error != 0) {
(void) vfs_freevfsops_by_type(fstype);
return (error);
}
/*
* Assign a unique "device" number (used by stat(2)).
*/
mnt_major = 0;
}
return (0);
}
/* ARGSUSED */
static int
{
return (EPERM);
/*
* You can only mount mnttab in your current zone.
*/
if (zone == global_zone) {
return (EBUSY);
}
/*
* Having the resource be anything but "mnttab" doesn't make sense
*/
return (EBUSY);
}
/*
* find an available minor device number for this mount.
*/
do {
return (0);
}
/* ARGSUSED */
static int
{
return (EPERM);
/*
* Ensure that no /mnttab vnodes are in use on this mount point.
*/
return (EBUSY);
}
vn_invalid(vp);
return (0);
}
/* ARGSUSED */
static int
{
return (0);
}
static int
{
return (0);
}