/*
* 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 <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <shadowtest.h>
static int g_ctlfd;
static int
{
return (-1);
}
/*
* Given the root of the filesystem, open the pending FID list and return an
* array of fid_t structures.
*/
static fid_t *
{
int fd;
int i;
idx);
return (NULL);
}
return (NULL);
}
return (NULL);
}
return (NULL);
}
return (NULL);
}
/* XXX verify endianness */
(void) st_error("misaligned fid list (%d %% %d) in %s\n",
return (NULL);
}
(void) st_error("allocation failed");
return (NULL);
}
for (i = 0; i < *count; i++) {
(void) st_error("failed to read fid list from %s\n",
path);
return (NULL);
}
}
return (ret);
}
/*
* Given a path to file or directory, return the root of the filesystem
* containing the given object.
*/
static int
{
int ret;
maxlen = 0;
continue;
rootlen);
}
}
if (maxlen == 0)
return (0);
}
int
{
int fd;
}
return (0);
}
int
{
int fd;
}
return (0);
}
/*
* Verify that the pending FID list matches the list of files passed as
* parameters. The 'idx' parameter controls which list should be checked (0 or
* 1).
*/
int
{
int i, j;
if (argc == 0)
return (st_error("no arguments passed to "
"st_verify_pending()\n"));
/*
* Determine the root of the filesystem from the first argument. If
* the user specifies files from multiple filesystems - it's their own
* fault. The VOP_FID() call will fail in this case.
*/
return (-1);
return (-1);
return (st_error("pending list has %d entries, expecting %d\n",
}
if (nfid == 0) {
return (0);
}
/*
* The order in which entries are stored in the fidlist are arbitrary,
* so we need to have a separate array to track matches, and make sure
* we see every FID exactly once.
*/
return (st_error("allocation failed"));
}
for (i = 0; i < argc; i++) {
return (-1);
}
for (j = 0; j < argc; j++) {
break;
}
}
if (j == argc) {
return (st_error("failed to find %s on fid list\n",
argv[i]));
}
}
for (j = 0; j < argc; j++) {
if (!matched[j]) {
return (st_error("fid %d not found, multiple entries "
"for same object present\n"));
}
}
return (0);
}
/*
* Verify that the pending list is empty.
*/
int
{
return (-1);
return (-1);
if (nfid != 0) {
return (st_error("pending list has %d entries, expecting 0\n",
nfid));
}
return (0);
}
/*
* Suspend or resume execution of any asynchronous rotation of pending FID
* lists.
*/
int
st_suspend(void)
{
return (st_error("failed to suspend rotation"));
return (0);
}
int
st_resume(void)
{
return (st_error("failed to suspend rotation"));
return (0);
}
/*
* Manually rotate the pending FID list. This is only guaranteed to work if
* st_suspend() has been called.
*/
int
{
int fd;
return (st_error("failed to rotate log"));
}
return (0);
}
/*
* Manually set a shadow mount to spin waiting for a signal. Can be used to
* test EINTR handling.
*/
int
{
int fd;
return (st_error("failed to set spin mode"));
}
return (0);
}
/*
* Overrides the credentials used when migrating file contents so that we can
* test various failure modes.
*/
int
st_cred_set(void)
{
return (st_error("failed to set cred"));
return (0);
}
int
st_cred_clear(void)
{
return (st_error("failed to set cred"));
return (0);
}
/*
* Iterate over all entries in the space map and invoke the callback for each
* one.
*/
int
{
return (-1);
}
(void) st_error("failed to open SUNWshadow.map "
"attribute on %s", path);
return (-1);
}
(void) st_error("failed to read space map header");
return (-1);
}
(void) st_error("invalid space map header");
return (-1);
}
return (0);
}
/*
* Initialize and tear down global library state.
*/
int
st_init(void)
{
return (0);
}
void
st_fini(void)
{
}