vnode.c revision ca2c313831d5ab50b351578f2405a2c129436534
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License, Version 1.0 only
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (the "License"). You may not use this file except in compliance
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* All Rights Reserved */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * University Copyright- Copyright (c) 1982, 1986, 1988
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The Regents of the University of California
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * All Rights Reserved
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * University Acknowledgment- Portions of this document are derived from
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * software developed by the University of California, Berkeley, and its
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * contributors.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma ident "%Z%%M% %I% %E% SMI"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Determine if this vnode is a file that is read-only */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((vp)->v_type != VCHR && (vp)->v_type != VBLK && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Convert stat(2) formats to vnode types and vice versa. (Knows about
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * numerical order of S_IFMT and vnode types.)
int ioflag,
int error;
int in_crit = 0;
return (EROFS);
if (len < 0)
return (EIO);
int svmand;
if (error != 0)
goto done;
goto done;
NULL);
if (residp)
done:
if (in_crit)
return (error);
char *pnamep,
int filemode,
int createmode,
char *pnamep,
int filemode,
int createmode,
int mode;
int error;
int in_crit = 0;
mode = 0;
top:
if (error =
return (error);
goto top;
return (error);
goto out;
goto out;
goto out;
goto out;
CRED())) == 0) {
if (!error) {
NBL_WRITE, 0,
if (error)
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
out:
if (in_crit) {
in_crit = 0;
if (error) {
goto top;
return (error);
char *pnamep,
int mode,
int flag,
char *pnamep,
int mode,
int flag,
int error;
int in_crit = 0;
top:
return (error);
#ifdef C2_AUDIT
if (audit_active)
if (error) {
goto top;
return (error);
if (umask) {
goto out;
if (*vpp)
goto out;
goto out;
length, 0)) {
goto out;
error =
flag);
goto out;
goto out;
goto out;
if (error == 0) {
else if (!must_be_dir)
out:
#ifdef C2_AUDIT
if (audit_active)
if (in_crit) {
in_crit = 0;
goto top;
return (error);
int error;
top:
return (error);
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
out:
if (fvp)
if (tdvp)
goto top;
return (error);
int error;
int in_crit = 0;
top:
return (error);
return (error);
#ifdef C2_AUDIT
if (audit_active)
goto out;
goto out;
#ifdef C2_AUDIT
if (audit_active)
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
out:
if (in_crit) {
in_crit = 0;
if (fromvp)
if (tovp)
if (fvp)
goto top;
return (error);
int error;
int in_crit = 0;
top:
return (error);
goto top;
return (error);
goto out;
goto out;
if (error)
goto out;
goto out;
goto out;
out:
if (in_crit) {
in_crit = 0;
goto top;
return (error);
struct vn_vfslocks_bucket {
return (vep);
return (tvep);
return (vep);
int retval;
return (EINTR);
return (retval);
int retval;
return (EINTR);
return (retval);
return (EBUSY);
return (EBUSY);
return (EBUSY);
return (EBUSY);
* vn_vfsrlock/vn_vfswlock etc,.
int held;
return (held);
int unused_ops;
int error;
if (error) {
#if DEBUG
if (unused_ops != 0)
return (error);
vn_create_cache(void)
NULL, 0);
vn_destroy_cache(void)
vnode_t *
return (vp);
return (EINVAL);
allow = 0;
return (allow);
vfs_t *
switch (mode) {
case V_WRITE:
return (V_TRUE);
case V_RDANDWR:
return (V_TRUE);
case V_RDORWR:
return (V_TRUE);
case V_READ:
return (V_TRUE);
return (V_FALSE);
#if !defined(_LP64)
switch (mode) {
case V_WRITE:
return (V_TRUE);
case V_RDANDWR:
return (V_TRUE);
case V_RDORWR:
return (V_TRUE);
case V_READ:
return (V_TRUE);
switch (mode) {
case V_WRITE:
return (V_TRUE);
case V_RDANDWR:
return (V_TRUE);
case V_RDORWR:
return (V_TRUE);
case V_READ:
return (V_TRUE);
return (V_FALSE);
return (op);
char *rpath;
path++;
plen--;
doslash = 0;
rpathalloc++;
if (doslash)
char *buf;
int alloc;
int mode,
int ret;
if (ret) {
return (ret);
int flag,
int count,
int error;
return (error);
int ioflag,
int ioflag,
int cmd,
int flag,
int *rvalp)
int oflags,
int nflags,
int flags,
int flags,
int mode,
int flags,
char *nm,
int flags,
int ret;
return (ret);
char *name,
int mode,
int flag)
int ret;
return (ret);
char *nm,
char *tnm,
char *snm,
char *tnm,
char *dirname,
int ret;
return (ret);
char *nm,
int *eofp)
char *linkname,
char *target,
int syncflag,
int write_lock,
int write_lock,
int cmd,
int flag,
int cmd,
int flag,
int flags,
int error;
return (error);
int error;
return (error);
short events,
int anyyet,
short *reventsp,
int lbdn,
int dblks)
int cmd,
int flags,
int action,
int *blkp)
int flag,
int dn,
int flag,
int flag,
int cmd,
int flag,