vdev_file.c revision 97e81309571898df9fdd94aab1216dfcf23e060b
/*
* 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) 2011, 2015 by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
#include <sys/spa_impl.h>
#include <sys/vdev_file.h>
#include <sys/vdev_impl.h>
/*
* Virtual device vector for files.
*/
static void
{
}
static void
{
}
static int
{
int error;
/*
* We must have a pathname, and it must be absolute.
*/
}
/*
* Reopen the device if it's not currently open. Otherwise,
* just update the physical size of the device.
*/
goto skip_open;
}
/*
* We always open the files from the root of the global zone, even if
* we're in a local zone. If the user has gotten to this point, the
* administrator has already decided that the pool should be available
* to local zone users, so the underlying devices should be as well.
*/
if (error) {
return (error);
}
#ifdef _KERNEL
/*
* Make sure it's a regular file.
*/
}
#endif
/*
* Determine the physical size of the file.
*/
if (error) {
return (error);
}
return (0);
}
static void
{
return;
}
}
/*
* Implements the interrupt side for file vdev types. This routine will be
* called when the I/O completes allowing us to transfer the I/O to the
* interrupt taskqs. For consistency, the code structure mimics disk vdev
* types.
*/
static void
{
}
static void
vdev_file_io_strategy(void *arg)
{
int error;
if (error == 0) {
} else {
}
}
static void
{
vdev_buf_t *vb;
/* XXPOLICY */
if (!vdev_readable(vd)) {
return;
}
case DKIOCFLUSHWRITECACHE:
break;
default:
}
return;
}
TQ_SLEEP), !=, 0);
}
/* ARGSUSED */
static void
{
}
NULL,
VDEV_TYPE_FILE, /* name of this vdev type */
B_TRUE /* leaf vdev */
};
/*
* From userland we access disks just like files.
*/
#ifndef _KERNEL
NULL,
VDEV_TYPE_DISK, /* name of this vdev type */
B_TRUE /* leaf vdev */
};
#endif