objfs_vfs.c revision 1a5e258f5471356ca102c7176637cdce45bac147
/*
* 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
*/
/*
*/
#include <sys/objfs_impl.h>
#include <sys/vfs_opreg.h>
#include <sys/sysmacros.h>
/*
* Kernel object filesystem.
*
* This is a pseudo filesystem which exports information about currently loaded
* kernel objects. The root directory contains one directory for each loaded
* object, indexed by module name. Within each object directory is an ELF file,
* 'object', that contains information about the currently loaded module.
*
* This file contains functions that interact with the VFS layer. Each
* filesystem element is represented by a a different node.
*
* / objfs_rootnode_t objfs_root.c
* /<obj> objfs_odirnode_t objfs_odir.c
* /<obj>/object objfs_datanode_t objfs_data.c
*
* In addition, some common routines are found in the 'objfs_common.c' file.
*/
static const fs_operation_def_t objfs_vfstops[];
static gfs_opsvec_t objfs_opsvec[];
static int objfs_init(int, char *);
/*
* Module linkage
*/
static mntopts_t objfs_mntopts = {
0,
};
"objfs",
};
};
static struct modlinkage modlinkage = {
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
{
}
int
_fini(void)
{
/*
* The object filesystem cannot be unloaded.
*/
return (EBUSY);
}
/*
* Filesystem initialization.
*/
static int objfs_fstype;
static major_t objfs_major;
static minor_t objfs_minor;
static gfs_opsvec_t objfs_opsvec[] = {
{ NULL }
};
/* ARGSUSED */
static int
{
int error;
return (error);
}
(void) vfs_freevfsops(vfsops);
return (error);
}
objfs_major = 0;
}
return (0);
}
/*
* VFS entry points
*/
static int
{
return (EPERM);
return (ENOTDIR);
return (EBUSY);
/*
* Initialize vfs fields
*/
do {
} while (vfs_devismounted(dev));
/*
* Create root
*/
return (0);
}
static int
{
return (EPERM);
/*
* We do not currently support forced unmounts
*/
return (ENOTSUP);
/*
* We should never have a reference count of less than 2: one for the
* caller, one for the root vnode.
*/
/*
* Any active vnodes will result in a hold on the root vnode
*/
return (EBUSY);
/*
* Release the last hold on the root vnode
*/
return (0);
}
static int
{
return (0);
}
static int
{
int total = objfs_nobjs();
sizeof (sp->f_basetype));
return (0);
}
static const fs_operation_def_t objfs_vfstops[] = {
{ NULL }
};