xref: /onnv-gate/usr/src/uts/common/nfs/nfs4_attr.h (revision 11291:80bdcd03e626)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*11291SRobert.Thurlow@Sun.COM  * Common Development and Distribution License (the "License").
6*11291SRobert.Thurlow@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*11291SRobert.Thurlow@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef _NFS4_ATTR_H
270Sstevel@tonic-gate #define	_NFS4_ATTR_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #ifdef	__cplusplus
300Sstevel@tonic-gate extern "C" {
310Sstevel@tonic-gate #endif
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #define	FATTR4_WORD0	32
340Sstevel@tonic-gate #define	FATTR4_WORD1	0
350Sstevel@tonic-gate 
360Sstevel@tonic-gate /*
370Sstevel@tonic-gate  * Attributes
380Sstevel@tonic-gate  */
390Sstevel@tonic-gate #define	FATTR4_SUPPORTED_ATTRS_MASK	(1ULL << (FATTR4_WORD0 + 0))
400Sstevel@tonic-gate #define	FATTR4_TYPE_MASK		(1ULL << (FATTR4_WORD0 + 1))
410Sstevel@tonic-gate #define	FATTR4_FH_EXPIRE_TYPE_MASK	(1ULL << (FATTR4_WORD0 + 2))
420Sstevel@tonic-gate #define	FATTR4_CHANGE_MASK		(1ULL << (FATTR4_WORD0 + 3))
430Sstevel@tonic-gate #define	FATTR4_SIZE_MASK		(1ULL << (FATTR4_WORD0 + 4))
440Sstevel@tonic-gate #define	FATTR4_LINK_SUPPORT_MASK	(1ULL << (FATTR4_WORD0 + 5))
450Sstevel@tonic-gate #define	FATTR4_SYMLINK_SUPPORT_MASK	(1ULL << (FATTR4_WORD0 + 6))
460Sstevel@tonic-gate #define	FATTR4_NAMED_ATTR_MASK		(1ULL << (FATTR4_WORD0 + 7))
470Sstevel@tonic-gate #define	FATTR4_FSID_MASK		(1ULL << (FATTR4_WORD0 + 8))
480Sstevel@tonic-gate #define	FATTR4_UNIQUE_HANDLES_MASK	(1ULL << (FATTR4_WORD0 + 9))
490Sstevel@tonic-gate #define	FATTR4_LEASE_TIME_MASK		(1ULL << (FATTR4_WORD0 + 10))
500Sstevel@tonic-gate #define	FATTR4_RDATTR_ERROR_MASK	(1ULL << (FATTR4_WORD0 + 11))
510Sstevel@tonic-gate #define	FATTR4_ACL_MASK			(1ULL << (FATTR4_WORD0 + 12))
520Sstevel@tonic-gate #define	FATTR4_ACLSUPPORT_MASK		(1ULL << (FATTR4_WORD0 + 13))
530Sstevel@tonic-gate #define	FATTR4_ARCHIVE_MASK		(1ULL << (FATTR4_WORD0 + 14))
540Sstevel@tonic-gate #define	FATTR4_CANSETTIME_MASK		(1ULL << (FATTR4_WORD0 + 15))
550Sstevel@tonic-gate #define	FATTR4_CASE_INSENSITIVE_MASK	(1ULL << (FATTR4_WORD0 + 16))
560Sstevel@tonic-gate #define	FATTR4_CASE_PRESERVING_MASK	(1ULL << (FATTR4_WORD0 + 17))
570Sstevel@tonic-gate #define	FATTR4_CHOWN_RESTRICTED_MASK	(1ULL << (FATTR4_WORD0 + 18))
580Sstevel@tonic-gate #define	FATTR4_FILEHANDLE_MASK		(1ULL << (FATTR4_WORD0 + 19))
590Sstevel@tonic-gate #define	FATTR4_FILEID_MASK		(1ULL << (FATTR4_WORD0 + 20))
600Sstevel@tonic-gate #define	FATTR4_FILES_AVAIL_MASK		(1ULL << (FATTR4_WORD0 + 21))
610Sstevel@tonic-gate #define	FATTR4_FILES_FREE_MASK		(1ULL << (FATTR4_WORD0 + 22))
620Sstevel@tonic-gate #define	FATTR4_FILES_TOTAL_MASK		(1ULL << (FATTR4_WORD0 + 23))
630Sstevel@tonic-gate #define	FATTR4_FS_LOCATIONS_MASK	(1ULL << (FATTR4_WORD0 + 24))
640Sstevel@tonic-gate #define	FATTR4_HIDDEN_MASK		(1ULL << (FATTR4_WORD0 + 25))
650Sstevel@tonic-gate #define	FATTR4_HOMOGENEOUS_MASK		(1ULL << (FATTR4_WORD0 + 26))
660Sstevel@tonic-gate #define	FATTR4_MAXFILESIZE_MASK		(1ULL << (FATTR4_WORD0 + 27))
670Sstevel@tonic-gate #define	FATTR4_MAXLINK_MASK		(1ULL << (FATTR4_WORD0 + 28))
680Sstevel@tonic-gate #define	FATTR4_MAXNAME_MASK		(1ULL << (FATTR4_WORD0 + 29))
690Sstevel@tonic-gate #define	FATTR4_MAXREAD_MASK		(1ULL << (FATTR4_WORD0 + 30))
700Sstevel@tonic-gate #define	FATTR4_MAXWRITE_MASK		(1ULL << (FATTR4_WORD0 + 31))
710Sstevel@tonic-gate 
720Sstevel@tonic-gate #define	FATTR4_MIMETYPE_MASK		(1ULL << (FATTR4_WORD1 + 0))
730Sstevel@tonic-gate #define	FATTR4_MODE_MASK		(1ULL << (FATTR4_WORD1 + 1))
740Sstevel@tonic-gate #define	FATTR4_NO_TRUNC_MASK		(1ULL << (FATTR4_WORD1 + 2))
750Sstevel@tonic-gate #define	FATTR4_NUMLINKS_MASK		(1ULL << (FATTR4_WORD1 + 3))
760Sstevel@tonic-gate #define	FATTR4_OWNER_MASK		(1ULL << (FATTR4_WORD1 + 4))
770Sstevel@tonic-gate #define	FATTR4_OWNER_GROUP_MASK		(1ULL << (FATTR4_WORD1 + 5))
780Sstevel@tonic-gate #define	FATTR4_QUOTA_AVAIL_HARD_MASK	(1ULL << (FATTR4_WORD1 + 6))
790Sstevel@tonic-gate #define	FATTR4_QUOTA_AVAIL_SOFT_MASK	(1ULL << (FATTR4_WORD1 + 7))
800Sstevel@tonic-gate #define	FATTR4_QUOTA_USED_MASK		(1ULL << (FATTR4_WORD1 + 8))
810Sstevel@tonic-gate #define	FATTR4_RAWDEV_MASK		(1ULL << (FATTR4_WORD1 + 9))
820Sstevel@tonic-gate #define	FATTR4_SPACE_AVAIL_MASK		(1ULL << (FATTR4_WORD1 + 10))
830Sstevel@tonic-gate #define	FATTR4_SPACE_FREE_MASK		(1ULL << (FATTR4_WORD1 + 11))
840Sstevel@tonic-gate #define	FATTR4_SPACE_TOTAL_MASK		(1ULL << (FATTR4_WORD1 + 12))
850Sstevel@tonic-gate #define	FATTR4_SPACE_USED_MASK		(1ULL << (FATTR4_WORD1 + 13))
860Sstevel@tonic-gate #define	FATTR4_SYSTEM_MASK		(1ULL << (FATTR4_WORD1 + 14))
870Sstevel@tonic-gate #define	FATTR4_TIME_ACCESS_MASK		(1ULL << (FATTR4_WORD1 + 15))
880Sstevel@tonic-gate #define	FATTR4_TIME_ACCESS_SET_MASK	(1ULL << (FATTR4_WORD1 + 16))
890Sstevel@tonic-gate #define	FATTR4_TIME_BACKUP_MASK		(1ULL << (FATTR4_WORD1 + 17))
900Sstevel@tonic-gate #define	FATTR4_TIME_CREATE_MASK		(1ULL << (FATTR4_WORD1 + 18))
910Sstevel@tonic-gate #define	FATTR4_TIME_DELTA_MASK		(1ULL << (FATTR4_WORD1 + 19))
920Sstevel@tonic-gate #define	FATTR4_TIME_METADATA_MASK	(1ULL << (FATTR4_WORD1 + 20))
930Sstevel@tonic-gate #define	FATTR4_TIME_MODIFY_MASK		(1ULL << (FATTR4_WORD1 + 21))
940Sstevel@tonic-gate #define	FATTR4_TIME_MODIFY_SET_MASK	(1ULL << (FATTR4_WORD1 + 22))
950Sstevel@tonic-gate #define	FATTR4_MOUNTED_ON_FILEID_MASK	(1ULL << (FATTR4_WORD1 + 23))
960Sstevel@tonic-gate 
970Sstevel@tonic-gate /*
980Sstevel@tonic-gate  * Common bitmap4 of file attributes to be gathered
990Sstevel@tonic-gate  */
1000Sstevel@tonic-gate #define	NFS4_NTOV_ATTR_MASK (		\
1010Sstevel@tonic-gate 	FATTR4_TYPE_MASK |		\
1020Sstevel@tonic-gate 	FATTR4_CHANGE_MASK |		\
1030Sstevel@tonic-gate 	FATTR4_SIZE_MASK |		\
1040Sstevel@tonic-gate 	FATTR4_FSID_MASK |		\
1050Sstevel@tonic-gate 	FATTR4_FILEID_MASK |		\
1060Sstevel@tonic-gate 	FATTR4_MODE_MASK |		\
1070Sstevel@tonic-gate 	FATTR4_OWNER_MASK |		\
1080Sstevel@tonic-gate 	FATTR4_OWNER_GROUP_MASK |	\
1090Sstevel@tonic-gate 	FATTR4_NUMLINKS_MASK |		\
1100Sstevel@tonic-gate 	FATTR4_TIME_ACCESS_MASK |	\
1110Sstevel@tonic-gate 	FATTR4_TIME_MODIFY_MASK |	\
1120Sstevel@tonic-gate 	FATTR4_TIME_METADATA_MASK |	\
1130Sstevel@tonic-gate 	FATTR4_RAWDEV_MASK |		\
1140Sstevel@tonic-gate 	FATTR4_SPACE_USED_MASK |	\
1150Sstevel@tonic-gate 	FATTR4_MOUNTED_ON_FILEID_MASK)
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate #define	NFS4_VATTR_MASK (		\
1180Sstevel@tonic-gate 	FATTR4_TYPE_MASK |		\
1190Sstevel@tonic-gate 	FATTR4_CHANGE_MASK |		\
1200Sstevel@tonic-gate 	FATTR4_SIZE_MASK |		\
1210Sstevel@tonic-gate 	FATTR4_FSID_MASK |		\
1220Sstevel@tonic-gate 	FATTR4_FILEID_MASK |		\
1230Sstevel@tonic-gate 	FATTR4_MODE_MASK |		\
1240Sstevel@tonic-gate 	FATTR4_OWNER_MASK |		\
1250Sstevel@tonic-gate 	FATTR4_OWNER_GROUP_MASK |	\
1260Sstevel@tonic-gate 	FATTR4_NUMLINKS_MASK |		\
1270Sstevel@tonic-gate 	FATTR4_TIME_ACCESS_MASK |	\
1280Sstevel@tonic-gate 	FATTR4_TIME_MODIFY_MASK |	\
1290Sstevel@tonic-gate 	FATTR4_TIME_METADATA_MASK |	\
1300Sstevel@tonic-gate 	FATTR4_RAWDEV_MASK |		\
1310Sstevel@tonic-gate 	FATTR4_SPACE_USED_MASK |	\
1320Sstevel@tonic-gate 	FATTR4_MOUNTED_ON_FILEID_MASK)
1330Sstevel@tonic-gate 
1340Sstevel@tonic-gate #define	NFS4_PATHCONF_MASK (		\
1350Sstevel@tonic-gate 	NFS4_VATTR_MASK |		\
1360Sstevel@tonic-gate 	FATTR4_NO_TRUNC_MASK |		\
1370Sstevel@tonic-gate 	FATTR4_CHOWN_RESTRICTED_MASK |	\
1380Sstevel@tonic-gate 	FATTR4_CASE_INSENSITIVE_MASK |	\
1390Sstevel@tonic-gate 	FATTR4_CASE_PRESERVING_MASK |	\
1400Sstevel@tonic-gate 	FATTR4_NAMED_ATTR_MASK |	\
1410Sstevel@tonic-gate 	FATTR4_LINK_SUPPORT_MASK |	\
1420Sstevel@tonic-gate 	FATTR4_SYMLINK_SUPPORT_MASK |	\
1430Sstevel@tonic-gate 	FATTR4_UNIQUE_HANDLES_MASK |	\
1440Sstevel@tonic-gate 	FATTR4_CANSETTIME_MASK |	\
1450Sstevel@tonic-gate 	FATTR4_HOMOGENEOUS_MASK |	\
1460Sstevel@tonic-gate 	FATTR4_MAXLINK_MASK |		\
1470Sstevel@tonic-gate 	FATTR4_MAXNAME_MASK |		\
1480Sstevel@tonic-gate 	FATTR4_MAXFILESIZE_MASK)
1490Sstevel@tonic-gate 
1500Sstevel@tonic-gate /*
1510Sstevel@tonic-gate  * The corresponding AT_MASK
1520Sstevel@tonic-gate  */
1530Sstevel@tonic-gate #define	NFS4_NTOV_ATTR_AT_MASK (	\
1540Sstevel@tonic-gate 	AT_TYPE |			\
1550Sstevel@tonic-gate 	AT_SIZE |			\
1560Sstevel@tonic-gate 	AT_FSID |			\
1570Sstevel@tonic-gate 	AT_NODEID |			\
1580Sstevel@tonic-gate 	AT_MODE |			\
1590Sstevel@tonic-gate 	AT_UID |			\
1600Sstevel@tonic-gate 	AT_GID |			\
1610Sstevel@tonic-gate 	AT_NLINK |			\
1620Sstevel@tonic-gate 	AT_ATIME |			\
1630Sstevel@tonic-gate 	AT_MTIME |			\
1640Sstevel@tonic-gate 	AT_CTIME |			\
1650Sstevel@tonic-gate 	AT_RDEV |			\
1660Sstevel@tonic-gate 	AT_NBLOCKS)
1670Sstevel@tonic-gate 
1680Sstevel@tonic-gate /*
1690Sstevel@tonic-gate  * Common bitmap4 of filesystem attributes to be gathered
1700Sstevel@tonic-gate  */
1710Sstevel@tonic-gate #define	NFS4_FS_ATTR_MASK (		\
1720Sstevel@tonic-gate 	FATTR4_FILES_AVAIL_MASK |	\
1730Sstevel@tonic-gate 	FATTR4_FILES_FREE_MASK |	\
1740Sstevel@tonic-gate 	FATTR4_FILES_TOTAL_MASK |	\
1750Sstevel@tonic-gate 	FATTR4_SPACE_AVAIL_MASK |	\
1760Sstevel@tonic-gate 	FATTR4_SPACE_FREE_MASK |	\
1770Sstevel@tonic-gate 	FATTR4_SPACE_TOTAL_MASK)
1780Sstevel@tonic-gate 
1790Sstevel@tonic-gate #define	NFS4_STATFS_ATTR_MASK (		\
1800Sstevel@tonic-gate 	FATTR4_FILES_AVAIL_MASK |	\
1810Sstevel@tonic-gate 	FATTR4_FILES_FREE_MASK |	\
1820Sstevel@tonic-gate 	FATTR4_FILES_TOTAL_MASK |	\
1830Sstevel@tonic-gate 	FATTR4_SPACE_AVAIL_MASK |	\
1840Sstevel@tonic-gate 	FATTR4_SPACE_FREE_MASK |	\
1850Sstevel@tonic-gate 	FATTR4_SPACE_TOTAL_MASK |	\
1860Sstevel@tonic-gate 	FATTR4_MAXNAME_MASK)
1870Sstevel@tonic-gate 
1880Sstevel@tonic-gate /*
1890Sstevel@tonic-gate  * The corresponding AT_MASK
1900Sstevel@tonic-gate  */
1910Sstevel@tonic-gate #define	NFS4_FS_ATTR_AT_MASK	0
1920Sstevel@tonic-gate 
1930Sstevel@tonic-gate /*
1940Sstevel@tonic-gate  * Common bitmap4 to gather attr cache state
1950Sstevel@tonic-gate  */
1960Sstevel@tonic-gate #define	NFS4_NTOV_ATTR_CACHE_MASK (	\
1970Sstevel@tonic-gate 	FATTR4_TIME_METADATA_MASK |	\
1980Sstevel@tonic-gate 	FATTR4_TIME_MODIFY_MASK |	\
1990Sstevel@tonic-gate 	FATTR4_SIZE_MASK)
2000Sstevel@tonic-gate 
2010Sstevel@tonic-gate /*
2020Sstevel@tonic-gate  * The corresponding AT_MASK
2030Sstevel@tonic-gate  */
2040Sstevel@tonic-gate #define	NFS4_NTOV_ATTR_CACHE_AT_MASK (	\
2050Sstevel@tonic-gate 	AT_CTIME |			\
2060Sstevel@tonic-gate 	AT_MTIME |			\
2070Sstevel@tonic-gate 	AT_SIZE)
2080Sstevel@tonic-gate 
2090Sstevel@tonic-gate #define	NFS4_VTON_ATTR_MASK (		\
2100Sstevel@tonic-gate 	AT_TYPE |			\
2110Sstevel@tonic-gate 	AT_MODE |			\
2120Sstevel@tonic-gate 	AT_UID |			\
2130Sstevel@tonic-gate 	AT_GID |			\
2140Sstevel@tonic-gate 	AT_NODEID |			\
2150Sstevel@tonic-gate 	AT_SIZE |			\
2160Sstevel@tonic-gate 	AT_NLINK |			\
2170Sstevel@tonic-gate 	AT_ATIME |			\
2180Sstevel@tonic-gate 	AT_MTIME |			\
2190Sstevel@tonic-gate 	AT_CTIME |			\
2200Sstevel@tonic-gate 	AT_RDEV |			\
2210Sstevel@tonic-gate 	AT_NBLOCKS |			\
2220Sstevel@tonic-gate 	AT_FSID)
2230Sstevel@tonic-gate 
2240Sstevel@tonic-gate #define	NFS4_VTON_ATTR_MASK_SET (	\
2250Sstevel@tonic-gate 	AT_MODE |			\
2260Sstevel@tonic-gate 	AT_UID |			\
2270Sstevel@tonic-gate 	AT_GID |			\
2280Sstevel@tonic-gate 	AT_SIZE |			\
2290Sstevel@tonic-gate 	AT_ATIME |			\
2300Sstevel@tonic-gate 	AT_MTIME)
2310Sstevel@tonic-gate 
2320Sstevel@tonic-gate /* solaris-supported, non-vattr_t per-vnode scoped attrs */
2330Sstevel@tonic-gate #define	NFS4_VP_ATTR_MASK (		\
2340Sstevel@tonic-gate 	FATTR4_CHANGE_MASK |		\
2350Sstevel@tonic-gate 	FATTR4_CHOWN_RESTRICTED_MASK |	\
2360Sstevel@tonic-gate 	FATTR4_FILEHANDLE_MASK |	\
2370Sstevel@tonic-gate 	FATTR4_MAXFILESIZE_MASK |	\
2380Sstevel@tonic-gate 	FATTR4_MAXLINK_MASK |		\
2390Sstevel@tonic-gate 	FATTR4_MAXNAME_MASK |		\
2400Sstevel@tonic-gate 	FATTR4_MOUNTED_ON_FILEID_MASK)
2410Sstevel@tonic-gate 
2420Sstevel@tonic-gate #define	FATTR4_FSINFO_MASK (		\
2430Sstevel@tonic-gate 	FATTR4_SUPPORTED_ATTRS_MASK |	\
2440Sstevel@tonic-gate 	FATTR4_TYPE_MASK |		\
2450Sstevel@tonic-gate 	FATTR4_FH_EXPIRE_TYPE_MASK |	\
2460Sstevel@tonic-gate 	FATTR4_LINK_SUPPORT_MASK |	\
2470Sstevel@tonic-gate 	FATTR4_SYMLINK_SUPPORT_MASK |	\
2480Sstevel@tonic-gate 	FATTR4_FSID_MASK |		\
2490Sstevel@tonic-gate 	FATTR4_MAXFILESIZE_MASK |	\
2500Sstevel@tonic-gate 	FATTR4_MAXREAD_MASK |		\
2510Sstevel@tonic-gate 	FATTR4_MAXWRITE_MASK)
2520Sstevel@tonic-gate 
2530Sstevel@tonic-gate /*
2540Sstevel@tonic-gate  * These are the support attributes for the NFSv4 server
2550Sstevel@tonic-gate  */
2560Sstevel@tonic-gate #define	NFS4_SRV_RDDIR_SUPPORTED_ATTRS (	\
2570Sstevel@tonic-gate 	FATTR4_SUPPORTED_ATTRS_MASK |	\
2580Sstevel@tonic-gate 	FATTR4_TYPE_MASK |		\
2590Sstevel@tonic-gate 	FATTR4_FH_EXPIRE_TYPE_MASK |	\
2600Sstevel@tonic-gate 	FATTR4_CHANGE_MASK |		\
2610Sstevel@tonic-gate 	FATTR4_SIZE_MASK |		\
2620Sstevel@tonic-gate 	FATTR4_LINK_SUPPORT_MASK |	\
2630Sstevel@tonic-gate 	FATTR4_SYMLINK_SUPPORT_MASK |	\
2640Sstevel@tonic-gate 	FATTR4_NAMED_ATTR_MASK |	\
2650Sstevel@tonic-gate 	FATTR4_FSID_MASK |		\
2660Sstevel@tonic-gate 	FATTR4_UNIQUE_HANDLES_MASK |	\
2670Sstevel@tonic-gate 	FATTR4_LEASE_TIME_MASK |	\
2680Sstevel@tonic-gate 	FATTR4_RDATTR_ERROR_MASK |	\
2690Sstevel@tonic-gate 	FATTR4_CANSETTIME_MASK |	\
2700Sstevel@tonic-gate 	FATTR4_CASE_INSENSITIVE_MASK |	\
2710Sstevel@tonic-gate 	FATTR4_CASE_PRESERVING_MASK |	\
2720Sstevel@tonic-gate 	FATTR4_CHOWN_RESTRICTED_MASK |	\
2730Sstevel@tonic-gate 	FATTR4_FILEHANDLE_MASK |	\
2740Sstevel@tonic-gate 	FATTR4_FILEID_MASK |		\
2750Sstevel@tonic-gate 	FATTR4_FILES_AVAIL_MASK |	\
2760Sstevel@tonic-gate 	FATTR4_FILES_FREE_MASK |	\
2770Sstevel@tonic-gate 	FATTR4_FILES_TOTAL_MASK |	\
2780Sstevel@tonic-gate 	FATTR4_HOMOGENEOUS_MASK |	\
2790Sstevel@tonic-gate 	FATTR4_MAXFILESIZE_MASK |	\
2800Sstevel@tonic-gate 	FATTR4_MAXLINK_MASK |		\
2810Sstevel@tonic-gate 	FATTR4_MAXNAME_MASK |		\
2820Sstevel@tonic-gate 	FATTR4_MAXREAD_MASK |		\
2830Sstevel@tonic-gate 	FATTR4_MAXWRITE_MASK |		\
2840Sstevel@tonic-gate 	FATTR4_MODE_MASK |		\
2850Sstevel@tonic-gate 	FATTR4_NO_TRUNC_MASK |		\
2860Sstevel@tonic-gate 	FATTR4_NUMLINKS_MASK |		\
2870Sstevel@tonic-gate 	FATTR4_OWNER_MASK |		\
2880Sstevel@tonic-gate 	FATTR4_OWNER_GROUP_MASK |	\
2890Sstevel@tonic-gate 	FATTR4_RAWDEV_MASK |		\
2900Sstevel@tonic-gate 	FATTR4_SPACE_AVAIL_MASK |	\
2910Sstevel@tonic-gate 	FATTR4_SPACE_FREE_MASK |	\
2920Sstevel@tonic-gate 	FATTR4_SPACE_TOTAL_MASK |	\
2930Sstevel@tonic-gate 	FATTR4_SPACE_USED_MASK |	\
2940Sstevel@tonic-gate 	FATTR4_TIME_ACCESS_MASK |	\
2950Sstevel@tonic-gate 	FATTR4_TIME_DELTA_MASK |	\
2960Sstevel@tonic-gate 	FATTR4_TIME_METADATA_MASK |	\
2970Sstevel@tonic-gate 	FATTR4_TIME_MODIFY_MASK |	\
2980Sstevel@tonic-gate 	FATTR4_MOUNTED_ON_FILEID_MASK	\
2990Sstevel@tonic-gate )
3000Sstevel@tonic-gate 
3010Sstevel@tonic-gate 
3020Sstevel@tonic-gate #define	FATTR4_FSID_EQ(a, b)	\
3030Sstevel@tonic-gate 	((a)->major == (b)->major && (a)->minor == (b)->minor)
3040Sstevel@tonic-gate 
3050Sstevel@tonic-gate #define	NFS4_MAXNUM_BITWORDS	2
3060Sstevel@tonic-gate #define	NFS4_MAXNUM_ATTRS	56
3070Sstevel@tonic-gate 
3080Sstevel@tonic-gate union nfs4_attr_u {
3090Sstevel@tonic-gate 	fattr4_supported_attrs		supported_attrs;
3100Sstevel@tonic-gate 	fattr4_type			type;
3110Sstevel@tonic-gate 	fattr4_fh_expire_type		fh_expire_type;
3120Sstevel@tonic-gate 	fattr4_change			change;
3130Sstevel@tonic-gate 	fattr4_size			size;
3140Sstevel@tonic-gate 	fattr4_link_support		link_support;
3150Sstevel@tonic-gate 	fattr4_symlink_support		symlink_support;
3160Sstevel@tonic-gate 	fattr4_named_attr		named_attr;
3170Sstevel@tonic-gate 	fattr4_fsid			fsid;
3180Sstevel@tonic-gate 	fattr4_unique_handles		unique_handles;
3190Sstevel@tonic-gate 	fattr4_lease_time		lease_time;
3200Sstevel@tonic-gate 	fattr4_rdattr_error		rdattr_error;
3210Sstevel@tonic-gate 	fattr4_acl			acl;
3220Sstevel@tonic-gate 	fattr4_aclsupport		aclsupport;
3230Sstevel@tonic-gate 	fattr4_archive			archive;
3240Sstevel@tonic-gate 	fattr4_cansettime		cansettime;
3250Sstevel@tonic-gate 	fattr4_case_insensitive		case_insensitive;
3260Sstevel@tonic-gate 	fattr4_case_preserving		case_preserving;
3270Sstevel@tonic-gate 	fattr4_chown_restricted		chown_restricted;
3280Sstevel@tonic-gate 	fattr4_fileid			fileid;
3290Sstevel@tonic-gate 	fattr4_files_avail		files_avail;
3300Sstevel@tonic-gate 	fattr4_filehandle		filehandle;
3310Sstevel@tonic-gate 	fattr4_files_free		files_free;
3320Sstevel@tonic-gate 	fattr4_files_total		files_total;
3330Sstevel@tonic-gate 	fattr4_fs_locations		fs_locations;
3340Sstevel@tonic-gate 	fattr4_hidden			hidden;
3350Sstevel@tonic-gate 	fattr4_homogeneous		homogeneous;
3360Sstevel@tonic-gate 	fattr4_maxfilesize		maxfilesize;
3370Sstevel@tonic-gate 	fattr4_maxlink			maxlink;
3380Sstevel@tonic-gate 	fattr4_maxname			maxname;
3390Sstevel@tonic-gate 	fattr4_maxread			maxread;
3400Sstevel@tonic-gate 	fattr4_maxwrite			maxwrite;
3410Sstevel@tonic-gate 	fattr4_mimetype			mimetype;
3420Sstevel@tonic-gate 	fattr4_mode			mode;
3430Sstevel@tonic-gate 	fattr4_no_trunc			no_trunc;
3440Sstevel@tonic-gate 	fattr4_numlinks			numlinks;
3450Sstevel@tonic-gate 	fattr4_owner			owner;
3460Sstevel@tonic-gate 	fattr4_owner_group		owner_group;
3470Sstevel@tonic-gate 	fattr4_quota_avail_hard		quota_avail_hard;
3480Sstevel@tonic-gate 	fattr4_quota_avail_soft		quota_avail_soft;
3490Sstevel@tonic-gate 	fattr4_quota_used		quota_used;
3500Sstevel@tonic-gate 	fattr4_rawdev			rawdev;
3510Sstevel@tonic-gate 	fattr4_space_avail		space_avail;
3520Sstevel@tonic-gate 	fattr4_space_free		space_free;
3530Sstevel@tonic-gate 	fattr4_space_total		space_total;
3540Sstevel@tonic-gate 	fattr4_space_used		space_used;
3550Sstevel@tonic-gate 	fattr4_system			system;
3560Sstevel@tonic-gate 	fattr4_time_access		time_access;
3570Sstevel@tonic-gate 	fattr4_time_access_set		time_access_set;
3580Sstevel@tonic-gate 	fattr4_time_backup		time_backup;
3590Sstevel@tonic-gate 	fattr4_time_create		time_create;
3600Sstevel@tonic-gate 	fattr4_time_delta		time_delta;
3610Sstevel@tonic-gate 	fattr4_time_metadata		time_metadata;
3620Sstevel@tonic-gate 	fattr4_time_modify		time_modify;
3630Sstevel@tonic-gate 	fattr4_time_modify_set		time_modify_set;
3640Sstevel@tonic-gate 	fattr4_mounted_on_fileid	mounted_on_fileid;
3650Sstevel@tonic-gate };
3660Sstevel@tonic-gate 
3670Sstevel@tonic-gate /*
3680Sstevel@tonic-gate  * Error details when processing the getattr response.
3690Sstevel@tonic-gate  */
3700Sstevel@tonic-gate #define	NFS4_GETATTR_OP_OK		0
3710Sstevel@tonic-gate #define	NFS4_GETATTR_STATUS_ERR		1
3720Sstevel@tonic-gate #define	NFS4_GETATTR_MANDATTR_ERR	2
3730Sstevel@tonic-gate #define	NFS4_GETATTR_BITMAP_ERR		3
3740Sstevel@tonic-gate #define	NFS4_GETATTR_ATSIZE_ERR		4
3750Sstevel@tonic-gate #define	NFS4_GETATTR_ATUID_ERR		5
3760Sstevel@tonic-gate #define	NFS4_GETATTR_ATGID_ERR		6
3770Sstevel@tonic-gate #define	NFS4_GETATTR_ATATIME_ERR	7
3780Sstevel@tonic-gate #define	NFS4_GETATTR_ATMTIME_ERR	8
3790Sstevel@tonic-gate #define	NFS4_GETATTR_ATCTIME_ERR	9
3800Sstevel@tonic-gate #define	NFS4_GETATTR_RAWDEV_ERR		10
3810Sstevel@tonic-gate #define	NFS4_GETATTR_ATNBLOCK_ERR	11
3820Sstevel@tonic-gate #define	NFS4_GETATTR_MAXFILESIZE_ERR	12
3830Sstevel@tonic-gate #define	NFS4_GETATTR_FHANDLE_ERR	13
3840Sstevel@tonic-gate #define	NFS4_GETATTR_MAXREAD_ERR	14
3850Sstevel@tonic-gate #define	NFS4_GETATTR_MAXWRITE_ERR	15
3860Sstevel@tonic-gate #define	NFS4_GETATTR_NOCACHE_OK		16
3870Sstevel@tonic-gate 
3880Sstevel@tonic-gate typedef struct nfs4_pathconf_info {
3890Sstevel@tonic-gate 	unsigned pc4_cache_valid:1;	/* When in rnode4, is data valid? */
3900Sstevel@tonic-gate 	unsigned pc4_no_trunc:1;
3910Sstevel@tonic-gate 	unsigned pc4_chown_restricted:1;
3920Sstevel@tonic-gate 	unsigned pc4_case_insensitive:1;
3930Sstevel@tonic-gate 	unsigned pc4_case_preserving:1;
3940Sstevel@tonic-gate 	unsigned pc4_xattr_valid:1;
3950Sstevel@tonic-gate 	unsigned pc4_xattr_exists:1;
3960Sstevel@tonic-gate 	unsigned pc4_link_support:1;
3970Sstevel@tonic-gate 	unsigned pc4_symlink_support:1;
3980Sstevel@tonic-gate 	unsigned pc4_unique_handles:1;
3990Sstevel@tonic-gate 	unsigned pc4_cansettime:1;
4000Sstevel@tonic-gate 	unsigned pc4_homogeneous:1;
4010Sstevel@tonic-gate 	uint_t	pc4_link_max;
4020Sstevel@tonic-gate 	uint_t	pc4_name_max;
4030Sstevel@tonic-gate 	uint_t	pc4_filesizebits;
4040Sstevel@tonic-gate } nfs4_pathconf_info_t;
4050Sstevel@tonic-gate 
4060Sstevel@tonic-gate /*
4070Sstevel@tonic-gate  * Used for client only to process incoming getattr results.
4080Sstevel@tonic-gate  */
4090Sstevel@tonic-gate typedef struct nfs4_ga_ext_res {
4100Sstevel@tonic-gate 	bitmap4				n4g_suppattrs;
4110Sstevel@tonic-gate 	nfsstat4			n4g_rdattr_error;
4120Sstevel@tonic-gate 	fattr4_fh_expire_type		n4g_fet;
4130Sstevel@tonic-gate 	fattr4_lease_time		n4g_leasetime;
4140Sstevel@tonic-gate 	uint64_t			n4g_maxfilesize;
4150Sstevel@tonic-gate 	uint64_t			n4g_maxread;
4160Sstevel@tonic-gate 	uint64_t			n4g_maxwrite;
4170Sstevel@tonic-gate 	nfstime4			n4g_delta;
4180Sstevel@tonic-gate 	nfs4_pathconf_info_t		n4g_pc4;
4190Sstevel@tonic-gate 	struct statvfs64		n4g_sb;
4200Sstevel@tonic-gate 	union {
4210Sstevel@tonic-gate 		nfs_fh4 n4g_fh;
4220Sstevel@tonic-gate 		struct {
4230Sstevel@tonic-gate 			uint_t len;
4240Sstevel@tonic-gate 			char *val;
4250Sstevel@tonic-gate 			char data[NFS4_FHSIZE];
4260Sstevel@tonic-gate 		} nfs_fh4_alt;
4270Sstevel@tonic-gate 	} n4g_fh_u;
4280Sstevel@tonic-gate 	/*
4290Sstevel@tonic-gate 	 * Bitmask with valid fields being:
4300Sstevel@tonic-gate 	 * ACL4_SUPPORT_ALLOW_ACL
4310Sstevel@tonic-gate 	 * ACL4_SUPPORT_DENY_ACL
4320Sstevel@tonic-gate 	 * ACL4_SUPPORT_AUDIT_ACL
4330Sstevel@tonic-gate 	 * ACL4_SUPPORT_ALARM_ACL
4340Sstevel@tonic-gate 	 */
4350Sstevel@tonic-gate 	fattr4_aclsupport		n4g_aclsupport;
436*11291SRobert.Thurlow@Sun.COM 	fattr4_fs_locations		n4g_fslocations;
4370Sstevel@tonic-gate } nfs4_ga_ext_res_t;
4380Sstevel@tonic-gate 
4390Sstevel@tonic-gate extern bitmap4 rfs4_supported_attrs;
4400Sstevel@tonic-gate 
4410Sstevel@tonic-gate #ifdef	__cplusplus
4420Sstevel@tonic-gate }
4430Sstevel@tonic-gate #endif
4440Sstevel@tonic-gate 
4450Sstevel@tonic-gate #endif /* _NFS4_ATTR_H */
446