vnode.c revision d5dbd18d69de8954ab5ceb588e99d43fc9b21d46
/*
* 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.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/pathname.h>
#include <sys/rwstlock.h>
#include <sys/sysmacros.h>
/* Determine if this vnode is a file that is read-only */
/*
* Convert stat(2) formats to vnode types and vice versa. (Knows about
* numerical order of S_IFMT and vnode types.)
*/
enum vtype iftovt_tab[] = {
};
ushort_t vttoif_tab[] = {
};
/*
* The system vnode cache.
*/
/*
* Vnode operations vector.
*/
static const fs_operation_trans_def_t vn_ops_table[] = {
};
/*
* Read or write a vnode. Called from kernel code.
*/
int
int ioflag,
{
int error;
int in_crit = 0;
return (EROFS);
if (len < 0)
return (EIO);
/*
* We have to enter the critical region before calling VOP_RWLOCK
* to avoid a deadlock with ufs.
*/
if (nbl_need_check(vp)) {
int svmand;
in_crit = 1;
if (error != 0)
goto done;
goto done;
}
}
(void) VOP_RWLOCK(vp,
} else {
}
NULL);
if (residp)
done:
if (in_crit)
return (error);
}
/*
* Release a vnode. Call VOP_INACTIVE on last reference or
* decrement reference count.
*
* To avoid race conditions, the v_count is left at 1 for
* the call to VOP_INACTIVE. This prevents another thread
* from reclaiming and releasing the vnode *before* the
* VOP_INACTIVE routine has a chance to destroy the vnode.
* We can't have more than 1 thread calling VOP_INACTIVE
* on a vnode.
*/
void
{
} else {
}
}
/*
* Like vn_rele() except that it clears v_stream under v_lock.
* This is used by sockfs when it dismantels the association between
* the sockfs node and the vnode in the underlaying file system.
* v_lock has to be held to prevent a thread coming through the lookupname
* path from accessing a stream head that is going away.
*/
void
{
} else {
}
}
int
char *pnamep,
int filemode,
int createmode,
{
}
/*
* This may be callable by the kernel, the only known use
* of user context being that the current user credentials
* are used for permissions. crwhy is defined iff filemode & FCREAT.
*/
int
char *pnamep,
int filemode,
int createmode,
{
int mode;
int error;
int in_crit = 0;
mode = 0;
/* symlink interpretation */
else
top:
/*
* Wish to create a file.
*/
}
else
if (error =
return (error);
} else {
/*
* Wish to open a file. Just look it up.
*/
goto top;
return (error);
}
/*
* Get the attributes to check whether file is large.
* We do this only if the FOFFMAX flag is not set and
* only for regular files.
*/
goto out;
}
/*
* Large File API - regular open fails
* if FOFFMAX flag is set in file mode
*/
goto out;
}
}
/*
* Can't write directories, active texts, or
* read-only filesystems. Can't truncate files
* on which mandatory locking is in effect.
*/
/*
* Allow writable directory if VDIROPEN flag is set.
*/
goto out;
}
goto out;
}
/*
* Can't truncate files on which mandatory locking
* or non-blocking mandatory locking is in effect.
*/
if (nbl_need_check(vp)) {
in_crit = 1;
CRED())) == 0) {
if (!error) {
if (nbl_conflict(vp,
NBL_WRITE, 0,
}
}
}
}
if (error)
goto out;
}
/*
* Check permissions.
*/
goto out;
}
/*
* Do remaining checks for FNOFOLLOW and FNOLINKS.
*/
goto out;
}
goto out;
}
goto out;
}
}
/*
* Opening a socket corresponding to the AF_UNIX pathname
* in the filesystem name space is not supported.
* However, VSOCK nodes in namefs are supported in order
* to make fattach work for sockets.
*
* XXX This uses VOP_REALVP to distinguish between
* an unopened namefs node (where VOP_REALVP returns a
* different VSOCK vnode) and a VSOCK created by vn_create
* in some file system (where VOP_REALVP would never return
* a different vnode).
*/
error = EOPNOTSUPP;
goto out;
}
}
/*
* Do opening protocol.
*/
/*
* Truncate if required.
*/
}
out:
if (in_crit) {
in_crit = 0;
}
if (error) {
/*
* The following clause was added to handle a problem
* with NFS consistency. It is possible that a lookup
* of the file to be opened succeeded, but the file
* itself doesn't actually exist on the server. This
* is chiefly due to the DNLC containing an entry for
* the file which has been removed on the server. In
* this case, we just start over. If there was some
* other cause for the ESTALE error, then the lookup
* of the file will fail and the error will be returned
* above instead of looping around from here.
*/
goto top;
} else
return (error);
}
int
char *pnamep,
int mode,
int flag,
{
}
/*
* Create a vnode (makenode).
*/
int
char *pnamep,
int mode,
int flag,
{
int error;
int in_crit = 0;
/* symlink interpretation */
else
top:
/*
* Lookup directory.
* If new object is a file, call lower level to create it.
* Note that it is up to the lower level to enforce exclusive
* creation, if the file is already there.
* This allows the lower level to do whatever
* locking or protocol that is needed to prevent races.
* If the new object is directory call lower level to make
* the new directory, with "." and "..".
*/
return (error);
#ifdef C2_AUDIT
if (audit_active)
#endif /* C2_AUDIT */
/*
* lookup will find the parent directory for the vnode.
* When it is done the pn holds the name of the entry
* in the directory.
* If this is a non-exclusive create we also find the node itself.
*/
if (error) {
goto top;
return (error);
}
/*
* If default ACLs are defined for the directory don't apply the
* umask if umask is passed.
*/
if (umask) {
vsec.vsa_aclcnt = 0;
vsec.vsa_dfaclcnt = 0;
goto out;
}
/*
* Apply the umask if no default ACLs.
*/
if (vsec.vsa_dfaclcnt == 0)
/*
* VOP_GETSECATTR() may have allocated memory for ACLs we
* didn't request, so double-check and free it if necessary.
*/
}
/*
* In general we want to generate EROFS if the file system is
* readonly. However, POSIX (IEEE Std. 1003.1) section 5.3.1
* documents the open system call, and it says that O_CREAT has no
* effect if the file already exists. Bug 1119649 states
* that open(path, O_CREAT, ...) fails when attempting to open an
* existing file on a read only file system. Thus, the first part
* of the following if statement has 3 checks:
* if the file exists &&
* it is being open with write access &&
* the file system is read only
* then generate EROFS
*/
if (*vpp)
/*
* File already exists. If a mandatory lock has been
* applied, return error.
*/
in_crit = 1;
}
goto out;
}
goto out;
}
/*
* File cannot be truncated if non-blocking mandatory
* locks are currently on the file.
*/
length, 0)) {
goto out;
}
}
}
/*
* If the file is the root of a VFS, we've crossed a
* mount point and the "containing" directory that we
* acquired above (dvp) is irrelevant because it's in
* a different file system. We apply VOP_CREATE to the
* target itself instead of to the containing directory
* and supply a null path name to indicate (conventionally)
* the node itself as the "component" of interest.
*
* The intercession of the file system is necessary to
* ensure that the appropriate permission checks are
* done.
*/
error =
flag);
/*
* If the create succeeded, it will have created
* a new reference to the vnode. Give up the
* original reference. The assertion should not
* get triggered because NBMAND locks only apply to
* VREG files. And if in_crit is non-zero for some
* reason, detect that here, rather than when we
* deference a null vp.
*/
goto out;
}
/*
* Large File API - non-large open (FOFFMAX flag not set)
* of regular file fails if the file size exceeds MAXOFF32_T.
*/
goto out;
}
goto out;
}
}
}
if (error == 0) {
/*
* Call mkdir() if specified, otherwise create().
*/
else if (!must_be_dir)
else
}
out:
#ifdef C2_AUDIT
if (audit_active)
#endif /* C2_AUDIT */
if (in_crit) {
in_crit = 0;
}
}
/*
* The following clause was added to handle a problem
* with NFS consistency. It is possible that a lookup
* of the file to be created succeeded, but the file
* itself doesn't actually exist on the server. This
* is chiefly due to the DNLC containing an entry for
* the file which has been removed on the server. In
* this case, we just start over. If there was some
* other cause for the ESTALE error, then the lookup
* of the file will fail and the error will be returned
* above instead of looping around from here.
*/
goto top;
return (error);
}
int
{
int error;
top:
return (error);
goto out;
goto out;
/*
* Make sure both source vnode and target directory vnode are
* in the same vfs and that it is writeable.
*/
goto out;
goto out;
goto out;
}
goto out;
}
/*
* Do the link.
*/
(void) pn_fixslash(&pn);
out:
if (fvp)
if (tdvp)
goto top;
return (error);
}
int
{
}
int
{
int error;
int in_crit = 0;
top:
/*
* Get to and from pathnames.
*/
return (error);
return (error);
}
/*
* First we need to resolve the correct directories
* The passed in directories may only be a starting point,
* but we need the real directories the file(s) live in.
* and we were passed in the / directory, but we need to
* use the lib directory for the rename.
*/
#ifdef C2_AUDIT
if (audit_active)
#endif /* C2_AUDIT */
/*
* Lookup to and from directories.
*/
goto out;
}
/*
* Make sure there is an entry.
*/
goto out;
}
#ifdef C2_AUDIT
if (audit_active)
#endif /* C2_AUDIT */
goto out;
}
/*
* Make sure both the from vnode directory and the to directory
* are in the same vfs and the to directory is writable.
* We check fsid's, not vfs pointers, so loopback fs works.
*/
goto out;
goto out;
goto out;
}
}
goto out;
}
if (nbl_need_check(fvp)) {
in_crit = 1;
goto out;
}
}
/*
* Do the rename.
*/
(void) pn_fixslash(&tpn);
out:
if (in_crit) {
in_crit = 0;
}
if (fromvp)
if (tovp)
if (fvp)
goto top;
return (error);
}
/*
* Remove a file or directory.
*/
int
{
}
int
{
int error;
int in_crit = 0;
top:
return (error);
goto top;
return (error);
}
/*
* Make sure there is an entry.
*/
goto out;
}
/*
* If the named file is the root of a mounted filesystem, fail,
* unless it's marked unlinkable. In that case, unmount the
* filesystem and proceed to unlink the covered vnode. (If the
* covered vnode is a directory, use rmdir instead of unlink,
* to avoid file system corruption.)
*/
if (dirflag == RMDIRECTORY) {
/*
* User called rmdir(2) on a file that has
* been namefs mounted on top of. Since
* namefs doesn't allow directories to
* be mounted on other files we know
* vp is not of type VDIR so fail to operation.
*/
goto out;
}
/*
* Unmounted the namefs file system; now get
* the object it was mounted over.
*/
/*
* If namefs was mounted over a directory, then
* we want to use rmdir() instead of unlink().
*/
} else
if (error)
goto out;
}
/*
* Make sure filesystem is writeable.
* We check the parent directory's vfs in case this is an lofs vnode.
*/
goto out;
}
/*
* If there is the possibility of an nbmand share reservation, make
* sure it's okay to remove the file. Keep a reference to the
* vnode, so that we can exit the nbl critical region after
* calling VOP_REMOVE.
* If there is no possibility of an nbmand share reservation,
* release the vnode reference now. Filesystems like NFS may
* behave differently if there is an extra reference, so get rid of
* this one. Fortunately, we can't have nbmand mounts on NFS
* filesystems.
*/
if (nbl_need_check(vp)) {
in_crit = 1;
goto out;
}
} else {
}
if (dirflag == RMDIRECTORY) {
/*
* Caller is using rmdir(2), which can only be applied to
* directories.
*/
} else {
}
} else {
/*
* Unlink(2) can be applied to anything.
*/
}
out:
if (in_crit) {
in_crit = 0;
}
goto top;
return (error);
}
/*
* Utility function to compare equality of vnodes.
* Compare the underlying real vnodes, if there are underlying vnodes.
* This is a more thorough comparison than the VN_CMP() macro provides.
*/
int
{
}
/*
* The number of locks to hash into. This value must be a power
* of 2 minus 1 and should probably also be prime.
*/
#define NUM_BUCKETS 1023
struct vn_vfslocks_bucket {
};
/*
* Total number of buckets will be NUM_BUCKETS + 1 .
*/
#define VN_VFSLOCKS_SHIFT 9
#define VN_VFSLOCKS_HASH(vfsvpptr) \
/*
* vn_vfslocks_getlock() uses an HASH scheme to generate
*
* vn_vfslocks_rele() releases a reference in the
* HASH table which allows the entry allocated by
* vn_vfslocks_getlock() to be freed at a later
* stage when the refcount drops to zero.
*/
vn_vfslocks_getlock(void *vfsvpptr)
{
struct vn_vfslocks_bucket *bp;
return (vep);
}
}
/*
* There is already an entry in the hash
* destroy what we just allocated.
*/
return (tvep);
}
}
return (vep);
}
void
{
struct vn_vfslocks_bucket *bp;
else {
/* LINTED */
}
return;
}
}
}
}
/*
* vn_vfswlock_wait is used to implement a lock which is logically a writers
* lock protecting the v_vfsmountedhere field.
* vn_vfswlock_wait has been modified to be similar to vn_vfswlock,
* except that it blocks to acquire the lock VVFSLOCK.
*
* traverse() and routines re-implementing part of traverse (e.g. autofs)
* need to hold this lock. mount(), vn_rename(), vn_remove() and so on
* need the non-blocking version of the writers lock i.e. vn_vfswlock
*/
int
{
int retval;
return (EINTR);
}
return (retval);
}
int
{
int retval;
return (EINTR);
}
return (retval);
}
/*
* vn_vfswlock is used to implement a lock which is logically a writers lock
* protecting the v_vfsmountedhere field.
*/
int
{
/*
* If vp is NULL then somebody is trying to lock the covered vnode
* of /. (vfs_vnodecovered is NULL for /). This situation will
* only happen when unmounting /. Since that operation will fail
* anyway, return EBUSY here instead of in VFS_UNMOUNT.
*/
return (EBUSY);
return (0);
return (EBUSY);
}
int
{
/*
* If vp is NULL then somebody is trying to lock the covered vnode
* of /. (vfs_vnodecovered is NULL for /). This situation will
* only happen when unmounting /. Since that operation will fail
* anyway, return EBUSY here instead of in VFS_UNMOUNT.
*/
return (EBUSY);
return (0);
return (EBUSY);
}
void
{
/*
* ve_refcnt needs to be decremented twice.
* 1. To release refernce after a call to vn_vfslocks_getlock()
* 2. To release the reference from the locking routines like
* vn_vfsrlock/vn_vfswlock etc,.
*/
}
int
{
int held;
return (held);
}
int
const char *name, /* Name of file system */
{
int unused_ops;
int error;
if (error) {
}
#if DEBUG
if (unused_ops != 0)
#endif
return (error);
}
/*
* Free the vnodeops created as a result of vn_make_ops()
*/
void
{
}
/*
* Vnode cache.
*/
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static void
{
}
void
vn_create_cache(void)
{
NULL, 0);
}
void
vn_destroy_cache(void)
{
}
/*
* Used by file systems when fs-specific nodes (e.g., ufs inodes) are
* cached by the file system and vnodes remain associated.
*/
void
{
/*
* XXX - This really belongs in vn_reinit(), but we have some issues
* with the counts. Best to have it here for clean initialization.
*/
vp->v_mmap_read = 0;
vp->v_mmap_write = 0;
/*
* If FEM was in use, make sure everything gets cleaned up
* NOTE: vp->v_femhead is initialized to NULL in the vnode
* constructor.
*/
/* XXX - There should be a free_femhead() that does all this */
}
}
}
/*
* Used to reset the vnode fields including those that are directly accessible
* as well as those which require an accessor function.
*
* Does not initialize:
* synchronization objects: v_lock, v_nbllock, v_cv
* v_data (since FS-nodes and vnodes point to each other and should
* be updated simultaneously)
* v_op (in case someone needs to make a VOP call on this object)
*/
void
{
vp->v_msnpages = 0;
vp->v_scantime = 0;
vn_recycle(vp);
}
vnode_t *
{
}
return (vp);
}
void
{
/*
* Some file systems call vn_free() with v_count of zero,
* some with v_count of 1. In any case, the value should
* never be anything else.
*/
}
/* If FEM was in use, make sure everything gets cleaned up */
/* XXX - There should be a free_femhead() that does all this */
}
}
/*
* vnode status changes, should define better states than 1, 0.
*/
void
{
return;
}
}
void
{
return;
}
}
void
{
return;
}
}
void
{
return;
}
}
/* Vnode event notification */
int
{
return (EINVAL);
}
void
{
return;
}
}
void
{
return;
}
}
void
{
return;
}
}
void
{
return;
}
}
/*
* Vnode accessors.
*/
int
{
}
int
{
}
int
{
}
int
{
}
/*
* Return 0 if the vnode in question shouldn't be permitted into a zone via
* zone_enter(2).
*/
int
{
int allow = 1;
/*
* We always want to look at the underlying vnode if there is one.
*/
/*
* Some pseudo filesystems (including doorfs) don't actually register
* their vfsops_t, so the following may return NULL; we happily let
* such vnodes switch zones.
*/
allow = 0;
}
return (allow);
}
/*
* Return nonzero if the vnode is a mount point, zero if not.
*/
int
{
}
/* Retrieve the vfs (if any) mounted on this vnode */
vfs_t *
{
return (vp->v_vfsmountedhere);
}
/*
* vn_is_opened() checks whether a particular file is opened and
*
* Vnode counts are only kept on regular files (v_type=VREG).
*/
int
{
switch (mode) {
case V_WRITE:
return (V_TRUE);
break;
case V_RDANDWR:
return (V_TRUE);
break;
case V_RDORWR:
return (V_TRUE);
break;
case V_READ:
return (V_TRUE);
break;
}
return (V_FALSE);
}
/*
* vn_is_mapped() checks whether a particular file is mapped and whether
*/
int
{
#if !defined(_LP64)
switch (mode) {
/*
* The atomic_add_64_nv functions force atomicity in the
* case of 32 bit architectures. Otherwise the 64 bit values
* require two fetches. The value of the fields may be
* (potentially) changed between the first fetch and the
* second
*/
case V_WRITE:
return (V_TRUE);
break;
case V_RDANDWR:
return (V_TRUE);
break;
case V_RDORWR:
return (V_TRUE);
break;
case V_READ:
return (V_TRUE);
break;
}
#else
switch (mode) {
case V_WRITE:
if (vp->v_mmap_write)
return (V_TRUE);
break;
case V_RDANDWR:
return (V_TRUE);
break;
case V_RDORWR:
return (V_TRUE);
break;
case V_READ:
if (vp->v_mmap_read)
return (V_TRUE);
break;
}
#endif
return (V_FALSE);
}
/*
* Set the operations vector for a vnode.
*
* FEM ensures that the v_femhead pointer is filled in before the
* v_op pointer is changed. This means that if the v_femhead pointer
* is NULL, and the v_op field hasn't changed since before which checked
* the v_femhead pointer; then our update is ok - we are not racing with
* FEM.
*/
void
{
vnodeops_t *op;
/*
* If vp->v_femhead == NULL, then we'll call casptr() to do the
* compare-and-swap on vp->v_op. If either fails, then FEM is
* in effect on the vnode and we need to have FEM deal with it.
*/
}
}
/*
* Retrieve the operations vector for a vnode
* As with vn_setops(above); make sure we aren't racing with FEM.
* FEM sets the v_op to a special, internal, vnodeops that wouldn't
* make sense to the callers of this routine.
*/
{
vnodeops_t *op;
return (op);
} else {
return (fem_getvnops(vp));
}
}
/*
* Returns non-zero (1) if the vnodeops matches that of the vnode.
* Returns zero (0) if not.
*/
int
{
}
/*
* Returns non-zero (1) if the specified operation matches the
* corresponding operation for that the vnode.
* Returns zero (0) if not.
*/
int
{
const fs_operation_trans_def_t *otdp;
break;
}
}
}
/*
* fs_new_caller_id() needs to return a unique ID on a given local system.
* The IDs do not need to survive across reboots. These are primarily
* used so that (FEM) monitors can detect particular callers (such as
*/
{
}
/*
* Given a starting vnode and a path, updates the path in the target vnode in
* a safe manner. If the vnode already has path information embedded, then the
* cached path is left untouched.
*/
void
{
char *rpath;
int doslash = 1;
if (*path == '/') {
path++;
plen--;
} else {
}
/*
* We cannot grab base->v_lock while we hold vp->v_lock because of
* the potential for deadlock.
*/
return;
}
/* Avoid adding a slash if there's already one there */
doslash = 0;
else
rpathalloc++;
/*
* We don't want to call kmem_alloc(KM_SLEEP) with kernel locks held,
* so we must do this dance. If, by chance, something changes the path,
* just give up since there is no real harm.
*/
return;
}
if (doslash)
} else {
}
}
/*
* Sets the path to the vnode to be the given string, regardless of current
* context. The string must be a complete path from rootdir. This is only used
* by fsop_root() for setting the path based on the mountpoint.
*/
void
{
return;
}
}
/*
* Similar to vn_setpath_str(), this function sets the path of the destination
* vnode to the be the same as the source vnode.
*/
void
{
char *buf;
int alloc;
return;
}
/* avoid kmem_alloc() with lock held */
return;
}
return;
}
}
/*
* XXX Private interface for segvn routines that handle vnode
* large page segments.
*
* return 1 if vp's file system VOP_PAGEIO() implementation
* can be safely used instead of VOP_GETPAGE() for handling
* pagefaults against regular non swap files. VOP_PAGEIO()
* interface is considered safe here if its implementation
* is very close to VOP_GETPAGE() implementation.
* e.g. It zero's out the part of the page beyond EOF. Doesn't
* panic if there're file holes but instead returns an error.
* Doesn't assume file won't be changed by user writes, etc.
*
* return 0 otherwise.
*
* For now allow segvn to only use VOP_PAGEIO() with ufs and nfs.
*/
int
{
char **fsok = pageio_ok_fss;
return (0);
}
return (1);
}
}
return (0);
}
/* VOP_XXX() macros call the corresponding fop_xxx() function */
int
int mode,
{
int ret;
/*
* Adding to the vnode counts before calling open
* avoids the need for a mutex. It circumvents a race
* condition where a query made on the vnode counts results in a
* false negative. The inquirer goes away believing the file is
* not open when there is an open on the file already under way.
*
* The counts are meant to prevent NFS from granting a delegation
* when it would be dangerous to do so.
*
* The vnode counts are only kept on regular files
*/
}
if (ret) {
/*
* Use the saved vp just in case the vnode ptr got trashed
* by the error.
*/
} else {
/*
* Some filesystems will return a different vnode,
* but the same path was still used to open it.
* So if we do change the vnode and need to
* copy over the path, do so here, rather than special
* casing each filesystem. Adjust the vnode counts to
* reflect the vnode switch.
*/
}
}
return (ret);
}
int
int flag,
int count,
{
int error;
/*
* Check passed in count to handle possible dups. Vnode counts are only
* kept on regular files
*/
}
}
}
return (error);
}
int
int ioflag,
struct caller_context *ct)
{
}
int
int ioflag,
struct caller_context *ct)
{
}
int
int cmd,
int flag,
int *rvalp)
{
}
int
int oflags,
int nflags,
{
}
int
int flags,
{
}
int
int flags,
{
}
int
int mode,
int flags,
{
}
int
char *nm,
int flags,
{
int ret;
return (ret);
}
int
char *name,
int mode,
int flag)
{
int ret;
return (ret);
}
int
char *nm,
{
}
int
char *tnm,
{
}
int
char *snm,
char *tnm,
{
}
int
char *dirname,
{
int ret;
return (ret);
}
int
char *nm,
{
}
int
int *eofp)
{
}
int
char *linkname,
char *target,
{
}
int
{
}
int
int syncflag,
{
}
void
{
}
int
{
}
int
int write_lock,
{
}
void
int write_lock,
{
}
int
{
}
int
{
}
int
int cmd,
int flag,
struct flk_callback *flk_cbp,
{
}
int
int cmd,
int flag,
{
}
int
{
}
int
{
}
int
int flags,
{
}
int
{
}
int
{
int error;
/*
* If file is declared MAP_PRIVATE, it can't be written back
* even if open for write. Handle as read.
*/
if (flags & MAP_PRIVATE) {
} else {
/*
* atomic_add_64 forces the fetch of a 64 bit value to
* be atomic on 32 bit machines
*/
if (maxprot & PROT_WRITE)
}
}
return (error);
}
int
{
int error;
/*
* NFS calls into delmap twice, the first time
* it simply establishes a callback mechanism and returns EAGAIN
* while the real work is being done upon the second invocation.
* We have to detect this here and only decrement the counts upon
* the second delmap request.
*/
if (flags & MAP_PRIVATE) {
} else {
/*
* atomic_add_64 forces the fetch of a 64 bit value
* to be atomic on 32 bit machines
*/
if (maxprot & PROT_WRITE)
}
}
return (error);
}
int
short events,
int anyyet,
short *reventsp,
{
}
int
int lbdn,
int dblks)
{
}
int
int cmd,
{
}
int
int flags,
{
}
int
int action,
int *blkp)
{
}
void
int flag,
int dn,
{
}
int
int flag,
{
}
int
int flag,
{
}
int
int cmd,
int flag,
{
}
int
{
}