/* @(#)src/common/kernel/base/vx_const.h	3.12 07/16/98 14:03:39 -  */
/* #ident "@(#)vxfs:src/common/kernel/base/vx_const.h	3.12" */

/*
 * Copyright (c) 1998 VERITAS Software Corporation.  ALL RIGHTS RESERVED.
 * UNPUBLISHED -- RIGHTS RESERVED UNDER THE COPYRIGHT
 * LAWS OF THE UNITED STATES.  USE OF A COPYRIGHT NOTICE
 * IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
 * OR DISCLOSURE.
 *
 * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND
 * TRADE SECRETS OF VERITAS SOFTWARE.  USE, DISCLOSURE,
 * OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
 * EXPRESS WRITTEN PERMISSION OF VERITAS SOFTWARE.
 *
 * 		RESTRICTED RIGHTS LEGEND
 * USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT IS
 * SUBJECT TO RESTRICTIONS AS SET FORTH IN SUBPARAGRAPH
 * (C) (1) (ii) OF THE RIGHTS IN TECHNICAL DATA AND
 * COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013.
 * 		VERITAS SOFTWARE
 * 1600 PLYMOUTH STREET, MOUNTAIN VIEW, CA 94043
 */

#ifndef	_FS_VXFS_VX_CONST_H
#define	_FS_VXFS_VX_CONST_H

/*
 * Values passed across directory code interfaces.
 */

#define	DR_REMOVE	1		/* rm or unlink */
#define	DR_RMDIR	2		/* rmdir */
#define	DR_RENAME	3		/* rename */

#define	VX_PERM_READ		0x01
#define	VX_PERM_WRITE		0x02
#define	VX_PERM_EXEC		0x04
#define	VX_PERM_CONTROL		0x08
#define	VX_PERM_INSERT		0x10
#define	VX_PERM_DELETE		0x20

#define	VX_PERM_RWX		(VX_PERM_READ | VX_PERM_WRITE | VX_PERM_EXEC)
#define	VX_PERM_USRLIST		(VX_PERM_READ | VX_PERM_WRITE | VX_PERM_CONTROL)

/*
 * Sizes and indexes for arrays within incore bsd quota structures.
 */

#define	VX_USRQUOTA	0	/* user quotas */
#define	VX_GRPQUOTA	1	/* group quotas */
#define	VX_MAXQUOTAS	2	/* currently we support user and group quotas */

/*
 * Values passed across attribute code interfaces.
 */

#define	VX_ALIST	0x4	/* Listing attributes */
#define	VX_AREAD	0x5	/* Reading attributes */

/*
 * The following values are read/write advisories which are used throughout
 * the read/write code paths. They are derived (by vx_read_advise() and
 * vx_write_advise()) from a number of different places:
 *
 *	- The i_advise field of vx_inode
 *	- Mount options (convosync= and mincache=)
 *	- File table flags
 *	- The ioflag passed through read/write vnode ops.
 *
 * See vx_read_advise() / vx_write_advise() for details on how the following
 * values are obtained.
 */

#define	VX_RW_SEQ		0x00000001
#define	VX_RW_RANDOM		0x00000002
#define	VX_RW_NOREUSE		0x00000004
#define	VX_RW_DIRECT		0x00000008
#define	VX_RW_DSYNC		0x00000010
#define	VX_RW_ISYNC		0x00000020
#define	VX_RW_RSYNC		0x00000040
#define	VX_RW_TMPCACHE		0x00000080
#define	VX_RW_DISC_DIRECT	0x00000100

/*
 * A flag used by upgrade to indicate upgrade from Version 2 to
 * Version 2 with quotas.  This is only supported in some ports
 * of vxfs.
 */

#define	VX_VERSION2_QUOTA	0x80000000

#endif /* _FS_VXFS_VX_CONST_H */
