fdops.c revision 0fbb751d81ab0a7c7ddfd8d4e447e075a9f7024f
/*
* 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 (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All rights reserved. */
#include <sys/pathname.h>
#include <sys/resource.h>
#include <sys/sysmacros.h>
#include <sys/vfs_opreg.h>
#define fdtoi(n) ((n)+100)
#define FDDIRSIZE 14
struct fddirect {
short d_ino;
};
#define FDROOTINO 2
#define FDNSIZE 10
static int fdfstype = 0;
static kmutex_t fd_minor_lock;
/* ARGSUSED */
static int
{
}
return (0);
}
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static int
{
{ FDROOTINO, "." },
{ FDROOTINO, ".." }
};
int i, n;
int nentries;
int endoff;
return (ENOSYS);
/*
*/
return (0);
return (error);
}
for (i = 0; i < FDDIRSIZE; i++)
n = i;
return (error);
modoff = 0;
}
return (error);
}
/* ARGSUSED */
static int
{
} else {
}
gethrestime(&now);
return (0);
}
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static int
{
return (0);
}
}
/* ARGSUSED */
static int
{
}
/* ARGSUSED */
static int
int flags)
{
/* bp holds one dirent structure */
int n;
int oresid;
return (ENOENT);
} else {
/*
* Return entries corresponding to the allowable
* number of file descriptors for this process.
*/
break;
}
/*
* Error if no entries have been returned yet.
*/
return (EINVAL);
break;
}
/*
* uiomove() updates both resid and offset by the same
* amount. But we want offset to change in increments
* of FDSDSIZE, which is different from the number of bytes
* being returned to the user. So we set uio_offset
* separately, ignoring what uiomove() does.
*/
return (EFAULT);
}
if (eofp)
return (0);
}
/* ARGSUSED */
static void
{
return;
}
vn_invalid(vp);
}
static struct vnodeops *fd_vnodeops;
static const fs_operation_def_t fd_vnodeops_template[] = {
};
static int
{
int n = 0;
while (*comp) {
return (ENOENT);
}
return (0);
}
/*
* possibilities - two threads racing to do the same mount (protected
* by vfs locking), and two threads mounting fdfs in different places.
*/
/*ARGSUSED*/
static int
{
return (EPERM);
return (ENOTDIR);
return (EBUSY);
}
/*
* Having the resource be anything but "fd" doesn't make sense
*/
do {
return (0);
}
/* ARGSUSED */
static int
{
return (EPERM);
/*
* forced unmount is not supported by this file system
* and thus, ENOTSUP, is being returned.
*/
return (ENOTSUP);
return (EBUSY);
return (0);
}
/* ARGSUSED */
static int
{
return (0);
}
/*
* No locking required because I held the root vnode before calling this
* function so the vfs won't disappear on me. To be more explicit:
* fdvrootp->v_count will be greater than 1 so fdunmount will just return.
*/
static int
{
return (0);
}
int
{
static const fs_operation_def_t fd_vfsops_template[] = {
};
int error;
/*
* Associate VFS ops vector with this fstype.
*/
if (error != 0) {
return (error);
}
if (error != 0) {
(void) vfs_freevfsops_by_type(fstype);
return (error);
}
/*
* Assign unique "device" numbers (reported by stat(2)).
*/
fdfsmaj = 0;
fdrmaj = 0;
}
return (0);
}
/*
* FDFS Mount options table
*/
/*
* option name cancel option default arg flags
*/
(void *)MNTOPT_NOINTR },
(void *)0 },
};
static mntopts_t fdfs_mntopts = {
};
"fd",
};
"filesystem for fd",
&vfw
};
static struct modlinkage modlinkage = {
&modlfs,
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
{
}