door_vnops.c revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
struct vnodeops *door_vnodeops;
const fs_operation_def_t door_vnodeops_template[] = {
};
/* ARGSUSED */
static int
{
/*
* MAC policy for doors. Restrict cross-zone open()s so that only
* door servers in the global zone can have clients from other zones.
* For other zones, client must be within the same zone as server.
*/
if (is_system_labeled()) {
if (DOOR_INVALID(dp)) {
return (0);
}
if (server_zone != global_zone &&
return (EACCES);
}
return (0);
}
/* ARGSUSED */
static int
int flag,
int count,
)
{
/*
* If this is being called from closeall on exit, any doors created
* by this process should have been revoked already in door_exit.
*/
/*
* Deliver an unref if needed.
*
* If the count is equal to 2, it means that I'm doing a VOP_CLOSE
* on the next to last reference for *this* file struct. There may
* be multiple files pointing to this vnode in which case the v_count
* will be > 1.
*
* The door_active count is bumped during each invocation.
*/
if (dp->door_active == 0) {
/* o.k. to deliver unref now */
} else {
/* do the unref later */
}
}
return (0);
}
/* ARGSUSED */
static int
{
static timestruc_t tzero = {0, 0};
return (0);
}
/* ARGSUSED */
static void
{
/*
* Once the door_node is unreferenced, it stays unreferenced,
* so we can simply return if there are active thread bindings;
* the final door_unbind_thread() will re-invoke us.
*/
if (dp->door_bound_threads > 0) {
return;
}
/* if not revoked, remove door from per-process list */
if (dp->door_target) {
}
vn_invalid(vp);
}
/*
* To avoid having bound threads interfere with unref processing, we
* pool. Instead, we keep a separate counter, also under v_lock.
*/
void
{
dp->door_bound_threads++;
}
void
{
int do_inactive = 0;
/* set up for inactive handling */
do_inactive = 1;
}
if (do_inactive)
}
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static int
{
return (0);
}