bootfs_vnops.c revision 337260d77469aa189d6cd8414435e8b4e9038853
/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright (c) 2015 Joyent, Inc. All rights reserved.
*/
/*
* bootfs vnode operations
*/
#include <sys/vfs_opreg.h>
#include <sys/sysmacros.h>
struct vnodeops *bootfs_vnodeops;
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
int err;
return (EISDIR);
return (EINVAL);
if (uiop->uio_loffset < 0)
return (EINVAL);
return (0);
err = 0;
int relerr;
if (frem <= 0) {
err = 0;
break;
}
/* Don't read past EOF */
/*
* Segmaps are likely larger than our page size, so make sure we
* have the proper offfset into the resulting segmap data.
*/
1, S_READ);
if (err == 0)
if (err != 0)
break;
}
/* Even if we had an error in a partial read, return success */
err = 0;
return (err);
}
/*ARGSUSED*/
static int
{
return (ENOTTY);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
int shift = 0;
shift += 3;
shift += 3;
}
}
/*ARGSUSED*/
static int
{
if (flags & LOOKUP_XATTR)
return (EINVAL);
return (ENOTDIR);
return (0);
}
return (0);
}
return (ENOENT);
return (0);
}
/*ARGSUSED*/
static int
{
dirent64_t *dp;
void *buf;
*eofp = 1;
return (0);
}
return (EINVAL);
return (EINVAL);
return (ENOTDIR);
coff = 0;
/*
* Recall that offsets here are done based on the name of the dirent
* excluding the null terminator. Therefore `.` is always at 0, `..` is
* always at 1, and then the first real dirent is at 3. This offset is
* what's actually stored when we update the offset in the structure.
*/
if (roff == 0) {
return (EINVAL);
}
}
}
if (roff <= 1) {
return (EINVAL);
}
}
}
coff = 3;
continue;
}
return (EINVAL);
}
break;
}
}
if (ret == 0) {
coff++;
*eofp = 1;
*eofp = 0;
}
}
return (ret);
}
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static int
{
if (write_lock != 0)
return (EINVAL);
return (0);
}
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static int
{
return (0);
}
/*
* We need to fill in a single page of a vnode's memory based on the actual data
* from the kernel. We'll use this node's sliding window into physical memory
* and update one page at a time.
*/
/*ARGSUSED*/
static int
{
for (;;) {
/* Easy case where the page exists */
} else {
}
return (0);
}
addr);
/*
* If we didn't get the page, that means someone else beat us to
* creating this so we need to try again.
*/
break;
}
return (EIO);
}
} else {
}
return (0);
}
/*ARGSUSED*/
static int
{
int err;
return (EFAULT);
else
return (err);
}
/*ARGSUSED*/
static int
{
int ret;
#ifdef _ILP32
return (ENOMEM);
#endif
return (ENOSYS);
return (ENXIO);
return (ENODEV);
if (prot & PROT_WRITE)
return (ENOTSUP);
if (ret != 0) {
return (ret);
}
return (ret);
}
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}
static int
{
int ret;
switch (cmd) {
case _PC_TIMESTAMP_RESOLUTION:
*valp = 1L;
ret = 0;
break;
default:
}
return (ret);
}
const fs_operation_def_t bootfs_vnodeops_template[] = {
};