ctfs_ctl.c revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/vfs_opreg.h>
#include <sys/sysmacros.h>
#include <sys/contract.h>
#include <sys/contract_impl.h>
#include <sys/ctfs_impl.h>
/*
*/
/*
* ctfs_create_ctlnode
*
* If necessary, creates a ctlnode for a ctl file and inserts it into
* the specified cdirnode's gfs_dir_t. Returns either the existing
* vnode or the new one.
*/
vnode_t *
{
/*
* We transitively have a hold on the contract through our
* parent directory.
*/
return (vp);
}
/*
* ctfs_ctl_access - VOP_ACCESS entry point
*
* You only get to access ctl files for contracts you own or were
* abandoned and inherited by your containing process contract.
*/
/* ARGSUSED */
static int
int mode,
int flags,
{
return (EACCES);
return (0);
}
return (EACCES);
}
/*
* ctfs_ctl_open - VOP_OPEN entry point
*
* Just checks to make sure the mode bits are set, and that the
* constraints imposed by ctfs_ctl_access are met.
*/
static int
{
return (EINVAL);
}
/*
* ctfs_ctl_common_getattr
* Implements functionality common to ctl and status ctfs VOP_GETATTR
* entry points. It assumes vp->v_data is set
*/
static int
{
return (0);
}
/*
* ctfs_ctl_getattr - VOP_GETATTR entry point
*/
/* ARGSUSED */
static int
{
}
/*
* ctfs_stat_getattr - VOP_GETATTR entry point
*/
/* ARGSUSED */
static int
{
}
/*
* ctfs_ctl_ioctl - VOP_IOCTL entry point
*
* All the ct_ctl_*(3contract) interfaces point here.
*/
/* ARGSUSED */
static int
int cmd,
int flag,
int *rvalp,
{
int error = 0;
int ack;
switch (cmd) {
case CT_CABANDON:
break;
case CT_CACK:
case CT_CNACK:
return (EFAULT);
break;
case CT_CNEWCT:
break;
case CT_CQREQ:
return (EFAULT);
break;
case CT_CADOPT:
break;
default:
return (EINVAL);
}
return (error);
}
const fs_operation_def_t ctfs_tops_ctl[] = {
};
/*
* ctfs_create_statnode
*
* If necessary, creates a ctlnode for a status file and inserts it
* into the specified cdirnode's gfs_dir_t. Returns either the
* existing vnode or the new one.
*/
vnode_t *
{
/*
* We transitively have a hold on the contract through our
* parent directory.
*/
return (vp);
}
/*
* ctfs_stat_ioctl - VOP_IOCTL entry point
*
* The kernel half of ct_status_read(3contract).
*/
/* ARGSUSED */
static int
int cmd,
int flag,
int *rvalp,
{
if (cmd != CT_SSTATUS)
return (EINVAL);
return (EFAULT);
if (detail == CTD_COMMON) {
KM_SLEEP) == 0);
return (EFAULT);
}
} else {
return (EINVAL);
}
return (EFAULT);
return (0);
}
const fs_operation_def_t ctfs_tops_stat[] = {
};