1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*0Sstevel@tonic-gate * Use is subject to license terms. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef _NFS4_ATTR_H 28*0Sstevel@tonic-gate #define _NFS4_ATTR_H 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate #ifdef __cplusplus 33*0Sstevel@tonic-gate extern "C" { 34*0Sstevel@tonic-gate #endif 35*0Sstevel@tonic-gate 36*0Sstevel@tonic-gate #define FATTR4_WORD0 32 37*0Sstevel@tonic-gate #define FATTR4_WORD1 0 38*0Sstevel@tonic-gate 39*0Sstevel@tonic-gate /* 40*0Sstevel@tonic-gate * Attributes 41*0Sstevel@tonic-gate */ 42*0Sstevel@tonic-gate #define FATTR4_SUPPORTED_ATTRS_MASK (1ULL << (FATTR4_WORD0 + 0)) 43*0Sstevel@tonic-gate #define FATTR4_TYPE_MASK (1ULL << (FATTR4_WORD0 + 1)) 44*0Sstevel@tonic-gate #define FATTR4_FH_EXPIRE_TYPE_MASK (1ULL << (FATTR4_WORD0 + 2)) 45*0Sstevel@tonic-gate #define FATTR4_CHANGE_MASK (1ULL << (FATTR4_WORD0 + 3)) 46*0Sstevel@tonic-gate #define FATTR4_SIZE_MASK (1ULL << (FATTR4_WORD0 + 4)) 47*0Sstevel@tonic-gate #define FATTR4_LINK_SUPPORT_MASK (1ULL << (FATTR4_WORD0 + 5)) 48*0Sstevel@tonic-gate #define FATTR4_SYMLINK_SUPPORT_MASK (1ULL << (FATTR4_WORD0 + 6)) 49*0Sstevel@tonic-gate #define FATTR4_NAMED_ATTR_MASK (1ULL << (FATTR4_WORD0 + 7)) 50*0Sstevel@tonic-gate #define FATTR4_FSID_MASK (1ULL << (FATTR4_WORD0 + 8)) 51*0Sstevel@tonic-gate #define FATTR4_UNIQUE_HANDLES_MASK (1ULL << (FATTR4_WORD0 + 9)) 52*0Sstevel@tonic-gate #define FATTR4_LEASE_TIME_MASK (1ULL << (FATTR4_WORD0 + 10)) 53*0Sstevel@tonic-gate #define FATTR4_RDATTR_ERROR_MASK (1ULL << (FATTR4_WORD0 + 11)) 54*0Sstevel@tonic-gate #define FATTR4_ACL_MASK (1ULL << (FATTR4_WORD0 + 12)) 55*0Sstevel@tonic-gate #define FATTR4_ACLSUPPORT_MASK (1ULL << (FATTR4_WORD0 + 13)) 56*0Sstevel@tonic-gate #define FATTR4_ARCHIVE_MASK (1ULL << (FATTR4_WORD0 + 14)) 57*0Sstevel@tonic-gate #define FATTR4_CANSETTIME_MASK (1ULL << (FATTR4_WORD0 + 15)) 58*0Sstevel@tonic-gate #define FATTR4_CASE_INSENSITIVE_MASK (1ULL << (FATTR4_WORD0 + 16)) 59*0Sstevel@tonic-gate #define FATTR4_CASE_PRESERVING_MASK (1ULL << (FATTR4_WORD0 + 17)) 60*0Sstevel@tonic-gate #define FATTR4_CHOWN_RESTRICTED_MASK (1ULL << (FATTR4_WORD0 + 18)) 61*0Sstevel@tonic-gate #define FATTR4_FILEHANDLE_MASK (1ULL << (FATTR4_WORD0 + 19)) 62*0Sstevel@tonic-gate #define FATTR4_FILEID_MASK (1ULL << (FATTR4_WORD0 + 20)) 63*0Sstevel@tonic-gate #define FATTR4_FILES_AVAIL_MASK (1ULL << (FATTR4_WORD0 + 21)) 64*0Sstevel@tonic-gate #define FATTR4_FILES_FREE_MASK (1ULL << (FATTR4_WORD0 + 22)) 65*0Sstevel@tonic-gate #define FATTR4_FILES_TOTAL_MASK (1ULL << (FATTR4_WORD0 + 23)) 66*0Sstevel@tonic-gate #define FATTR4_FS_LOCATIONS_MASK (1ULL << (FATTR4_WORD0 + 24)) 67*0Sstevel@tonic-gate #define FATTR4_HIDDEN_MASK (1ULL << (FATTR4_WORD0 + 25)) 68*0Sstevel@tonic-gate #define FATTR4_HOMOGENEOUS_MASK (1ULL << (FATTR4_WORD0 + 26)) 69*0Sstevel@tonic-gate #define FATTR4_MAXFILESIZE_MASK (1ULL << (FATTR4_WORD0 + 27)) 70*0Sstevel@tonic-gate #define FATTR4_MAXLINK_MASK (1ULL << (FATTR4_WORD0 + 28)) 71*0Sstevel@tonic-gate #define FATTR4_MAXNAME_MASK (1ULL << (FATTR4_WORD0 + 29)) 72*0Sstevel@tonic-gate #define FATTR4_MAXREAD_MASK (1ULL << (FATTR4_WORD0 + 30)) 73*0Sstevel@tonic-gate #define FATTR4_MAXWRITE_MASK (1ULL << (FATTR4_WORD0 + 31)) 74*0Sstevel@tonic-gate 75*0Sstevel@tonic-gate #define FATTR4_MIMETYPE_MASK (1ULL << (FATTR4_WORD1 + 0)) 76*0Sstevel@tonic-gate #define FATTR4_MODE_MASK (1ULL << (FATTR4_WORD1 + 1)) 77*0Sstevel@tonic-gate #define FATTR4_NO_TRUNC_MASK (1ULL << (FATTR4_WORD1 + 2)) 78*0Sstevel@tonic-gate #define FATTR4_NUMLINKS_MASK (1ULL << (FATTR4_WORD1 + 3)) 79*0Sstevel@tonic-gate #define FATTR4_OWNER_MASK (1ULL << (FATTR4_WORD1 + 4)) 80*0Sstevel@tonic-gate #define FATTR4_OWNER_GROUP_MASK (1ULL << (FATTR4_WORD1 + 5)) 81*0Sstevel@tonic-gate #define FATTR4_QUOTA_AVAIL_HARD_MASK (1ULL << (FATTR4_WORD1 + 6)) 82*0Sstevel@tonic-gate #define FATTR4_QUOTA_AVAIL_SOFT_MASK (1ULL << (FATTR4_WORD1 + 7)) 83*0Sstevel@tonic-gate #define FATTR4_QUOTA_USED_MASK (1ULL << (FATTR4_WORD1 + 8)) 84*0Sstevel@tonic-gate #define FATTR4_RAWDEV_MASK (1ULL << (FATTR4_WORD1 + 9)) 85*0Sstevel@tonic-gate #define FATTR4_SPACE_AVAIL_MASK (1ULL << (FATTR4_WORD1 + 10)) 86*0Sstevel@tonic-gate #define FATTR4_SPACE_FREE_MASK (1ULL << (FATTR4_WORD1 + 11)) 87*0Sstevel@tonic-gate #define FATTR4_SPACE_TOTAL_MASK (1ULL << (FATTR4_WORD1 + 12)) 88*0Sstevel@tonic-gate #define FATTR4_SPACE_USED_MASK (1ULL << (FATTR4_WORD1 + 13)) 89*0Sstevel@tonic-gate #define FATTR4_SYSTEM_MASK (1ULL << (FATTR4_WORD1 + 14)) 90*0Sstevel@tonic-gate #define FATTR4_TIME_ACCESS_MASK (1ULL << (FATTR4_WORD1 + 15)) 91*0Sstevel@tonic-gate #define FATTR4_TIME_ACCESS_SET_MASK (1ULL << (FATTR4_WORD1 + 16)) 92*0Sstevel@tonic-gate #define FATTR4_TIME_BACKUP_MASK (1ULL << (FATTR4_WORD1 + 17)) 93*0Sstevel@tonic-gate #define FATTR4_TIME_CREATE_MASK (1ULL << (FATTR4_WORD1 + 18)) 94*0Sstevel@tonic-gate #define FATTR4_TIME_DELTA_MASK (1ULL << (FATTR4_WORD1 + 19)) 95*0Sstevel@tonic-gate #define FATTR4_TIME_METADATA_MASK (1ULL << (FATTR4_WORD1 + 20)) 96*0Sstevel@tonic-gate #define FATTR4_TIME_MODIFY_MASK (1ULL << (FATTR4_WORD1 + 21)) 97*0Sstevel@tonic-gate #define FATTR4_TIME_MODIFY_SET_MASK (1ULL << (FATTR4_WORD1 + 22)) 98*0Sstevel@tonic-gate #define FATTR4_MOUNTED_ON_FILEID_MASK (1ULL << (FATTR4_WORD1 + 23)) 99*0Sstevel@tonic-gate 100*0Sstevel@tonic-gate /* 101*0Sstevel@tonic-gate * Common bitmap4 of file attributes to be gathered 102*0Sstevel@tonic-gate */ 103*0Sstevel@tonic-gate #define NFS4_NTOV_ATTR_MASK ( \ 104*0Sstevel@tonic-gate FATTR4_TYPE_MASK | \ 105*0Sstevel@tonic-gate FATTR4_CHANGE_MASK | \ 106*0Sstevel@tonic-gate FATTR4_SIZE_MASK | \ 107*0Sstevel@tonic-gate FATTR4_FSID_MASK | \ 108*0Sstevel@tonic-gate FATTR4_FILEID_MASK | \ 109*0Sstevel@tonic-gate FATTR4_MODE_MASK | \ 110*0Sstevel@tonic-gate FATTR4_OWNER_MASK | \ 111*0Sstevel@tonic-gate FATTR4_OWNER_GROUP_MASK | \ 112*0Sstevel@tonic-gate FATTR4_NUMLINKS_MASK | \ 113*0Sstevel@tonic-gate FATTR4_TIME_ACCESS_MASK | \ 114*0Sstevel@tonic-gate FATTR4_TIME_MODIFY_MASK | \ 115*0Sstevel@tonic-gate FATTR4_TIME_METADATA_MASK | \ 116*0Sstevel@tonic-gate FATTR4_RAWDEV_MASK | \ 117*0Sstevel@tonic-gate FATTR4_SPACE_USED_MASK | \ 118*0Sstevel@tonic-gate FATTR4_MOUNTED_ON_FILEID_MASK) 119*0Sstevel@tonic-gate 120*0Sstevel@tonic-gate #define NFS4_VATTR_MASK ( \ 121*0Sstevel@tonic-gate FATTR4_TYPE_MASK | \ 122*0Sstevel@tonic-gate FATTR4_CHANGE_MASK | \ 123*0Sstevel@tonic-gate FATTR4_SIZE_MASK | \ 124*0Sstevel@tonic-gate FATTR4_FSID_MASK | \ 125*0Sstevel@tonic-gate FATTR4_FILEID_MASK | \ 126*0Sstevel@tonic-gate FATTR4_MODE_MASK | \ 127*0Sstevel@tonic-gate FATTR4_OWNER_MASK | \ 128*0Sstevel@tonic-gate FATTR4_OWNER_GROUP_MASK | \ 129*0Sstevel@tonic-gate FATTR4_NUMLINKS_MASK | \ 130*0Sstevel@tonic-gate FATTR4_TIME_ACCESS_MASK | \ 131*0Sstevel@tonic-gate FATTR4_TIME_MODIFY_MASK | \ 132*0Sstevel@tonic-gate FATTR4_TIME_METADATA_MASK | \ 133*0Sstevel@tonic-gate FATTR4_RAWDEV_MASK | \ 134*0Sstevel@tonic-gate FATTR4_SPACE_USED_MASK | \ 135*0Sstevel@tonic-gate FATTR4_MOUNTED_ON_FILEID_MASK) 136*0Sstevel@tonic-gate 137*0Sstevel@tonic-gate #define NFS4_PATHCONF_MASK ( \ 138*0Sstevel@tonic-gate NFS4_VATTR_MASK | \ 139*0Sstevel@tonic-gate FATTR4_NO_TRUNC_MASK | \ 140*0Sstevel@tonic-gate FATTR4_CHOWN_RESTRICTED_MASK | \ 141*0Sstevel@tonic-gate FATTR4_CASE_INSENSITIVE_MASK | \ 142*0Sstevel@tonic-gate FATTR4_CASE_PRESERVING_MASK | \ 143*0Sstevel@tonic-gate FATTR4_NAMED_ATTR_MASK | \ 144*0Sstevel@tonic-gate FATTR4_LINK_SUPPORT_MASK | \ 145*0Sstevel@tonic-gate FATTR4_SYMLINK_SUPPORT_MASK | \ 146*0Sstevel@tonic-gate FATTR4_UNIQUE_HANDLES_MASK | \ 147*0Sstevel@tonic-gate FATTR4_CANSETTIME_MASK | \ 148*0Sstevel@tonic-gate FATTR4_HOMOGENEOUS_MASK | \ 149*0Sstevel@tonic-gate FATTR4_MAXLINK_MASK | \ 150*0Sstevel@tonic-gate FATTR4_MAXNAME_MASK | \ 151*0Sstevel@tonic-gate FATTR4_MAXFILESIZE_MASK) 152*0Sstevel@tonic-gate 153*0Sstevel@tonic-gate /* 154*0Sstevel@tonic-gate * The corresponding AT_MASK 155*0Sstevel@tonic-gate */ 156*0Sstevel@tonic-gate #define NFS4_NTOV_ATTR_AT_MASK ( \ 157*0Sstevel@tonic-gate AT_TYPE | \ 158*0Sstevel@tonic-gate AT_SIZE | \ 159*0Sstevel@tonic-gate AT_FSID | \ 160*0Sstevel@tonic-gate AT_NODEID | \ 161*0Sstevel@tonic-gate AT_MODE | \ 162*0Sstevel@tonic-gate AT_UID | \ 163*0Sstevel@tonic-gate AT_GID | \ 164*0Sstevel@tonic-gate AT_NLINK | \ 165*0Sstevel@tonic-gate AT_ATIME | \ 166*0Sstevel@tonic-gate AT_MTIME | \ 167*0Sstevel@tonic-gate AT_CTIME | \ 168*0Sstevel@tonic-gate AT_RDEV | \ 169*0Sstevel@tonic-gate AT_NBLOCKS) 170*0Sstevel@tonic-gate 171*0Sstevel@tonic-gate /* 172*0Sstevel@tonic-gate * Common bitmap4 of filesystem attributes to be gathered 173*0Sstevel@tonic-gate */ 174*0Sstevel@tonic-gate #define NFS4_FS_ATTR_MASK ( \ 175*0Sstevel@tonic-gate FATTR4_FILES_AVAIL_MASK | \ 176*0Sstevel@tonic-gate FATTR4_FILES_FREE_MASK | \ 177*0Sstevel@tonic-gate FATTR4_FILES_TOTAL_MASK | \ 178*0Sstevel@tonic-gate FATTR4_SPACE_AVAIL_MASK | \ 179*0Sstevel@tonic-gate FATTR4_SPACE_FREE_MASK | \ 180*0Sstevel@tonic-gate FATTR4_SPACE_TOTAL_MASK) 181*0Sstevel@tonic-gate 182*0Sstevel@tonic-gate #define NFS4_STATFS_ATTR_MASK ( \ 183*0Sstevel@tonic-gate FATTR4_FILES_AVAIL_MASK | \ 184*0Sstevel@tonic-gate FATTR4_FILES_FREE_MASK | \ 185*0Sstevel@tonic-gate FATTR4_FILES_TOTAL_MASK | \ 186*0Sstevel@tonic-gate FATTR4_SPACE_AVAIL_MASK | \ 187*0Sstevel@tonic-gate FATTR4_SPACE_FREE_MASK | \ 188*0Sstevel@tonic-gate FATTR4_SPACE_TOTAL_MASK | \ 189*0Sstevel@tonic-gate FATTR4_MAXNAME_MASK) 190*0Sstevel@tonic-gate 191*0Sstevel@tonic-gate /* 192*0Sstevel@tonic-gate * The corresponding AT_MASK 193*0Sstevel@tonic-gate */ 194*0Sstevel@tonic-gate #define NFS4_FS_ATTR_AT_MASK 0 195*0Sstevel@tonic-gate 196*0Sstevel@tonic-gate /* 197*0Sstevel@tonic-gate * Common bitmap4 to gather attr cache state 198*0Sstevel@tonic-gate */ 199*0Sstevel@tonic-gate #define NFS4_NTOV_ATTR_CACHE_MASK ( \ 200*0Sstevel@tonic-gate FATTR4_TIME_METADATA_MASK | \ 201*0Sstevel@tonic-gate FATTR4_TIME_MODIFY_MASK | \ 202*0Sstevel@tonic-gate FATTR4_SIZE_MASK) 203*0Sstevel@tonic-gate 204*0Sstevel@tonic-gate /* 205*0Sstevel@tonic-gate * The corresponding AT_MASK 206*0Sstevel@tonic-gate */ 207*0Sstevel@tonic-gate #define NFS4_NTOV_ATTR_CACHE_AT_MASK ( \ 208*0Sstevel@tonic-gate AT_CTIME | \ 209*0Sstevel@tonic-gate AT_MTIME | \ 210*0Sstevel@tonic-gate AT_SIZE) 211*0Sstevel@tonic-gate 212*0Sstevel@tonic-gate #define NFS4_VTON_ATTR_MASK ( \ 213*0Sstevel@tonic-gate AT_TYPE | \ 214*0Sstevel@tonic-gate AT_MODE | \ 215*0Sstevel@tonic-gate AT_UID | \ 216*0Sstevel@tonic-gate AT_GID | \ 217*0Sstevel@tonic-gate AT_NODEID | \ 218*0Sstevel@tonic-gate AT_SIZE | \ 219*0Sstevel@tonic-gate AT_NLINK | \ 220*0Sstevel@tonic-gate AT_ATIME | \ 221*0Sstevel@tonic-gate AT_MTIME | \ 222*0Sstevel@tonic-gate AT_CTIME | \ 223*0Sstevel@tonic-gate AT_RDEV | \ 224*0Sstevel@tonic-gate AT_NBLOCKS | \ 225*0Sstevel@tonic-gate AT_FSID) 226*0Sstevel@tonic-gate 227*0Sstevel@tonic-gate #define NFS4_VTON_ATTR_MASK_SET ( \ 228*0Sstevel@tonic-gate AT_MODE | \ 229*0Sstevel@tonic-gate AT_UID | \ 230*0Sstevel@tonic-gate AT_GID | \ 231*0Sstevel@tonic-gate AT_SIZE | \ 232*0Sstevel@tonic-gate AT_ATIME | \ 233*0Sstevel@tonic-gate AT_MTIME) 234*0Sstevel@tonic-gate 235*0Sstevel@tonic-gate /* solaris-supported, non-vattr_t per-vnode scoped attrs */ 236*0Sstevel@tonic-gate #define NFS4_VP_ATTR_MASK ( \ 237*0Sstevel@tonic-gate FATTR4_CHANGE_MASK | \ 238*0Sstevel@tonic-gate FATTR4_CHOWN_RESTRICTED_MASK | \ 239*0Sstevel@tonic-gate FATTR4_FILEHANDLE_MASK | \ 240*0Sstevel@tonic-gate FATTR4_MAXFILESIZE_MASK | \ 241*0Sstevel@tonic-gate FATTR4_MAXLINK_MASK | \ 242*0Sstevel@tonic-gate FATTR4_MAXNAME_MASK | \ 243*0Sstevel@tonic-gate FATTR4_MOUNTED_ON_FILEID_MASK) 244*0Sstevel@tonic-gate 245*0Sstevel@tonic-gate #define FATTR4_FSINFO_MASK ( \ 246*0Sstevel@tonic-gate FATTR4_SUPPORTED_ATTRS_MASK | \ 247*0Sstevel@tonic-gate FATTR4_TYPE_MASK | \ 248*0Sstevel@tonic-gate FATTR4_FH_EXPIRE_TYPE_MASK | \ 249*0Sstevel@tonic-gate FATTR4_LINK_SUPPORT_MASK | \ 250*0Sstevel@tonic-gate FATTR4_SYMLINK_SUPPORT_MASK | \ 251*0Sstevel@tonic-gate FATTR4_FSID_MASK | \ 252*0Sstevel@tonic-gate FATTR4_MAXFILESIZE_MASK | \ 253*0Sstevel@tonic-gate FATTR4_MAXREAD_MASK | \ 254*0Sstevel@tonic-gate FATTR4_MAXWRITE_MASK) 255*0Sstevel@tonic-gate 256*0Sstevel@tonic-gate /* 257*0Sstevel@tonic-gate * These are the support attributes for the NFSv4 server 258*0Sstevel@tonic-gate */ 259*0Sstevel@tonic-gate #define NFS4_SRV_RDDIR_SUPPORTED_ATTRS ( \ 260*0Sstevel@tonic-gate FATTR4_SUPPORTED_ATTRS_MASK | \ 261*0Sstevel@tonic-gate FATTR4_TYPE_MASK | \ 262*0Sstevel@tonic-gate FATTR4_FH_EXPIRE_TYPE_MASK | \ 263*0Sstevel@tonic-gate FATTR4_CHANGE_MASK | \ 264*0Sstevel@tonic-gate FATTR4_SIZE_MASK | \ 265*0Sstevel@tonic-gate FATTR4_LINK_SUPPORT_MASK | \ 266*0Sstevel@tonic-gate FATTR4_SYMLINK_SUPPORT_MASK | \ 267*0Sstevel@tonic-gate FATTR4_NAMED_ATTR_MASK | \ 268*0Sstevel@tonic-gate FATTR4_FSID_MASK | \ 269*0Sstevel@tonic-gate FATTR4_UNIQUE_HANDLES_MASK | \ 270*0Sstevel@tonic-gate FATTR4_LEASE_TIME_MASK | \ 271*0Sstevel@tonic-gate FATTR4_RDATTR_ERROR_MASK | \ 272*0Sstevel@tonic-gate FATTR4_CANSETTIME_MASK | \ 273*0Sstevel@tonic-gate FATTR4_CASE_INSENSITIVE_MASK | \ 274*0Sstevel@tonic-gate FATTR4_CASE_PRESERVING_MASK | \ 275*0Sstevel@tonic-gate FATTR4_CHOWN_RESTRICTED_MASK | \ 276*0Sstevel@tonic-gate FATTR4_FILEHANDLE_MASK | \ 277*0Sstevel@tonic-gate FATTR4_FILEID_MASK | \ 278*0Sstevel@tonic-gate FATTR4_FILES_AVAIL_MASK | \ 279*0Sstevel@tonic-gate FATTR4_FILES_FREE_MASK | \ 280*0Sstevel@tonic-gate FATTR4_FILES_TOTAL_MASK | \ 281*0Sstevel@tonic-gate FATTR4_HOMOGENEOUS_MASK | \ 282*0Sstevel@tonic-gate FATTR4_MAXFILESIZE_MASK | \ 283*0Sstevel@tonic-gate FATTR4_MAXLINK_MASK | \ 284*0Sstevel@tonic-gate FATTR4_MAXNAME_MASK | \ 285*0Sstevel@tonic-gate FATTR4_MAXREAD_MASK | \ 286*0Sstevel@tonic-gate FATTR4_MAXWRITE_MASK | \ 287*0Sstevel@tonic-gate FATTR4_MODE_MASK | \ 288*0Sstevel@tonic-gate FATTR4_NO_TRUNC_MASK | \ 289*0Sstevel@tonic-gate FATTR4_NUMLINKS_MASK | \ 290*0Sstevel@tonic-gate FATTR4_OWNER_MASK | \ 291*0Sstevel@tonic-gate FATTR4_OWNER_GROUP_MASK | \ 292*0Sstevel@tonic-gate FATTR4_RAWDEV_MASK | \ 293*0Sstevel@tonic-gate FATTR4_SPACE_AVAIL_MASK | \ 294*0Sstevel@tonic-gate FATTR4_SPACE_FREE_MASK | \ 295*0Sstevel@tonic-gate FATTR4_SPACE_TOTAL_MASK | \ 296*0Sstevel@tonic-gate FATTR4_SPACE_USED_MASK | \ 297*0Sstevel@tonic-gate FATTR4_TIME_ACCESS_MASK | \ 298*0Sstevel@tonic-gate FATTR4_TIME_DELTA_MASK | \ 299*0Sstevel@tonic-gate FATTR4_TIME_METADATA_MASK | \ 300*0Sstevel@tonic-gate FATTR4_TIME_MODIFY_MASK | \ 301*0Sstevel@tonic-gate FATTR4_MOUNTED_ON_FILEID_MASK \ 302*0Sstevel@tonic-gate ) 303*0Sstevel@tonic-gate 304*0Sstevel@tonic-gate 305*0Sstevel@tonic-gate #define FATTR4_FSID_EQ(a, b) \ 306*0Sstevel@tonic-gate ((a)->major == (b)->major && (a)->minor == (b)->minor) 307*0Sstevel@tonic-gate 308*0Sstevel@tonic-gate #define NFS4_MAXNUM_BITWORDS 2 309*0Sstevel@tonic-gate #define NFS4_MAXNUM_ATTRS 56 310*0Sstevel@tonic-gate 311*0Sstevel@tonic-gate union nfs4_attr_u { 312*0Sstevel@tonic-gate fattr4_supported_attrs supported_attrs; 313*0Sstevel@tonic-gate fattr4_type type; 314*0Sstevel@tonic-gate fattr4_fh_expire_type fh_expire_type; 315*0Sstevel@tonic-gate fattr4_change change; 316*0Sstevel@tonic-gate fattr4_size size; 317*0Sstevel@tonic-gate fattr4_link_support link_support; 318*0Sstevel@tonic-gate fattr4_symlink_support symlink_support; 319*0Sstevel@tonic-gate fattr4_named_attr named_attr; 320*0Sstevel@tonic-gate fattr4_fsid fsid; 321*0Sstevel@tonic-gate fattr4_unique_handles unique_handles; 322*0Sstevel@tonic-gate fattr4_lease_time lease_time; 323*0Sstevel@tonic-gate fattr4_rdattr_error rdattr_error; 324*0Sstevel@tonic-gate fattr4_acl acl; 325*0Sstevel@tonic-gate fattr4_aclsupport aclsupport; 326*0Sstevel@tonic-gate fattr4_archive archive; 327*0Sstevel@tonic-gate fattr4_cansettime cansettime; 328*0Sstevel@tonic-gate fattr4_case_insensitive case_insensitive; 329*0Sstevel@tonic-gate fattr4_case_preserving case_preserving; 330*0Sstevel@tonic-gate fattr4_chown_restricted chown_restricted; 331*0Sstevel@tonic-gate fattr4_fileid fileid; 332*0Sstevel@tonic-gate fattr4_files_avail files_avail; 333*0Sstevel@tonic-gate fattr4_filehandle filehandle; 334*0Sstevel@tonic-gate fattr4_files_free files_free; 335*0Sstevel@tonic-gate fattr4_files_total files_total; 336*0Sstevel@tonic-gate fattr4_fs_locations fs_locations; 337*0Sstevel@tonic-gate fattr4_hidden hidden; 338*0Sstevel@tonic-gate fattr4_homogeneous homogeneous; 339*0Sstevel@tonic-gate fattr4_maxfilesize maxfilesize; 340*0Sstevel@tonic-gate fattr4_maxlink maxlink; 341*0Sstevel@tonic-gate fattr4_maxname maxname; 342*0Sstevel@tonic-gate fattr4_maxread maxread; 343*0Sstevel@tonic-gate fattr4_maxwrite maxwrite; 344*0Sstevel@tonic-gate fattr4_mimetype mimetype; 345*0Sstevel@tonic-gate fattr4_mode mode; 346*0Sstevel@tonic-gate fattr4_no_trunc no_trunc; 347*0Sstevel@tonic-gate fattr4_numlinks numlinks; 348*0Sstevel@tonic-gate fattr4_owner owner; 349*0Sstevel@tonic-gate fattr4_owner_group owner_group; 350*0Sstevel@tonic-gate fattr4_quota_avail_hard quota_avail_hard; 351*0Sstevel@tonic-gate fattr4_quota_avail_soft quota_avail_soft; 352*0Sstevel@tonic-gate fattr4_quota_used quota_used; 353*0Sstevel@tonic-gate fattr4_rawdev rawdev; 354*0Sstevel@tonic-gate fattr4_space_avail space_avail; 355*0Sstevel@tonic-gate fattr4_space_free space_free; 356*0Sstevel@tonic-gate fattr4_space_total space_total; 357*0Sstevel@tonic-gate fattr4_space_used space_used; 358*0Sstevel@tonic-gate fattr4_system system; 359*0Sstevel@tonic-gate fattr4_time_access time_access; 360*0Sstevel@tonic-gate fattr4_time_access_set time_access_set; 361*0Sstevel@tonic-gate fattr4_time_backup time_backup; 362*0Sstevel@tonic-gate fattr4_time_create time_create; 363*0Sstevel@tonic-gate fattr4_time_delta time_delta; 364*0Sstevel@tonic-gate fattr4_time_metadata time_metadata; 365*0Sstevel@tonic-gate fattr4_time_modify time_modify; 366*0Sstevel@tonic-gate fattr4_time_modify_set time_modify_set; 367*0Sstevel@tonic-gate fattr4_mounted_on_fileid mounted_on_fileid; 368*0Sstevel@tonic-gate }; 369*0Sstevel@tonic-gate 370*0Sstevel@tonic-gate /* 371*0Sstevel@tonic-gate * Error details when processing the getattr response. 372*0Sstevel@tonic-gate */ 373*0Sstevel@tonic-gate #define NFS4_GETATTR_OP_OK 0 374*0Sstevel@tonic-gate #define NFS4_GETATTR_STATUS_ERR 1 375*0Sstevel@tonic-gate #define NFS4_GETATTR_MANDATTR_ERR 2 376*0Sstevel@tonic-gate #define NFS4_GETATTR_BITMAP_ERR 3 377*0Sstevel@tonic-gate #define NFS4_GETATTR_ATSIZE_ERR 4 378*0Sstevel@tonic-gate #define NFS4_GETATTR_ATUID_ERR 5 379*0Sstevel@tonic-gate #define NFS4_GETATTR_ATGID_ERR 6 380*0Sstevel@tonic-gate #define NFS4_GETATTR_ATATIME_ERR 7 381*0Sstevel@tonic-gate #define NFS4_GETATTR_ATMTIME_ERR 8 382*0Sstevel@tonic-gate #define NFS4_GETATTR_ATCTIME_ERR 9 383*0Sstevel@tonic-gate #define NFS4_GETATTR_RAWDEV_ERR 10 384*0Sstevel@tonic-gate #define NFS4_GETATTR_ATNBLOCK_ERR 11 385*0Sstevel@tonic-gate #define NFS4_GETATTR_MAXFILESIZE_ERR 12 386*0Sstevel@tonic-gate #define NFS4_GETATTR_FHANDLE_ERR 13 387*0Sstevel@tonic-gate #define NFS4_GETATTR_MAXREAD_ERR 14 388*0Sstevel@tonic-gate #define NFS4_GETATTR_MAXWRITE_ERR 15 389*0Sstevel@tonic-gate #define NFS4_GETATTR_NOCACHE_OK 16 390*0Sstevel@tonic-gate 391*0Sstevel@tonic-gate typedef struct nfs4_pathconf_info { 392*0Sstevel@tonic-gate unsigned pc4_cache_valid:1; /* When in rnode4, is data valid? */ 393*0Sstevel@tonic-gate unsigned pc4_no_trunc:1; 394*0Sstevel@tonic-gate unsigned pc4_chown_restricted:1; 395*0Sstevel@tonic-gate unsigned pc4_case_insensitive:1; 396*0Sstevel@tonic-gate unsigned pc4_case_preserving:1; 397*0Sstevel@tonic-gate unsigned pc4_xattr_valid:1; 398*0Sstevel@tonic-gate unsigned pc4_xattr_exists:1; 399*0Sstevel@tonic-gate unsigned pc4_link_support:1; 400*0Sstevel@tonic-gate unsigned pc4_symlink_support:1; 401*0Sstevel@tonic-gate unsigned pc4_unique_handles:1; 402*0Sstevel@tonic-gate unsigned pc4_cansettime:1; 403*0Sstevel@tonic-gate unsigned pc4_homogeneous:1; 404*0Sstevel@tonic-gate uint_t pc4_link_max; 405*0Sstevel@tonic-gate uint_t pc4_name_max; 406*0Sstevel@tonic-gate uint_t pc4_filesizebits; 407*0Sstevel@tonic-gate } nfs4_pathconf_info_t; 408*0Sstevel@tonic-gate 409*0Sstevel@tonic-gate /* 410*0Sstevel@tonic-gate * Used for client only to process incoming getattr results. 411*0Sstevel@tonic-gate */ 412*0Sstevel@tonic-gate typedef struct nfs4_ga_ext_res { 413*0Sstevel@tonic-gate bitmap4 n4g_suppattrs; 414*0Sstevel@tonic-gate nfsstat4 n4g_rdattr_error; 415*0Sstevel@tonic-gate fattr4_fh_expire_type n4g_fet; 416*0Sstevel@tonic-gate fattr4_lease_time n4g_leasetime; 417*0Sstevel@tonic-gate uint64_t n4g_maxfilesize; 418*0Sstevel@tonic-gate uint64_t n4g_maxread; 419*0Sstevel@tonic-gate uint64_t n4g_maxwrite; 420*0Sstevel@tonic-gate nfstime4 n4g_delta; 421*0Sstevel@tonic-gate nfs4_pathconf_info_t n4g_pc4; 422*0Sstevel@tonic-gate struct statvfs64 n4g_sb; 423*0Sstevel@tonic-gate union { 424*0Sstevel@tonic-gate nfs_fh4 n4g_fh; 425*0Sstevel@tonic-gate struct { 426*0Sstevel@tonic-gate uint_t len; 427*0Sstevel@tonic-gate char *val; 428*0Sstevel@tonic-gate char data[NFS4_FHSIZE]; 429*0Sstevel@tonic-gate } nfs_fh4_alt; 430*0Sstevel@tonic-gate } n4g_fh_u; 431*0Sstevel@tonic-gate /* 432*0Sstevel@tonic-gate * Bitmask with valid fields being: 433*0Sstevel@tonic-gate * ACL4_SUPPORT_ALLOW_ACL 434*0Sstevel@tonic-gate * ACL4_SUPPORT_DENY_ACL 435*0Sstevel@tonic-gate * ACL4_SUPPORT_AUDIT_ACL 436*0Sstevel@tonic-gate * ACL4_SUPPORT_ALARM_ACL 437*0Sstevel@tonic-gate */ 438*0Sstevel@tonic-gate fattr4_aclsupport n4g_aclsupport; 439*0Sstevel@tonic-gate } nfs4_ga_ext_res_t; 440*0Sstevel@tonic-gate 441*0Sstevel@tonic-gate extern bitmap4 rfs4_supported_attrs; 442*0Sstevel@tonic-gate 443*0Sstevel@tonic-gate #ifdef __cplusplus 444*0Sstevel@tonic-gate } 445*0Sstevel@tonic-gate #endif 446*0Sstevel@tonic-gate 447*0Sstevel@tonic-gate #endif /* _NFS4_ATTR_H */ 448