/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/
#include <sys/pathname.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include "vncache.h"
int fop_shrlock_enable = 0;
/* ARGSUSED */
int
int mode,
{
}
/* call to ->vop_open was here */
return (0);
}
/* ARGSUSED */
int
int flag,
int count,
{
/* call to ->vop_close was here */
/*
* Check passed in count to handle possible dups. Vnode counts are only
* kept on regular files
*/
}
}
}
return (0);
}
/* ARGSUSED */
int
int ioflag,
{
int n;
/*
* If that caller asks for read beyond end of file,
* that causes the pread call to block. (Ugh!)
* Get the file size and return what we can.
*/
while (resid > 0) {
uio->uio_iovcnt--;
continue;
}
if (n < 0)
return (errno);
uio->uio_loffset += n;
resid -= n;
}
return (0);
}
/* ARGSUSED */
int
int ioflag,
{
int n;
uio->uio_iovcnt--;
continue;
}
uio->uio_loffset);
if (n < 0)
return (errno);
uio->uio_loffset += n;
}
}
return (0);
}
/* ARGSUSED */
int
int cmd,
int flag,
int *rvalp,
{
return (ENOSYS);
}
/* ARGSUSED */
int
int oflags,
int nflags,
{
/* allow any flags? See fs_setfl */
return (0);
}
/* ARGSUSED */
int
int flags,
{
int error;
return (errno);
return (error);
}
/* ARGSUSED */
int
int flags,
{
return (errno);
}
/* AT_MODE or anything else? */
} else {
}
} else {
}
}
return (0);
}
/* ARGSUSED */
int
int mode,
int flags,
{
return (0);
}
/* ARGSUSED */
int
char *name,
int flags,
int *deflags, /* Returned per-dirent flags */
{
int fd;
if (flags & LOOKUP_XATTR)
return (ENOENT);
/*
* If lookup is for "", just return dvp.
*/
if (name[0] == '\0') {
return (0);
}
return (errno);
/* lookup gave us a hold */
return (0);
}
if (fd < 0) {
goto again;
}
return (errno);
}
return (errno);
}
return (0);
}
/* ARGSUSED */
int
char *name,
int mode,
int flags,
{
/*
* If creating "", just return dvp.
*/
if (name[0] == '\0') {
return (0);
}
if (err != 0)
if (err == 0) {
/* The file already exists. */
return (EEXIST);
/* vp gained a hold */
}
/*
* Open it. (may or may not exist)
*/
if (fd < 0) {
goto open_again;
}
return (errno);
}
/* vp has its initial hold */
}
/* Should have the vp now. */
return (EFAULT);
return (EISDIR);
}
return (ENOTDIR);
}
/*
* Might need to set attributes.
*/
return (0);
}
/* ARGSUSED */
int
char *name,
int flags)
{
return (errno);
return (0);
}
/* ARGSUSED */
int
char *to_name,
int flags)
{
int err;
/*
* Would prefer to specify "from" as the combination:
* (fr_vp->v_fd, NULL) but linkat does not permit it.
*/
if (err == -1)
return (err);
}
/* ARGSUSED */
int
char *from_name,
char *to_name,
int flags)
{
int err;
AT_SYMLINK_NOFOLLOW) == -1)
return (errno);
return (ENOENT);
if (err == -1)
else
return (err);
}
/* ARGSUSED */
int
char *name,
int flags,
{
return (errno);
return (errno);
return (err);
}
/*
* Might need to set attributes.
*/
return (0);
}
/* ARGSUSED */
int
char *name,
int flags)
{
return (errno);
return (0);
}
/* ARGSUSED */
int
int *eofp,
int flags)
{
int cnt;
int error = 0;
if (eofp) {
*eofp = 0;
}
if (error == -1)
return (errno);
return (EINVAL);
/* LINTED E_BAD_PTR_CAST_ALIGN */
if (cnt == -1)
return (errno);
if (cnt == 0) {
if (eofp) {
*eofp = 1;
}
return (ENOENT);
}
return (0);
}
/* ARGSUSED */
int
char *linkname,
char *target,
int flags)
{
return (ENOSYS);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
int syncflag,
{
return (errno);
return (0);
}
/* ARGSUSED */
void
{
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
int write_lock,
{
/* See: fs_rwlock */
return (-1);
}
/* ARGSUSED */
void
int write_lock,
{
/* See: fs_rwunlock */
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
{
/* See fs_cmp */
}
/* ARGSUSED */
int
int cmd,
int flag,
struct flk_callback *flk_cbp,
{
/* See fs_frlock */
switch (cmd) {
case F_GETLK:
case F_SETLK_NBMAND:
case F_SETLK:
case F_SETLKW:
break;
default:
return (EINVAL);
}
return (errno);
return (0);
}
/* ARGSUSED */
int
int cmd,
int flag,
{
/* See fs_frlock */
switch (cmd) {
case F_ALLOCSP:
case F_FREESP:
break;
default:
return (EINVAL);
}
return (errno);
return (0);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
int flags,
{
return (ENOSYS);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
short events,
int anyyet,
short *reventsp,
{
*reventsp = 0;
if (events & POLLRDNORM)
*reventsp |= POLLRDNORM;
if (events & POLLRDBAND)
*reventsp |= POLLRDBAND;
if (events & POLLWRBAND)
*reventsp |= POLLWRBAND;
return (0);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/*
* See fs_pathconf
*/
/* ARGSUSED */
int
int cmd,
{
register int error = 0;
switch (cmd) {
case _PC_LINK_MAX:
break;
case _PC_MAX_CANON:
break;
case _PC_MAX_INPUT:
break;
case _PC_NAME_MAX:
val = MAXNAMELEN;
break;
case _PC_PATH_MAX:
case _PC_SYMLINK_MAX:
val = MAXPATHLEN;
break;
case _PC_PIPE_BUF:
break;
case _PC_NO_TRUNC:
break;
case _PC_VDISABLE:
break;
case _PC_CHOWN_RESTRICTED:
break;
case _PC_FILESIZEBITS:
break;
case _PC_ACL_ENABLED:
val = 0;
break;
case _PC_CASE_BEHAVIOR:
break;
case _PC_SATTR_ENABLED:
case _PC_SATTR_EXISTS:
val = 0;
break;
case _PC_ACCESS_FILTERING:
val = 0;
break;
default:
break;
}
if (error == 0)
return (error);
}
/* ARGSUSED */
int
int flags,
{
return (ENOSYS);
}
/* ARGSUSED */
int
int action,
{
return (ENOSYS);
}
/* ARGSUSED */
void
int flag,
int dn,
{
}
/* ARGSUSED */
int
int flag,
{
return (0);
}
/*
*/
/* ARGSUSED */
int
int flag,
{
vsecattr->vsa_aclcnt = 0;
vsecattr->vsa_aclentsz = 0;
aclentp++;
}
return (0);
}
/* ARGSUSED */
int
int cmd,
int flag,
{
switch (cmd) {
case F_SHARE:
case F_SHARE_NBMAND:
case F_UNSHARE:
break;
default:
return (EINVAL);
}
if (!fop_shrlock_enable)
return (0);
return (errno);
return (0);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/* ARGSUSED */
int
{
return (ENOSYS);
}
/*
* ***************************************************************
* other VOP support
*/
/*
* Convert stat(2) formats to vnode types and vice versa. (Knows about
* numerical order of S_IFMT and vnode types.)
*/
};
};
/*
* stat_to_vattr()
*
* Convert from a stat structure to an vattr structure
* Note: only set fields according to va_mask
*/
int
{
}
}
}
return (0);
}
/* ARGSUSED */
void
{
}
void
{
}
void
{
} else {
}
}
int
{
switch (mode) {
case V_WRITE:
return (V_TRUE);
break;
case V_RDORWR:
return (V_TRUE);
break;
case V_RDANDWR:
return (V_TRUE);
break;
case V_READ:
return (V_TRUE);
break;
}
return (V_FALSE);
}
/*
* 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
*/
/* ARGSUSED */
int
{
return (V_FALSE);
}