ctfs_ctl.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#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
{
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_getattr - VOP_GETATTR entry point
*/
/* ARGSUSED */
static int
{
return (0);
}
/*
* ctfs_ctl_ioctl - VOP_IOCTL entry point
*
* All the ct_ctl_*(3contract) interfaces point here.
*/
/* ARGSUSED */
static int
int *rvalp)
{
int error = 0;
switch (cmd) {
case CT_CABANDON:
break;
case CT_CACK:
return (EFAULT);
break;
case CT_CNEWCT:
break;
case CT_CQREQ:
break;
case CT_CADOPT:
break;
default:
return (EINVAL);
}
return (error);
}
const fs_operation_def_t ctfs_tops_ctl[] = {
{ VOPNAME_OPEN, ctfs_ctl_open },
{ VOPNAME_CLOSE, ctfs_close },
{ VOPNAME_IOCTL, ctfs_ctl_ioctl },
{ VOPNAME_READDIR, fs_notdir },
{ VOPNAME_LOOKUP, fs_notdir },
};
/*
* 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 *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[] = {
{ VOPNAME_OPEN, ctfs_open },
{ VOPNAME_CLOSE, ctfs_close },
{ VOPNAME_IOCTL, ctfs_stat_ioctl },
{ VOPNAME_READDIR, fs_notdir },
{ VOPNAME_LOOKUP, fs_notdir },
};