summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys
diff options
context:
space:
mode:
authoramw <none@none>2007-10-25 16:34:29 -0700
committeramw <none@none>2007-10-25 16:34:29 -0700
commitda6c28aaf62fa55f0fdb8004aa40f88f23bf53f0 (patch)
tree65be91fb78a6a66183197595333f2e8aafb4640a /usr/src/uts/common/sys
parente845e33dd0d1aea22db7edaa8c7d43955d24609b (diff)
downloadillumos-gate-da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0.tar.gz
PSARC/2007/218 caller_context_t in all VOPs
PSARC/2007/227 VFS Feature Registration and ACL on Create PSARC/2007/244 ZFS Case-insensitive support PSARC/2007/315 Extensible Attribute Interfaces PSARC/2007/394 ls(1) new command line options '-/' and '-%': CIFS system attributes support PSARC/2007/403 Modified Access Checks for CIFS PSARC/2007/410 Add system attribute support to chmod(1) PSARC/2007/432 CIFS system attributes support for cp(1), pack(1), unpack(1), compress(1) and uncompress(1) PSARC/2007/444 Rescind SETTABLE Attribute PSARC/2007/459 CIFS system attributes support for cpio(1), pax(1), tar(1) PSARC/2007/546 Update utilities to match CIFS system attributes changes. PSARC/2007/560 ZFS sharesmb property 4890717 want append-only files 6417428 Case-insensitive file system name lookup to support CIFS 6417435 DOS attributes and additional timestamps to support for CIFS 6417442 File system quarantined and modified attributes to support an integrated Anti-Virus service 6417453 FS boolean property for rejecting/allowing invalid UTF-8 sequences in file names 6473733 RFE: Need support for open-deny modes 6473755 RFE: Need ability to reconcile oplock and delegation conflicts 6494624 sharemgr needs to support CIFS shares better 6546705 All vnode operations need to pass caller_context_t 6546706 Need VOP_SETATTR/VOP_GETATTR to support new, optional attributes 6546893 Solaris system attribute support 6550962 ZFS ACL inheritance needs to be enhanced to support Automatic Inheritance 6553589 RFE: VFS Feature Registration facility 6553770 RFE: ZFS support for ACL-on-CREATE (PSARC 2007/227) 6565581 ls(1) should support file system attributes proposed in PSARC/2007/315 6566784 NTFS streams are not copied along with the files. 6576205 cp(1), pack(1) and compress(1) should support file system attributes proposed in PSARC/2007/315 6578875 RFE: kernel interfaces for nbmand need improvement 6578883 RFE: VOP_SHRLOCK needs additional access types 6578885 chmod(1) should support file system attributes proposed in PSARC/2007/315 6578886 RFE: disallow nbmand state to change on remount 6583349 ACL parser needs to support audit/alarm ACE types 6590347 tar(1) should support filesystem attributes proposed in PSARC/2007/315 6597357 *tar* xv@ doesn't show the hidden directory even though it is restored 6597360 *tar* should re-init xattr info if openat() fails during extraction of and extended attribute 6597368 *tar* cannot restore hard linked extended attributes 6597374 *tar* doesn't display "x " when hard linked attributes are restored 6597375 *tar* extended attribute header off by one 6614861 *cpio* incorrectly archives extended system attributes with -@ 6614896 *pax* incorrectly archives extended system attributes with -@ 6615225 *tar* incorrectly archives extended system attributes with -@ 6617183 CIFS Service - PSARC 2006/715
Diffstat (limited to 'usr/src/uts/common/sys')
-rw-r--r--usr/src/uts/common/sys/Makefile4
-rw-r--r--usr/src/uts/common/sys/acl.h49
-rw-r--r--usr/src/uts/common/sys/acl_impl.h61
-rw-r--r--usr/src/uts/common/sys/attr.h148
-rw-r--r--usr/src/uts/common/sys/byteorder.h64
-rw-r--r--usr/src/uts/common/sys/cred.h2
-rw-r--r--usr/src/uts/common/sys/ctfs_impl.h22
-rw-r--r--usr/src/uts/common/sys/epm.h13
-rw-r--r--usr/src/uts/common/sys/extdirent.h77
-rw-r--r--usr/src/uts/common/sys/fcntl.h3
-rw-r--r--usr/src/uts/common/sys/fem.h208
-rw-r--r--usr/src/uts/common/sys/file.h14
-rw-r--r--usr/src/uts/common/sys/fs/fifonode.h11
-rw-r--r--usr/src/uts/common/sys/fs/pc_node.h6
-rw-r--r--usr/src/uts/common/sys/fs/snode.h3
-rw-r--r--usr/src/uts/common/sys/fs/tmp.h9
-rw-r--r--usr/src/uts/common/sys/fs/udf_inode.h11
-rw-r--r--usr/src/uts/common/sys/fs/zfs.h30
-rw-r--r--usr/src/uts/common/sys/gfs.h24
-rw-r--r--usr/src/uts/common/sys/modctl.h2
-rw-r--r--usr/src/uts/common/sys/nbmlock.h17
-rw-r--r--usr/src/uts/common/sys/objfs_impl.h15
-rw-r--r--usr/src/uts/common/sys/policy.h2
-rw-r--r--usr/src/uts/common/sys/sid.h2
-rw-r--r--usr/src/uts/common/sys/socketvar.h25
-rw-r--r--usr/src/uts/common/sys/tzfile.h166
-rw-r--r--usr/src/uts/common/sys/unistd.h10
-rw-r--r--usr/src/uts/common/sys/vfs.h68
-rw-r--r--usr/src/uts/common/sys/vnode.h681
29 files changed, 1375 insertions, 372 deletions
diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile
index 4cd97b5c3a..55b5b18e42 100644
--- a/usr/src/uts/common/sys/Makefile
+++ b/usr/src/uts/common/sys/Makefile
@@ -76,6 +76,7 @@ CHKHDRS= \
acct.h \
acctctl.h \
acl.h \
+ acl_impl.h \
aggr.h \
aggr_impl.h \
aio.h \
@@ -85,6 +86,7 @@ CHKHDRS= \
ascii.h \
asynch.h \
atomic.h \
+ attr.h \
audio.h \
audiodebug.h \
audioio.h \
@@ -223,6 +225,7 @@ CHKHDRS= \
exacct_impl.h \
exec.h \
exechdr.h \
+ extdirent.h \
fault.h \
fasttrap.h \
fasttrap_impl.h \
@@ -540,6 +543,7 @@ CHKHDRS= \
turnstile.h \
types.h \
types32.h \
+ tzfile.h \
u8_textprep.h \
u8_textprep_data.h \
uadmin.h \
diff --git a/usr/src/uts/common/sys/acl.h b/usr/src/uts/common/sys/acl.h
index b0dc94240d..98f962deba 100644
--- a/usr/src/uts/common/sys/acl.h
+++ b/usr/src/uts/common/sys/acl.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -29,6 +29,7 @@
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/types.h>
+#include <sys/acl_impl.h>
#ifdef __cplusplus
extern "C" {
@@ -62,7 +63,7 @@ typedef struct acl_info acl_t;
#define ACL_DEFAULT (0x1000) /* default flag */
/* default object owner */
#define DEF_USER_OBJ (ACL_DEFAULT | USER_OBJ)
-/* defalut additional users */
+/* default additional users */
#define DEF_USER (ACL_DEFAULT | USER)
/* default owning group */
#define DEF_GROUP_OBJ (ACL_DEFAULT | GROUP_OBJ)
@@ -101,6 +102,7 @@ typedef struct acl_info acl_t;
#define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010
#define ACE_FAILED_ACCESS_ACE_FLAG 0x0020
#define ACE_IDENTIFIER_GROUP 0x0040
+#define ACE_INHERITED_ACE 0x0080
#define ACE_OWNER 0x1000
#define ACE_GROUP 0x2000
#define ACE_EVERYONE 0x4000
@@ -110,6 +112,44 @@ typedef struct acl_info acl_t;
#define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002
#define ACE_SYSTEM_ALARM_ACE_TYPE 0x0003
+#define ACL_AUTO_INHERIT 0x0001
+#define ACL_PROTECTED 0x0002
+#define ACL_DEFAULTED 0x0004
+#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED| \
+ ACL_DEFAULTED)
+
+#ifdef _KERNEL
+
+/*
+ * These are only applicable in a CIFS context.
+ */
+#define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04
+#define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05
+#define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE 0x06
+#define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE 0x07
+#define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE 0x08
+#define ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE 0x09
+#define ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE 0x0A
+#define ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE 0x0B
+#define ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE 0x0C
+#define ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE 0x0D
+#define ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE 0x0E
+#define ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE 0x0F
+#define ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE 0x10
+
+#define ACE_ALL_TYPES 0x001F
+
+typedef struct ace_object {
+ uid_t a_who; /* uid or gid */
+ uint32_t a_access_mask; /* read,write,... */
+ uint16_t a_flags; /* see below */
+ uint16_t a_type; /* allow or deny */
+ uint8_t a_obj_type[16]; /* obj type */
+ uint8_t a_inherit_obj_type[16]; /* inherit obj */
+} ace_object_t;
+
+#endif
+
#define ACE_ALL_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS| \
ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES| \
@@ -125,7 +165,10 @@ typedef struct acl_info acl_t;
ACE_INHERIT_ONLY_ACE | \
ACE_IDENTIFIER_GROUP)
-#define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE|ACE_IDENTIFIER_GROUP)
+#define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE| \
+ ACE_IDENTIFIER_GROUP)
+#define ACE_INHERIT_FLAGS (ACE_FILE_INHERIT_ACE| \
+ ACE_DIRECTORY_INHERIT_ACE|ACE_NO_PROPAGATE_INHERIT_ACE|ACE_INHERIT_ONLY_ACE)
/* cmd args to acl(2) for aclent_t */
#define GETACL 1
diff --git a/usr/src/uts/common/sys/acl_impl.h b/usr/src/uts/common/sys/acl_impl.h
new file mode 100644
index 0000000000..b82f259143
--- /dev/null
+++ b/usr/src/uts/common/sys/acl_impl.h
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (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
+ * or http://www.opensolaris.org/os/licensing.
+ * 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 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SYS_ACL_IMPL_H
+#define _SYS_ACL_IMPL_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * acl flags
+ *
+ * ACL_AUTO_INHERIT, ACL_PROTECTED and ACL_DEFAULTED
+ * flags can also be stored in this field.
+ */
+#define ACL_IS_TRIVIAL 0x10000
+#define ACL_IS_DIR 0x20000
+
+typedef enum acl_type {
+ ACLENT_T = 0,
+ ACE_T = 1
+} acl_type_t;
+
+struct acl_info {
+ acl_type_t acl_type; /* style of acl */
+ int acl_cnt; /* number of acl entries */
+ int acl_entry_size; /* sizeof acl entry */
+ int acl_flags; /* special flags about acl */
+ void *acl_aclp; /* the acl */
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_ACL_IMPL_H */
diff --git a/usr/src/uts/common/sys/attr.h b/usr/src/uts/common/sys/attr.h
new file mode 100644
index 0000000000..34e802eed1
--- /dev/null
+++ b/usr/src/uts/common/sys/attr.h
@@ -0,0 +1,148 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (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
+ * or http://www.opensolaris.org/os/licensing.
+ * 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 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SYS_ATTR_H
+#define _SYS_ATTR_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _KERNEL
+#include <sys/vnode.h>
+#include <sys/vfs.h>
+#include <nfs/nfs.h>
+#endif
+#include <sys/nvpair.h>
+
+/* Attribute names for nvlist's */
+#define A_CRTIME "crtime"
+#define A_HIDDEN "hidden"
+#define A_SYSTEM "system"
+#define A_READONLY "readonly"
+#define A_ARCHIVE "archive"
+#define A_NOUNLINK "nounlink"
+#define A_IMMUTABLE "immutable"
+#define A_APPENDONLY "appendonly"
+#define A_NODUMP "nodump"
+#define A_OPAQUE "opaque"
+#define A_AV_QUARANTINED "av_quarantined"
+#define A_AV_MODIFIED "av_modified"
+#define A_FSID "fsid"
+#define A_AV_SCANSTAMP "av_scanstamp"
+#define A_MDEV "mdev"
+#define A_OWNERSID "ownersid"
+#define A_GROUPSID "groupsid"
+
+/* Attribute option for utilities */
+#define O_HIDDEN "H"
+#define O_SYSTEM "S"
+#define O_READONLY "R"
+#define O_ARCHIVE "A"
+#define O_NOUNLINK "u"
+#define O_IMMUTABLE "i"
+#define O_APPENDONLY "a"
+#define O_NODUMP "d"
+#define O_AV_QUARANTINED "q"
+#define O_AV_MODIFIED "m"
+#define O_NONE ""
+
+/* ownersid and groupsid are composed of two nvpairs */
+#define SID_DOMAIN "domain"
+#define SID_RID "rid"
+
+typedef enum {
+ F_ATTR_INVAL = -1,
+ F_ARCHIVE,
+ F_HIDDEN,
+ F_READONLY,
+ F_SYSTEM,
+ F_APPENDONLY,
+ F_NODUMP,
+ F_IMMUTABLE,
+ F_AV_MODIFIED,
+ F_OPAQUE,
+ F_AV_SCANSTAMP,
+ F_AV_QUARANTINED,
+ F_NOUNLINK,
+ F_CRTIME,
+ F_OWNERSID,
+ F_GROUPSID,
+ F_FSID,
+ F_MDEV,
+ F_ATTR_ALL
+} f_attr_t;
+
+#define VIEW_READONLY "SUNWattr_ro"
+#define VIEW_READWRITE "SUNWattr_rw"
+
+/*
+ * These are the supported views into the virtual sysattr directory.
+ * Additional views should be added before XATTR_VIEW_LAST.
+ */
+typedef enum {
+ XATTR_VIEW_INVALID = -1,
+ XATTR_VIEW_READONLY,
+ XATTR_VIEW_READWRITE,
+ XATTR_VIEW_LAST
+} xattr_view_t;
+
+typedef struct {
+ char *x_name;
+ char *x_option;
+ xattr_view_t x_xattr_view;
+ data_type_t x_data_type;
+} xattr_entry_t;
+
+#ifdef _KERNEL
+#define XATTR_MAXFIDSZ NFS_FHMAXDATA
+
+typedef struct {
+ uint16_t len;
+ char parent_fid[XATTR_MAXFIDSZ];
+ uint16_t parent_len;
+ uint16_t dir_offset;
+} xattr_fid_t;
+
+#define XATTR_FIDSZ (sizeof (xattr_fid_t) - sizeof (uint16_t))
+
+int xattr_dir_vget(vfs_t *, vnode_t **, fid_t *);
+#endif
+
+int attr_count(void);
+const char *attr_to_name(f_attr_t);
+const char *attr_to_option(f_attr_t);
+f_attr_t name_to_attr(const char *name);
+f_attr_t option_to_attr(const char *option);
+xattr_view_t attr_to_xattr_view(f_attr_t attr);
+data_type_t attr_to_data_type(f_attr_t attr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_ATTR_H */
diff --git a/usr/src/uts/common/sys/byteorder.h b/usr/src/uts/common/sys/byteorder.h
index b80a0f02bd..36a82e2bbf 100644
--- a/usr/src/uts/common/sys/byteorder.h
+++ b/usr/src/uts/common/sys/byteorder.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -128,6 +128,68 @@ extern in_port_t ntohs(in_port_t);
#define BE_64(x) BSWAP_64(x)
#endif
+/*
+ * Macros to read unaligned values from a specific byte order to
+ * native byte order
+ */
+
+#define BE_IN8(xa) \
+ *((uint8_t *)(xa))
+
+#define BE_IN16(xa) \
+ (((uint16_t)BE_IN8(xa) << 8) | BE_IN8((uint8_t *)(xa)+1))
+
+#define BE_IN32(xa) \
+ (((uint32_t)BE_IN16(xa) << 16) | BE_IN16((uint8_t *)(xa)+2))
+
+#define BE_IN64(xa) \
+ (((uint64_t)BE_IN32(xa) << 32) | BE_IN32((uint8_t *)(xa)+4))
+
+#define LE_IN8(xa) \
+ *((uint8_t *)(xa))
+
+#define LE_IN16(xa) \
+ (((uint16_t)LE_IN8((uint8_t *)(xa) + 1) << 8) | LE_IN8(xa))
+
+#define LE_IN32(xa) \
+ (((uint32_t)LE_IN16((uint8_t *)(xa) + 2) << 16) | LE_IN16(xa))
+
+#define LE_IN64(xa) \
+ (((uint64_t)LE_IN32((uint8_t *)(xa) + 4) << 32) | LE_IN32(xa))
+
+/*
+ * Macros to write unaligned values from native byte order to a specific byte
+ * order.
+ */
+
+#define BE_OUT8(xa, yv) *((uint8_t *)(xa)) = (uint8_t)(yv);
+
+#define BE_OUT16(xa, yv) \
+ BE_OUT8((uint8_t *)(xa) + 1, yv); \
+ BE_OUT8((uint8_t *)(xa), (yv) >> 8);
+
+#define BE_OUT32(xa, yv) \
+ BE_OUT16((uint8_t *)(xa) + 2, yv); \
+ BE_OUT16((uint8_t *)(xa), (yv) >> 16);
+
+#define BE_OUT64(xa, yv) \
+ BE_OUT32((uint8_t *)(xa) + 4, yv); \
+ BE_OUT32((uint8_t *)(xa), (yv) >> 32);
+
+#define LE_OUT8(xa, yv) *((uint8_t *)(xa)) = (uint8_t)(yv);
+
+#define LE_OUT16(xa, yv) \
+ LE_OUT8((uint8_t *)(xa), yv); \
+ LE_OUT8((uint8_t *)(xa) + 1, (yv) >> 8);
+
+#define LE_OUT32(xa, yv) \
+ LE_OUT16((uint8_t *)(xa), yv); \
+ LE_OUT16((uint8_t *)(xa) + 2, (yv) >> 16);
+
+#define LE_OUT64(xa, yv) \
+ LE_OUT32((uint8_t *)(xa), yv); \
+ LE_OUT32((uint8_t *)(xa) + 4, (yv) >> 32);
+
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
#ifdef __cplusplus
diff --git a/usr/src/uts/common/sys/cred.h b/usr/src/uts/common/sys/cred.h
index 29e9a6ddeb..41f2827f78 100644
--- a/usr/src/uts/common/sys/cred.h
+++ b/usr/src/uts/common/sys/cred.h
@@ -170,6 +170,8 @@ extern void crsetsidlist(cred_t *, struct ksidlist *);
extern struct ksid *crgetsid(const cred_t *, int);
extern struct ksidlist *crgetsidlist(const cred_t *);
+extern int crsetpriv(cred_t *, ...);
+
#endif /* _KERNEL */
#ifdef __cplusplus
diff --git a/usr/src/uts/common/sys/ctfs_impl.h b/usr/src/uts/common/sys/ctfs_impl.h
index 1c835a60f6..77e491a550 100644
--- a/usr/src/uts/common/sys/ctfs_impl.h
+++ b/usr/src/uts/common/sys/ctfs_impl.h
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -207,11 +206,16 @@ extern vnode_t *ctfs_create_symnode(vnode_t *, contract_t *);
* common ctfs routines
*/
extern void ctfs_common_getattr(vnode_t *, vattr_t *);
-extern int ctfs_close(vnode_t *, int, int, offset_t, cred_t *);
-extern int ctfs_access_dir(vnode_t *, int, int, cred_t *);
-extern int ctfs_access_readonly(vnode_t *, int, int, cred_t *);
-extern int ctfs_access_readwrite(vnode_t *, int, int, cred_t *);
-extern int ctfs_open(vnode_t **, int, cred_t *);
+extern int ctfs_close(vnode_t *, int, int, offset_t, cred_t *,
+ caller_context_t *);
+extern int ctfs_access_dir(vnode_t *, int, int, cred_t *,
+ caller_context_t *);
+extern int ctfs_access_readonly(vnode_t *, int, int, cred_t *,
+ caller_context_t *);
+extern int ctfs_access_readwrite(vnode_t *, int, int, cred_t *,
+ caller_context_t *);
+extern int ctfs_open(vnode_t **, int, cred_t *,
+ caller_context_t *);
/*
* vnode ops vector templates
diff --git a/usr/src/uts/common/sys/epm.h b/usr/src/uts/common/sys/epm.h
index 35b656409b..d1c67f383f 100644
--- a/usr/src/uts/common/sys/epm.h
+++ b/usr/src/uts/common/sys/epm.h
@@ -33,6 +33,7 @@
#include <sys/devops.h>
#include <sys/ddi_impldefs.h>
#include <sys/taskq.h>
+#include <sys/tzfile.h>
/*
* XXXX
@@ -166,7 +167,7 @@ typedef struct pm_component {
* kidsupcnt counts (the number of components of new-style children at non-zero
* level (unknown counts as non-zero)) + (the number of old-style children with
* component 0 at non-zero level) for parents that have not asked for
- * notifcation. When kidsupcnt is 0 for a nexus node, then pm scans it,
+ * notification. When kidsupcnt is 0 for a nexus node, then pm scans it,
* otherwise it leaves it alone.
* Parents that ask for notification always get get scanned,
* so we keep their kidsupcnt at zero.
@@ -911,7 +912,7 @@ typedef struct pscc { /* pm_state_change_control */
#define PSCCOUNT 128 /* number of state change entries kept per process */
/*
- * Struct used to track the existance of devices exporting the
+ * Struct used to track the existence of devices exporting the
* no-involuntary-power-cycles property, and remember things from their
* devinfo node for later attach.
*/
@@ -985,14 +986,6 @@ typedef struct pm_desc_pwrchk {
* These defines are used by pm_trans_check() to calculate time.
* Mostly copied from "tzfile.h".
*/
-#define EPOCH_YEAR 1970
-#define SECSPERMIN 60
-#define MINSPERHOUR 60
-#define HOURSPERDAY 24
-#define DAYSPERWEEK 7
-#define DAYSPERNYEAR 365
-#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
-#define SECSPERDAY (SECSPERHOUR * HOURSPERDAY)
#define DC_SPY (SECSPERDAY * DAYSPERNYEAR)
#define DC_SPW (SECSPERDAY * DAYSPERWEEK)
#define DC_SPD SECSPERDAY
diff --git a/usr/src/uts/common/sys/extdirent.h b/usr/src/uts/common/sys/extdirent.h
new file mode 100644
index 0000000000..3f9a665f00
--- /dev/null
+++ b/usr/src/uts/common/sys/extdirent.h
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (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
+ * or http://www.opensolaris.org/os/licensing.
+ * 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 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SYS_EXTDIRENT_H
+#define _SYS_EXTDIRENT_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/types.h>
+
+#if defined(_KERNEL)
+
+/*
+ * Extended file-system independent directory entry. This style of
+ * dirent provides additional informational flag bits for each
+ * directory entry. This dirent will be returned instead of the
+ * standard dirent if a VOP_READDIR() requests dirent flags via
+ * V_RDDIR_ENTFLAGS, and if the file system supports the flags.
+ */
+typedef struct edirent {
+ ino64_t ed_ino; /* "inode number" of entry */
+ off64_t ed_off; /* offset of disk directory entry */
+ uint32_t ed_eflags; /* per-entry flags */
+ unsigned short ed_reclen; /* length of this record */
+ char ed_name[1]; /* name of file */
+} edirent_t;
+
+#define EDIRENT_RECLEN(namelen) \
+ ((offsetof(edirent_t, ed_name[0]) + 1 + (namelen) + 7) & ~ 7)
+#define EDIRENT_NAMELEN(reclen) \
+ ((reclen) - (offsetof(edirent_t, ed_name[0])))
+
+/*
+ * Extended entry flags
+ * Extended entries include a bitfield of extra information
+ * regarding that entry.
+ */
+#define ED_CASE_CONFLICT 0x10 /* Disconsidering case, entry is not unique */
+
+/*
+ * Extended flags accessor function
+ */
+#define ED_CASE_CONFLICTS(x) ((x)->ed_eflags & ED_CASE_CONFLICT)
+
+#endif /* defined(_KERNEL) */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_EXTDIRENT_H */
diff --git a/usr/src/uts/common/sys/fcntl.h b/usr/src/uts/common/sys/fcntl.h
index 70df5244f6..cb55161060 100644
--- a/usr/src/uts/common/sys/fcntl.h
+++ b/usr/src/uts/common/sys/fcntl.h
@@ -329,6 +329,8 @@ typedef struct fshare {
#define F_RDACC 0x1 /* Read-only share access */
#define F_WRACC 0x2 /* Write-only share access */
#define F_RWACC 0x3 /* Read-Write share access */
+#define F_RMACC 0x4 /* private flag: Delete share access */
+#define F_MDACC 0x20 /* private flag: Metadata share access */
/*
* f_deny values
@@ -337,6 +339,7 @@ typedef struct fshare {
#define F_RDDNY 0x1 /* Deny others read share access */
#define F_WRDNY 0x2 /* Deny others write share access */
#define F_RWDNY 0x3 /* Deny others read or write share access */
+#define F_RMDNY 0x4 /* private flag: Deny delete share access */
#define F_COMPAT 0x8 /* Set share to old DOS compatibility mode */
#define F_MANDDNY 0x10 /* private flag: mandatory enforcement */
#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) */
diff --git a/usr/src/uts/common/sys/fem.h b/usr/src/uts/common/sys/fem.h
index 2816734291..e1f051b4ad 100644
--- a/usr/src/uts/common/sys/fem.h
+++ b/usr/src/uts/common/sys/fem.h
@@ -92,6 +92,8 @@ typedef struct fsem fsem_t;
typedef int femop_t();
+typedef void (*fem_func_t)(void *);
+
/*
* The following enumerations specify the conditions
* under which a monitor (operation/argument combination)
@@ -146,95 +148,119 @@ struct fem_head {
* the fem structure (below) and the fs_func_p union (vfs_opreg.h).
*/
#define FEM_OPS \
- int (*femop_open)(femarg_t *vf, int mode, cred_t *cr); \
+ int (*femop_open)(femarg_t *vf, int mode, cred_t *cr, \
+ caller_context_t *ct); \
int (*femop_close)(femarg_t *vf, int flag, int count, \
- offset_t offset, cred_t *cr); \
+ offset_t offset, cred_t *cr, \
+ caller_context_t *ct); \
int (*femop_read)(femarg_t *vf, uio_t *uiop, int ioflag, \
- cred_t *cr, struct caller_context *ct); \
+ cred_t *cr, caller_context_t *ct); \
int (*femop_write)(femarg_t *vf, uio_t *uiop, int ioflag, \
- cred_t *cr, struct caller_context *ct); \
+ cred_t *cr, caller_context_t *ct); \
int (*femop_ioctl)(femarg_t *vf, int cmd, intptr_t arg, \
- int flag, cred_t *cr, int *rvalp); \
+ int flag, cred_t *cr, int *rvalp, \
+ caller_context_t *ct); \
int (*femop_setfl)(femarg_t *vf, int oflags, int nflags, \
- cred_t *cr); \
+ cred_t *cr, caller_context_t *ct); \
int (*femop_getattr)(femarg_t *vf, vattr_t *vap, int flags, \
- cred_t *cr); \
+ cred_t *cr, caller_context_t *ct); \
int (*femop_setattr)(femarg_t *vf, vattr_t *vap, int flags, \
cred_t *cr, caller_context_t *ct); \
int (*femop_access)(femarg_t *vf, int mode, int flags, \
- cred_t *cr); \
+ cred_t *cr, caller_context_t *ct); \
int (*femop_lookup)(femarg_t *vf, char *nm, vnode_t **vpp, \
pathname_t *pnp, int flags, vnode_t *rdir, \
- cred_t *cr); \
+ cred_t *cr, caller_context_t *ct, \
+ int *direntflags, pathname_t *realpnp); \
int (*femop_create)(femarg_t *vf, char *name, vattr_t *vap, \
vcexcl_t excl, int mode, vnode_t **vpp, \
- cred_t *cr, int flag); \
- int (*femop_remove)(femarg_t *vf, char *nm, cred_t *cr); \
+ cred_t *cr, int flag, caller_context_t *ct, \
+ vsecattr_t *vsecp); \
+ int (*femop_remove)(femarg_t *vf, char *nm, cred_t *cr, \
+ caller_context_t *ct, int flags); \
int (*femop_link)(femarg_t *vf, vnode_t *svp, char *tnm, \
- cred_t *cr); \
+ cred_t *cr, caller_context_t *ct, int flags); \
int (*femop_rename)(femarg_t *vf, char *snm, vnode_t *tdvp, \
- char *tnm, cred_t *cr); \
+ char *tnm, cred_t *cr, caller_context_t *ct, \
+ int flags); \
int (*femop_mkdir)(femarg_t *vf, char *dirname, vattr_t *vap, \
- vnode_t **vpp, cred_t *cr); \
+ vnode_t **vpp, cred_t *cr, \
+ caller_context_t *ct, int flags, \
+ vsecattr_t *vsecp); \
int (*femop_rmdir)(femarg_t *vf, char *nm, vnode_t *cdir, \
- cred_t *cr); \
+ cred_t *cr, caller_context_t *ct, int flags); \
int (*femop_readdir)(femarg_t *vf, uio_t *uiop, cred_t *cr, \
- int *eofp); \
+ int *eofp, caller_context_t *ct, int flags); \
int (*femop_symlink)(femarg_t *vf, char *linkname, \
- vattr_t *vap, char *target, cred_t *cr); \
- int (*femop_readlink)(femarg_t *vf, uio_t *uiop, cred_t *cr); \
- int (*femop_fsync)(femarg_t *vf, int syncflag, cred_t *cr); \
- void (*femop_inactive)(femarg_t *vf, cred_t *cr); \
- int (*femop_fid)(femarg_t *vf, fid_t *fidp); \
+ vattr_t *vap, char *target, cred_t *cr, \
+ caller_context_t *ct, int flags); \
+ int (*femop_readlink)(femarg_t *vf, uio_t *uiop, cred_t *cr, \
+ caller_context_t *ct); \
+ int (*femop_fsync)(femarg_t *vf, int syncflag, cred_t *cr, \
+ caller_context_t *ct); \
+ void (*femop_inactive)(femarg_t *vf, cred_t *cr, \
+ caller_context_t *ct); \
+ int (*femop_fid)(femarg_t *vf, fid_t *fidp, \
+ caller_context_t *ct); \
int (*femop_rwlock)(femarg_t *vf, int write_lock, \
caller_context_t *ct); \
void (*femop_rwunlock)(femarg_t *vf, int write_lock, \
caller_context_t *ct); \
int (*femop_seek)(femarg_t *vf, offset_t ooff, \
- offset_t *noffp); \
- int (*femop_cmp)(femarg_t *vf, vnode_t *vp2); \
+ offset_t *noffp, caller_context_t *ct); \
+ int (*femop_cmp)(femarg_t *vf, vnode_t *vp2, \
+ caller_context_t *ct); \
int (*femop_frlock)(femarg_t *vf, int cmd, struct flock64 *bfp, \
int flag, offset_t offset, \
- struct flk_callback *flk_cbp, cred_t *cr); \
+ struct flk_callback *flk_cbp, cred_t *cr, \
+ caller_context_t *ct); \
int (*femop_space)(femarg_t *vf, int cmd, struct flock64 *bfp, \
int flag, offset_t offset, cred_t *cr, \
caller_context_t *ct); \
- int (*femop_realvp)(femarg_t *vf, vnode_t **vpp); \
+ int (*femop_realvp)(femarg_t *vf, vnode_t **vpp, \
+ caller_context_t *ct); \
int (*femop_getpage)(femarg_t *vf, offset_t off, size_t len, \
uint_t *protp, struct page **plarr, \
size_t plsz, struct seg *seg, caddr_t addr, \
- enum seg_rw rw, cred_t *cr); \
+ enum seg_rw rw, cred_t *cr, \
+ caller_context_t *ct); \
int (*femop_putpage)(femarg_t *vf, offset_t off, size_t len, \
- int flags, cred_t *cr); \
+ int flags, cred_t *cr, caller_context_t *ct); \
int (*femop_map)(femarg_t *vf, offset_t off, struct as *as, \
caddr_t *addrp, size_t len, uchar_t prot, \
- uchar_t maxprot, uint_t flags, cred_t *cr); \
+ uchar_t maxprot, uint_t flags, cred_t *cr, \
+ caller_context_t *ct); \
int (*femop_addmap)(femarg_t *vf, offset_t off, struct as *as, \
caddr_t addr, size_t len, uchar_t prot, \
- uchar_t maxprot, uint_t flags, cred_t *cr); \
+ uchar_t maxprot, uint_t flags, cred_t *cr, \
+ caller_context_t *ct); \
int (*femop_delmap)(femarg_t *vf, offset_t off, struct as *as, \
caddr_t addr, size_t len, uint_t prot, \
- uint_t maxprot, uint_t flags, cred_t *cr); \
+ uint_t maxprot, uint_t flags, cred_t *cr, \
+ caller_context_t *ct); \
int (*femop_poll)(femarg_t *vf, short events, int anyyet, \
- short *reventsp, struct pollhead **phpp); \
+ short *reventsp, struct pollhead **phpp, \
+ caller_context_t *ct); \
int (*femop_dump)(femarg_t *vf, caddr_t addr, int lbdn, \
- int dblks); \
+ int dblks, caller_context_t *ct); \
int (*femop_pathconf)(femarg_t *vf, int cmd, ulong_t *valp, \
- cred_t *cr); \
+ cred_t *cr, caller_context_t *ct); \
int (*femop_pageio)(femarg_t *vf, struct page *pp, \
u_offset_t io_off, size_t io_len, int flags, \
- cred_t *cr); \
- int (*femop_dumpctl)(femarg_t *vf, int action, int *blkp); \
+ cred_t *cr, caller_context_t *ct); \
+ int (*femop_dumpctl)(femarg_t *vf, int action, int *blkp, \
+ caller_context_t *ct); \
void (*femop_dispose)(femarg_t *vf, struct page *pp, int flag, \
- int dn, cred_t *cr); \
+ int dn, cred_t *cr, caller_context_t *ct); \
int (*femop_setsecattr)(femarg_t *vf, vsecattr_t *vsap, \
- int flag, cred_t *cr); \
+ int flag, cred_t *cr, caller_context_t *ct); \
int (*femop_getsecattr)(femarg_t *vf, vsecattr_t *vsap, \
- int flag, cred_t *cr); \
+ int flag, cred_t *cr, caller_context_t *ct); \
int (*femop_shrlock)(femarg_t *vf, int cmd, \
- struct shrlock *shr, int flag, cred_t *cr); \
+ struct shrlock *shr, int flag, cred_t *cr, \
+ caller_context_t *ct); \
int (*femop_vnevent)(femarg_t *vf, vnevent_t vnevent, \
- vnode_t *dvp, char *cname)
+ vnode_t *dvp, char *cname, caller_context_t *ct)
/* NB: No ";" */
struct fem {
@@ -267,83 +293,105 @@ struct fsem {
FSEM_OPS; /* Signatures of all FSEM operations (fsemops) */
};
-extern int vnext_open(femarg_t *vf, int mode, cred_t *cr);
+extern int vnext_open(femarg_t *vf, int mode, cred_t *cr,
+ caller_context_t *ct);
extern int vnext_close(femarg_t *vf, int flag, int count, offset_t offset,
- cred_t *cr);
+ cred_t *cr, caller_context_t *ct);
extern int vnext_read(femarg_t *vf, uio_t *uiop, int ioflag, cred_t *cr,
- struct caller_context *ct);
+ caller_context_t *ct);
extern int vnext_write(femarg_t *vf, uio_t *uiop, int ioflag, cred_t *cr,
- struct caller_context *ct);
+ caller_context_t *ct);
extern int vnext_ioctl(femarg_t *vf, int cmd, intptr_t arg, int flag,
- cred_t *cr, int *rvalp);
-extern int vnext_setfl(femarg_t *vf, int oflags, int nflags, cred_t *cr);
-extern int vnext_getattr(femarg_t *vf, vattr_t *vap, int flags, cred_t *cr);
+ cred_t *cr, int *rvalp, caller_context_t *ct);
+extern int vnext_setfl(femarg_t *vf, int oflags, int nflags, cred_t *cr,
+ caller_context_t *ct);
+extern int vnext_getattr(femarg_t *vf, vattr_t *vap, int flags, cred_t *cr,
+ caller_context_t *ct);
extern int vnext_setattr(femarg_t *vf, vattr_t *vap, int flags, cred_t *cr,
caller_context_t *ct);
-extern int vnext_access(femarg_t *vf, int mode, int flags, cred_t *cr);
+extern int vnext_access(femarg_t *vf, int mode, int flags, cred_t *cr,
+ caller_context_t *ct);
extern int vnext_lookup(femarg_t *vf, char *nm, vnode_t **vpp,
pathname_t *pnp, int flags, vnode_t *rdir,
- cred_t *cr);
+ cred_t *cr, caller_context_t *ct,
+ int *direntflags, pathname_t *realpnp);
extern int vnext_create(femarg_t *vf, char *name, vattr_t *vap,
vcexcl_t excl, int mode, vnode_t **vpp, cred_t *cr,
- int flag);
-extern int vnext_remove(femarg_t *vf, char *nm, cred_t *cr);
-extern int vnext_link(femarg_t *vf, vnode_t *svp, char *tnm, cred_t *cr);
+ int flag, caller_context_t *ct, vsecattr_t *vsecp);
+extern int vnext_remove(femarg_t *vf, char *nm, cred_t *cr,
+ caller_context_t *ct, int flags);
+extern int vnext_link(femarg_t *vf, vnode_t *svp, char *tnm, cred_t *cr,
+ caller_context_t *ct, int flags);
extern int vnext_rename(femarg_t *vf, char *snm, vnode_t *tdvp, char *tnm,
- cred_t *cr);
+ cred_t *cr, caller_context_t *ct, int flags);
extern int vnext_mkdir(femarg_t *vf, char *dirname, vattr_t *vap,
- vnode_t **vpp, cred_t *cr);
-extern int vnext_rmdir(femarg_t *vf, char *nm, vnode_t *cdir, cred_t *cr);
-extern int vnext_readdir(femarg_t *vf, uio_t *uiop, cred_t *cr, int *eofp);
+ vnode_t **vpp, cred_t *cr, caller_context_t *ct,
+ int flags, vsecattr_t *vsecp);
+extern int vnext_rmdir(femarg_t *vf, char *nm, vnode_t *cdir, cred_t *cr,
+ caller_context_t *ct, int flags);
+extern int vnext_readdir(femarg_t *vf, uio_t *uiop, cred_t *cr, int *eofp,
+ caller_context_t *ct, int flags);
extern int vnext_symlink(femarg_t *vf, char *linkname, vattr_t *vap,
- char *target, cred_t *cr);
-extern int vnext_readlink(femarg_t *vf, uio_t *uiop, cred_t *cr);
-extern int vnext_fsync(femarg_t *vf, int syncflag, cred_t *cr);
-extern void vnext_inactive(femarg_t *vf, cred_t *cr);
-extern int vnext_fid(femarg_t *vf, fid_t *fidp);
+ char *target, cred_t *cr, caller_context_t *ct,
+ int flags);
+extern int vnext_readlink(femarg_t *vf, uio_t *uiop, cred_t *cr,
+ caller_context_t *ct);
+extern int vnext_fsync(femarg_t *vf, int syncflag, cred_t *cr,
+ caller_context_t *ct);
+extern void vnext_inactive(femarg_t *vf, cred_t *cr, caller_context_t *ct);
+extern int vnext_fid(femarg_t *vf, fid_t *fidp, caller_context_t *ct);
extern int vnext_rwlock(femarg_t *vf, int write_lock, caller_context_t *ct);
extern void vnext_rwunlock(femarg_t *vf, int write_lock, caller_context_t *ct);
-extern int vnext_seek(femarg_t *vf, offset_t ooff, offset_t *noffp);
-extern int vnext_cmp(femarg_t *vf, vnode_t *vp2);
+extern int vnext_seek(femarg_t *vf, offset_t ooff, offset_t *noffp,
+ caller_context_t *ct);
+extern int vnext_cmp(femarg_t *vf, vnode_t *vp2, caller_context_t *ct);
extern int vnext_frlock(femarg_t *vf, int cmd, struct flock64 *bfp,
int flag, offset_t offset,
- struct flk_callback *flk_cbp, cred_t *cr);
+ struct flk_callback *flk_cbp, cred_t *cr,
+ caller_context_t *ct);
extern int vnext_space(femarg_t *vf, int cmd, struct flock64 *bfp,
int flag, offset_t offset, cred_t *cr,
caller_context_t *ct);
-extern int vnext_realvp(femarg_t *vf, vnode_t **vpp);
+extern int vnext_realvp(femarg_t *vf, vnode_t **vpp, caller_context_t *ct);
extern int vnext_getpage(femarg_t *vf, offset_t off, size_t len,
uint_t *protp, struct page **plarr, size_t plsz,
struct seg *seg, caddr_t addr, enum seg_rw rw,
- cred_t *cr);
+ cred_t *cr, caller_context_t *ct);
extern int vnext_putpage(femarg_t *vf, offset_t off, size_t len, int flags,
- cred_t *cr);
+ cred_t *cr, caller_context_t *ct);
extern int vnext_map(femarg_t *vf, offset_t off, struct as *as,
caddr_t *addrp, size_t len, uchar_t prot, uchar_t maxprot,
- uint_t flags, cred_t *cr);
+ uint_t flags, cred_t *cr, caller_context_t *ct);
extern int vnext_addmap(femarg_t *vf, offset_t off, struct as *as,
caddr_t addr, size_t len, uchar_t prot,
- uchar_t maxprot, uint_t flags, cred_t *cr);
+ uchar_t maxprot, uint_t flags, cred_t *cr,
+ caller_context_t *ct);
extern int vnext_delmap(femarg_t *vf, offset_t off, struct as *as,
caddr_t addr, size_t len, uint_t prot,
- uint_t maxprot, uint_t flags, cred_t *cr);
+ uint_t maxprot, uint_t flags, cred_t *cr,
+ caller_context_t *ct);
extern int vnext_poll(femarg_t *vf, short events, int anyyet,
- short *reventsp, struct pollhead **phpp);
-extern int vnext_dump(femarg_t *vf, caddr_t addr, int lbdn, int dblks);
-extern int vnext_pathconf(femarg_t *vf, int cmd, ulong_t *valp, cred_t *cr);
+ short *reventsp, struct pollhead **phpp,
+ caller_context_t *ct);
+extern int vnext_dump(femarg_t *vf, caddr_t addr, int lbdn, int dblks,
+ caller_context_t *ct);
+extern int vnext_pathconf(femarg_t *vf, int cmd, ulong_t *valp, cred_t *cr,
+ caller_context_t *ct);
extern int vnext_pageio(femarg_t *vf, struct page *pp, u_offset_t io_off,
- size_t io_len, int flags, cred_t *cr);
-extern int vnext_dumpctl(femarg_t *vf, int action, int *blkp);
+ size_t io_len, int flags, cred_t *cr,
+ caller_context_t *ct);
+extern int vnext_dumpctl(femarg_t *vf, int action, int *blkp,
+ caller_context_t *ct);
extern void vnext_dispose(femarg_t *vf, struct page *pp, int flag, int dn,
- cred_t *cr);
+ cred_t *cr, caller_context_t *ct);
extern int vnext_setsecattr(femarg_t *vf, vsecattr_t *vsap, int flag,
- cred_t *cr);
+ cred_t *cr, caller_context_t *ct);
extern int vnext_getsecattr(femarg_t *vf, vsecattr_t *vsap, int flag,
- cred_t *cr);
+ cred_t *cr, caller_context_t *ct);
extern int vnext_shrlock(femarg_t *vf, int cmd, struct shrlock *shr,
- int flag, cred_t *cr);
+ int flag, cred_t *cr, caller_context_t *ct);
extern int vnext_vnevent(femarg_t *vf, vnevent_t vevent, vnode_t *dvp,
- char *cname);
+ char *cname, caller_context_t *ct);
extern int vfsnext_mount(fsemarg_t *vf, vnode_t *mvp, struct mounta *uap,
cred_t *cr);
diff --git a/usr/src/uts/common/sys/file.h b/usr/src/uts/common/sys/file.h
index e893696564..01af00ddb2 100644
--- a/usr/src/uts/common/sys/file.h
+++ b/usr/src/uts/common/sys/file.h
@@ -89,10 +89,6 @@ typedef struct fpollinfo {
#define FREVOKED 0x20 /* C2 Security - Revoke Subsystem */
#endif
#define FDSYNC 0x40 /* file data only integrity while writing */
-#define FRSYNC 0x8000 /* sync read operations at same level of */
- /* integrity as specified for writes by */
- /* FSYNC and FDSYNC flags */
-#define FOFFMAX 0x2000 /* large file */
#define FNONBLOCK 0x80
#define FMASK 0xa0ff /* all flags that can be changed by F_SETFL */
@@ -102,14 +98,20 @@ typedef struct fpollinfo {
#define FCREAT 0x0100
#define FTRUNC 0x0200
#define FEXCL 0x0400
-#define FNOCTTY 0x0800
+#define FASYNC 0x1000 /* asyncio in progress pseudo flag */
+#define FOFFMAX 0x2000 /* large file */
#define FXATTR 0x4000 /* open as extended attribute */
+#define FNOCTTY 0x0800
+#define FRSYNC 0x8000 /* sync read operations at same level of */
+ /* integrity as specified for writes by */
+ /* FSYNC and FDSYNC flags */
-#define FASYNC 0x1000 /* asyncio in progress pseudo flag */
#define FNODSYNC 0x10000 /* fsync pseudo flag */
#define FNOFOLLOW 0x20000 /* don't follow symlinks */
#define FNOLINKS 0x40000 /* don't allow multiple hard links */
+#define FIGNORECASE 0x80000 /* request case-insensitive lookups */
+#define FXATTRDIROPEN 0x100000 /* only opening hidden attribute directory */
#ifdef _KERNEL
diff --git a/usr/src/uts/common/sys/fs/fifonode.h b/usr/src/uts/common/sys/fs/fifonode.h
index ddd64ab0a3..5ef83b4778 100644
--- a/usr/src/uts/common/sys/fs/fifonode.h
+++ b/usr/src/uts/common/sys/fs/fifonode.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -123,8 +123,8 @@ typedef struct fifodata {
#define FIFOPOLLR 0x1000 /* process waiting on poll read */
#define FIFOISOPEN 0x2000 /* pipe is open */
#define FIFOSYNC 0x4000 /* FIFO is waiting for open sync */
-#define FIFOWOCR 0x8000 /* Write open occured */
-#define FIFOROCR 0x10000 /* Read open occured */
+#define FIFOWOCR 0x8000 /* Write open occurred */
+#define FIFOROCR 0x10000 /* Read open occurred */
/*
* process waiting on poll read on band data
* this can only occur if we go to streams
@@ -165,8 +165,9 @@ struct queue;
extern int fifoinit(int, char *);
extern int fifo_stropen(vnode_t **, int, cred_t *, int, int);
-extern int fifo_open(vnode_t **, int, cred_t *);
-extern int fifo_close(vnode_t *, int, int, offset_t, cred_t *);
+extern int fifo_open(vnode_t **, int, cred_t *, caller_context_t *);
+extern int fifo_close(vnode_t *, int, int, offset_t, cred_t *,
+ caller_context_t *);
extern void fifo_cleanup(vnode_t *, int);
extern void fiforemove(fifonode_t *);
extern ino_t fifogetid(void);
diff --git a/usr/src/uts/common/sys/fs/pc_node.h b/usr/src/uts/common/sys/fs/pc_node.h
index 72e96d579b..1e8921c6c1 100644
--- a/usr/src/uts/common/sys/fs/pc_node.h
+++ b/usr/src/uts/common/sys/fs/pc_node.h
@@ -129,8 +129,10 @@ extern void pc_mark_irrecov(struct pcfs *);
extern int pc_dirlook(struct pcnode *, char *, struct pcnode **);
extern int pc_direnter(struct pcnode *, char *, struct vattr *,
struct pcnode **);
-extern int pc_dirremove(struct pcnode *, char *, struct vnode *, enum vtype);
-extern int pc_rename(struct pcnode *, struct pcnode *, char *, char *);
+extern int pc_dirremove(struct pcnode *, char *, struct vnode *, enum vtype,
+ caller_context_t *);
+extern int pc_rename(struct pcnode *, struct pcnode *, char *, char *,
+ caller_context_t *);
extern int pc_blkatoff(struct pcnode *, offset_t, struct buf **,
struct pcdir **);
extern int pc_truncate(struct pcnode *, uint_t);
diff --git a/usr/src/uts/common/sys/fs/snode.h b/usr/src/uts/common/sys/fs/snode.h
index cd572d545c..d0176af293 100644
--- a/usr/src/uts/common/sys/fs/snode.h
+++ b/usr/src/uts/common/sys/fs/snode.h
@@ -162,7 +162,8 @@ void sdelete(struct snode *);
void smark(struct snode *, int);
int specinit(int, char *);
int device_close(struct vnode *, int, struct cred *);
-int spec_putpage(struct vnode *, offset_t, size_t, int, struct cred *);
+int spec_putpage(struct vnode *, offset_t, size_t, int, struct cred *,
+ caller_context_t *);
int spec_segmap(dev_t, off_t, struct as *, caddr_t *, off_t,
uint_t, uint_t, uint_t, cred_t *);
struct vnode *specvp_devfs(struct vnode *, dev_t, vtype_t,
diff --git a/usr/src/uts/common/sys/fs/tmp.h b/usr/src/uts/common/sys/fs/tmp.h
index 583eaab18c..68dd67c61e 100644
--- a/usr/src/uts/common/sys/fs/tmp.h
+++ b/usr/src/uts/common/sys/fs/tmp.h
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 1989-1991, 1996-1999, 2001-2003 Sun Microsystems, Inc.
+ * Copyright 2007 Sun Microsystems, Inc.
* All rights reserved. Use is subject to license terms.
*/
@@ -111,7 +110,7 @@ extern int tmp_sticky_remove_access(struct tmpnode *, struct tmpnode *,
extern int tmp_convnum(char *, pgcnt_t *);
extern int tdirenter(struct tmount *, struct tmpnode *, char *,
enum de_op, struct tmpnode *, struct tmpnode *, struct vattr *,
- struct tmpnode **, struct cred *);
+ struct tmpnode **, struct cred *, caller_context_t *);
#define TMP_MUSTHAVE 0x01
diff --git a/usr/src/uts/common/sys/fs/udf_inode.h b/usr/src/uts/common/sys/fs/udf_inode.h
index 6a2b3e83e1..dd68124bca 100644
--- a/usr/src/uts/common/sys/fs/udf_inode.h
+++ b/usr/src/uts/common/sys/fs/udf_inode.h
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -709,10 +708,10 @@ int32_t ud_dirlook(struct ud_inode *,
char *, struct ud_inode **, struct cred *, int32_t);
int32_t ud_direnter(struct ud_inode *, char *, enum de_op,
struct ud_inode *, struct ud_inode *, struct vattr *,
- struct ud_inode **, struct cred *);
+ struct ud_inode **, struct cred *, caller_context_t *);
int32_t ud_dirremove(struct ud_inode *,
char *, struct ud_inode *, struct vnode *,
- enum dr_op, struct cred *);
+ enum dr_op, struct cred *, caller_context_t *);
/*
diff --git a/usr/src/uts/common/sys/fs/zfs.h b/usr/src/uts/common/sys/fs/zfs.h
index 8babbef0d1..1250b18c4e 100644
--- a/usr/src/uts/common/sys/fs/zfs.h
+++ b/usr/src/uts/common/sys/fs/zfs.h
@@ -92,6 +92,12 @@ typedef enum {
ZFS_PROP_NUMCLONES, /* not exposed to the user */
ZFS_PROP_COPIES,
ZFS_PROP_VERSION,
+ ZFS_PROP_UTF8ONLY,
+ ZFS_PROP_NORMALIZE,
+ ZFS_PROP_CASE,
+ ZFS_PROP_VSCAN,
+ ZFS_PROP_NBMAND,
+ ZFS_PROP_SHARESMB,
ZFS_NUM_PROPS
} zfs_prop_t;
@@ -144,11 +150,13 @@ const char *zfs_prop_default_string(zfs_prop_t);
uint64_t zfs_prop_default_numeric(zfs_prop_t);
boolean_t zfs_prop_readonly(zfs_prop_t);
boolean_t zfs_prop_inheritable(zfs_prop_t);
+boolean_t zfs_prop_setonce(zfs_prop_t);
const char *zfs_prop_to_name(zfs_prop_t);
zfs_prop_t zfs_name_to_prop(const char *);
boolean_t zfs_prop_user(const char *);
int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **);
int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *);
+int zfs_prop_valid_for_type(int, zfs_type_t);
/*
* Pool property functions shared between libzfs and kernel.
@@ -190,6 +198,13 @@ typedef enum {
#define ZFS_DELEG_PERM_GID "gid"
#define ZFS_DELEG_PERM_GROUPS "groups"
+typedef enum zfs_share_op {
+ ZFS_SHARE_NFS = 0,
+ ZFS_UNSHARE_NFS = 1,
+ ZFS_SHARE_SMB = 2,
+ ZFS_UNSHARE_SMB = 3
+} zfs_share_op_t;
+
/*
* On-disk version number.
*/
@@ -201,13 +216,15 @@ typedef enum {
#define SPA_VERSION_6 6ULL
#define SPA_VERSION_7 7ULL
#define SPA_VERSION_8 8ULL
+#define SPA_VERSION_9 9ULL
+
/*
* When bumping up SPA_VERSION, make sure GRUB ZFS understand the on-disk
* format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*},
* and do the appropriate changes.
*/
-#define SPA_VERSION SPA_VERSION_8
-#define SPA_VERSION_STRING "8"
+#define SPA_VERSION SPA_VERSION_9
+#define SPA_VERSION_STRING "9"
/*
* Symbolic names for the changes that caused a SPA_VERSION switch.
@@ -232,6 +249,8 @@ typedef enum {
#define SPA_VERSION_BOOTFS SPA_VERSION_6
#define SPA_VERSION_SLOGS SPA_VERSION_7
#define SPA_VERSION_DELEGATED_PERMS SPA_VERSION_8
+#define SPA_VERSION_FUID SPA_VERSION_9
+#define SPA_VERSION_NORMALIZATION SPA_VERSION_9
/*
* ZPL version - rev'd whenever an incompatible on-disk format change
@@ -243,11 +262,14 @@ typedef enum {
*/
#define ZPL_VERSION_1 1ULL
#define ZPL_VERSION_2 2ULL
-#define ZPL_VERSION ZPL_VERSION_2
-#define ZPL_VERSION_STRING "2"
+#define ZPL_VERSION_3 3ULL
+#define ZPL_VERSION ZPL_VERSION_3
+#define ZPL_VERSION_STRING "3"
#define ZPL_VERSION_INITIAL ZPL_VERSION_1
#define ZPL_VERSION_DIRENT_TYPE ZPL_VERSION_2
+#define ZPL_VERSION_FUID ZPL_VERSION_3
+#define ZPL_VERSION_SYSATTR ZPL_VERSION_3
/*
* The following are configuration names used in the nvlist describing a pool's
diff --git a/usr/src/uts/common/sys/gfs.h b/usr/src/uts/common/sys/gfs.h
index ce21cbe525..b53031086b 100644
--- a/usr/src/uts/common/sys/gfs.h
+++ b/usr/src/uts/common/sys/gfs.h
@@ -76,7 +76,8 @@ typedef struct gfs_file {
typedef int (*gfs_readdir_cb)(vnode_t *, struct dirent64 *, int *, offset_t *,
offset_t *, void *);
-typedef int (*gfs_lookup_cb)(vnode_t *, const char *, vnode_t **, ino64_t *);
+typedef int (*gfs_lookup_cb)(vnode_t *, const char *, vnode_t **, ino64_t *,
+ cred_t *);
typedef ino64_t (*gfs_inode_cb)(vnode_t *, int);
typedef struct gfs_dir {
@@ -103,8 +104,9 @@ extern vnode_t *gfs_root_create_file(size_t, struct vfs *, vnodeops_t *,
extern void *gfs_file_inactive(vnode_t *);
extern void *gfs_dir_inactive(vnode_t *);
-extern int gfs_dir_lookup(vnode_t *, const char *, vnode_t **);
-extern int gfs_dir_readdir(vnode_t *, uio_t *, int *, void *);
+extern int gfs_dir_lookup(vnode_t *, const char *, vnode_t **, cred_t *);
+extern int gfs_dir_readdir(vnode_t *, uio_t *, int *, void *, cred_t *,
+ caller_context_t *);
#define gfs_dir_lock(gd) mutex_enter(&(gd)->gfsd_lock)
#define gfs_dir_unlock(gd) mutex_exit(&(gd)->gfsd_lock)
@@ -137,14 +139,22 @@ extern int gfs_readdir_emitn(gfs_readdir_state_t *, uio_t *, offset_t, ino64_t,
extern int gfs_readdir_pred(gfs_readdir_state_t *, uio_t *, offset_t *);
extern int gfs_readdir_fini(gfs_readdir_state_t *, int, int *, int);
+/*
+ * Objects with real extended attributes will get their . and ..
+ * readdir entries from the real xattr directory. GFS_STATIC_ENTRY_OFFSET
+ * lets us skip right to the static entries in the GFS directory.
+ */
+#define GFS_STATIC_ENTRY_OFFSET ((offset_t)2)
+
extern int gfs_lookup_dot(vnode_t **, vnode_t *, vnode_t *, const char *);
extern int gfs_vop_lookup(vnode_t *, char *, vnode_t **, pathname_t *,
- int, vnode_t *, cred_t *);
-extern int gfs_vop_readdir(vnode_t *, uio_t *, cred_t *, int *);
+ int, vnode_t *, cred_t *, caller_context_t *, int *, pathname_t *);
+extern int gfs_vop_readdir(vnode_t *, uio_t *, cred_t *, int *,
+ caller_context_t *, int);
extern int gfs_vop_map(vnode_t *, offset_t, struct as *, caddr_t *,
- size_t, uchar_t, uchar_t, uint_t, cred_t *);
-extern void gfs_vop_inactive(vnode_t *, cred_t *);
+ size_t, uchar_t, uchar_t, uint_t, cred_t *, caller_context_t *);
+extern void gfs_vop_inactive(vnode_t *, cred_t *, caller_context_t *);
#ifdef __cplusplus
diff --git a/usr/src/uts/common/sys/modctl.h b/usr/src/uts/common/sys/modctl.h
index 3477a11cb6..818572a94d 100644
--- a/usr/src/uts/common/sys/modctl.h
+++ b/usr/src/uts/common/sys/modctl.h
@@ -109,7 +109,7 @@ struct modlsys {
struct modlfs {
struct mod_ops *fs_modops;
char *fs_linkinfo;
- struct vfsdef_v3 *fs_vfsdef; /* version may actually vary */
+ struct vfsdef_v4 *fs_vfsdef; /* version may actually vary */
};
#if defined(__i386) || defined(__amd64)
diff --git a/usr/src/uts/common/sys/nbmlock.h b/usr/src/uts/common/sys/nbmlock.h
index 98211d7b70..e5215cc9ee 100644
--- a/usr/src/uts/common/sys/nbmlock.h
+++ b/usr/src/uts/common/sys/nbmlock.h
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,8 +19,8 @@
* CDDL HEADER END
*/
/*
- * Copyright (c) 2001 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#ifndef _NBMLOCK_H
@@ -57,9 +56,11 @@ extern int nbl_in_crit(vnode_t *);
/* conflict checking */
extern int nbl_need_check(vnode_t *);
-extern int nbl_conflict(vnode_t *, nbl_op_t, u_offset_t, ssize_t, int);
-extern int nbl_share_conflict(vnode_t *, nbl_op_t);
-extern int nbl_lock_conflict(vnode_t *, nbl_op_t, u_offset_t, ssize_t, int);
+extern int nbl_conflict(vnode_t *, nbl_op_t, u_offset_t, ssize_t, int,
+ caller_context_t *);
+extern int nbl_share_conflict(vnode_t *, nbl_op_t, caller_context_t *);
+extern int nbl_lock_conflict(vnode_t *, nbl_op_t, u_offset_t, ssize_t, int,
+ caller_context_t *);
extern int nbl_svmand(vnode_t *, cred_t *, int *);
extern nbl_op_t nbl_lock_to_op(int);
diff --git a/usr/src/uts/common/sys/objfs_impl.h b/usr/src/uts/common/sys/objfs_impl.h
index df60a8af95..687db9edec 100644
--- a/usr/src/uts/common/sys/objfs_impl.h
+++ b/usr/src/uts/common/sys/objfs_impl.h
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -49,9 +48,11 @@ typedef struct objfs_vfs {
/*
* Common vop_ entry points
*/
-extern int objfs_dir_open(vnode_t **, int, cred_t *);
-extern int objfs_dir_access(vnode_t *, int, int, cred_t *);
-extern int objfs_common_close(vnode_t *, int, int, offset_t, cred_t *);
+extern int objfs_dir_open(vnode_t **, int, cred_t *, caller_context_t *);
+extern int objfs_dir_access(vnode_t *, int, int, cred_t *,
+ caller_context_t *);
+extern int objfs_common_close(vnode_t *, int, int, offset_t, cred_t *,
+ caller_context_t *);
/*
* Common vop_ support functions
diff --git a/usr/src/uts/common/sys/policy.h b/usr/src/uts/common/sys/policy.h
index c132402d3b..2949605b9e 100644
--- a/usr/src/uts/common/sys/policy.h
+++ b/usr/src/uts/common/sys/policy.h
@@ -129,6 +129,7 @@ int secpolicy_rpcmod_open(const cred_t *);
int secpolicy_rsm_access(const cred_t *, uid_t, mode_t);
int secpolicy_setpriority(const cred_t *);
int secpolicy_settime(const cred_t *);
+int secpolicy_smb(const cred_t *);
int secpolicy_spec_open(const cred_t *, struct vnode *, int);
int secpolicy_sti(const cred_t *);
int secpolicy_swapctl(const cred_t *);
@@ -154,6 +155,7 @@ void secpolicy_setid_clear(vattr_t *, cred_t *);
void secpolicy_fs_mount_clearopts(cred_t *, struct vfs *);
int secpolicy_setid_setsticky_clear(vnode_t *, vattr_t *,
const vattr_t *, cred_t *);
+int secpolicy_xvattr(xvattr_t *, uid_t, cred_t *, vtype_t);
int secpolicy_basic_exec(const cred_t *);
int secpolicy_basic_fork(const cred_t *);
diff --git a/usr/src/uts/common/sys/sid.h b/usr/src/uts/common/sys/sid.h
index 9d68191eb6..96b9f5a0b8 100644
--- a/usr/src/uts/common/sys/sid.h
+++ b/usr/src/uts/common/sys/sid.h
@@ -52,6 +52,8 @@ extern "C" {
#define SIDSYS_ID2SID 1
#ifdef _KERNEL
+#define KSIDLIST_MEM(n) (sizeof (ksidlist_t) + ((n) - 1) * sizeof (ksid_t))
+
/* Domains are stored in AVL trees so we can share them among SIDs */
typedef struct ksiddomain {
uint_t kd_ref;
diff --git a/usr/src/uts/common/sys/socketvar.h b/usr/src/uts/common/sys/socketvar.h
index 1863d2ea01..0680546ade 100644
--- a/usr/src/uts/common/sys/socketvar.h
+++ b/usr/src/uts/common/sys/socketvar.h
@@ -262,7 +262,7 @@ struct sonode {
* but one of the key reasons for their existence and careful
* tracking in sockfs is to support getsockname and getpeername
* when the transport does not handle the TI_GET*NAME ioctls
- * and caching when it does (signalled by valid bits in so_state).
+ * and caching when it does (signaled by valid bits in so_state).
* When all transports support the new TPI (with T_ADDR_REQ)
* we can revisit this code.
* The other usage of so_faddr is to keep the "connected to"
@@ -704,7 +704,8 @@ extern int sock_putmsg(vnode_t *, struct strbuf *, struct strbuf *,
uchar_t, int, int);
struct sonode *sotpi_create(vnode_t *, int, int, int, int, struct sonode *,
int *);
-extern int socktpi_open(struct vnode **, int, struct cred *);
+extern int socktpi_open(struct vnode **, int, struct cred *,
+ caller_context_t *);
extern int so_sock2stream(struct sonode *);
extern void so_stream2sock(struct sonode *);
extern int sockinit(int, char *);
@@ -783,7 +784,7 @@ extern int sotpi_getsockopt(struct sonode *, int, int, void *,
extern int sotpi_setsockopt(struct sonode *, int, int, const void *,
socklen_t);
extern int socktpi_ioctl(struct vnode *, int, intptr_t, int,
- struct cred *, int *);
+ struct cred *, int *, caller_context_t *);
extern int sodisconnect(struct sonode *, t_scalar_t, int);
extern ssize_t soreadfile(file_t *, uchar_t *, u_offset_t, int *, size_t);
extern int so_set_asyncsigs(vnode_t *, pid_t, int, int, cred_t *);
@@ -795,7 +796,7 @@ extern void sock_kstat_fini(zoneid_t, void *);
extern struct sonode *getsonode(int, int *, file_t **);
/*
- * Function wrappers (mostly arround the sonode switch) for
+ * Function wrappers (mostly around the sonode switch) for
* backward compatibility.
*/
extern int soaccept(struct sonode *, int, struct sonode **);
@@ -820,15 +821,19 @@ extern struct sonode *socreate(vnode_t *, int, int, int, int,
extern int so_copyin(const void *, void *, size_t, int);
extern int so_copyout(const void *, void *, size_t, int);
-extern int socktpi_access(struct vnode *, int, int, struct cred *);
-extern int socktpi_fid(struct vnode *, struct fid *);
-extern int socktpi_fsync(struct vnode *, int, struct cred *);
+extern int socktpi_access(struct vnode *, int, int, struct cred *,
+ caller_context_t *);
+extern int socktpi_fid(struct vnode *, struct fid *, caller_context_t *);
+extern int socktpi_fsync(struct vnode *, int, struct cred *,
+ caller_context_t *);
extern int socktpi_getattr(struct vnode *, struct vattr *, int,
- struct cred *);
-extern int socktpi_seek(struct vnode *, offset_t, offset_t *);
+ struct cred *, caller_context_t *);
+extern int socktpi_seek(struct vnode *, offset_t, offset_t *,
+ caller_context_t *);
extern int socktpi_setattr(struct vnode *, struct vattr *, int,
struct cred *, caller_context_t *);
-extern int socktpi_setfl(vnode_t *, int, int, cred_t *);
+extern int socktpi_setfl(vnode_t *, int, int, cred_t *,
+ caller_context_t *);
/* SCTP sockfs */
extern struct sonode *sosctp_create(vnode_t *, int, int, int, int,
diff --git a/usr/src/uts/common/sys/tzfile.h b/usr/src/uts/common/sys/tzfile.h
new file mode 100644
index 0000000000..8f451f27d9
--- /dev/null
+++ b/usr/src/uts/common/sys/tzfile.h
@@ -0,0 +1,166 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (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
+ * or http://www.opensolaris.org/os/licensing.
+ * 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 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * from Arthur Olson's 6.1
+ */
+
+#ifndef _SYS_TZFILE_H
+#define _SYS_TZFILE_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Information about time zone files.
+ */
+
+#define TZDIR "/usr/share/lib/zoneinfo" /* Time zone object file directory */
+
+#define TZDEFAULT (getenv("TZ"))
+
+#define TZDEFRULES "posixrules"
+
+/*
+ * Each file begins with. . .
+ */
+
+struct tzhead {
+ char tzh_reserved[24]; /* reserved for future use */
+ char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
+ char tzh_leapcnt[4]; /* coded number of leap seconds */
+ char tzh_timecnt[4]; /* coded number of transition times */
+ char tzh_typecnt[4]; /* coded number of local time types */
+ char tzh_charcnt[4]; /* coded number of abbr. chars */
+};
+
+/*
+ * . . .followed by. . .
+ *
+ * tzh_timecnt (char [4])s coded transition times a la time(2)
+ * tzh_timecnt (unsigned char)s types of local time starting at above
+ * tzh_typecnt repetitions of
+ * one (char [4]) coded GMT offset in seconds
+ * one (unsigned char) used to set tm_isdst
+ * one (unsigned char) that's an abbreviation list index
+ * tzh_charcnt (char)s '\0'-terminated zone abbreviations
+ * tzh_leapcnt repetitions of
+ * one (char [4]) coded leap second transition times
+ * one (char [4]) total correction after above
+ * tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
+ * time is standard time, if FALSE,
+ * transition time is wall clock time
+ * if absent, transition times are
+ * assumed to be wall clock time
+ */
+
+/*
+ * In the current implementation, "tzset()" refuses to deal with files that
+ * exceed any of the limits below.
+ */
+
+/*
+ * The TZ_MAX_TIMES value below is enough to handle a bit more than a
+ * year's worth of solar time (corrected daily to the nearest second) or
+ * 138 years of Pacific Presidential Election time
+ * (where there are three time zone transitions every fourth year).
+ */
+#define TZ_MAX_TIMES 370
+
+#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
+
+#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
+
+#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
+
+#define SECSPERMIN 60
+#define MINSPERHOUR 60
+#define HOURSPERDAY 24
+#define DAYSPERWEEK 7
+#define DAYSPERNYEAR 365
+#define DAYSPERLYEAR 366
+#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
+#define SECSPERDAY ((long)SECSPERHOUR * HOURSPERDAY)
+#define MONSPERYEAR 12
+
+#define TM_SUNDAY 0
+#define TM_MONDAY 1
+#define TM_TUESDAY 2
+#define TM_WEDNESDAY 3
+#define TM_THURSDAY 4
+#define TM_FRIDAY 5
+#define TM_SATURDAY 6
+
+#define TM_JANUARY 0
+#define TM_FEBRUARY 1
+#define TM_MARCH 2
+#define TM_APRIL 3
+#define TM_MAY 4
+#define TM_JUNE 5
+#define TM_JULY 6
+#define TM_AUGUST 7
+#define TM_SEPTEMBER 8
+#define TM_OCTOBER 9
+#define TM_NOVEMBER 10
+#define TM_DECEMBER 11
+
+#define TM_YEAR_BASE 1900
+
+#define EPOCH_YEAR 1970
+#define EPOCH_WDAY TM_THURSDAY
+
+/*
+ * Accurate only for the past couple of centuries;
+ * that will probably do.
+ */
+
+#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
+
+/*
+ * Use of the underscored variants may cause problems if you move your code to
+ * certain System-V-based systems; for maximum portability, use the
+ * underscore-free variants. The underscored variants are provided for
+ * backward compatibility only; they may disappear from future versions of
+ * this file.
+ */
+
+#define SECS_PER_MIN SECSPERMIN
+#define MINS_PER_HOUR MINSPERHOUR
+#define HOURS_PER_DAY HOURSPERDAY
+#define DAYS_PER_WEEK DAYSPERWEEK
+#define DAYS_PER_NYEAR DAYSPERNYEAR
+#define DAYS_PER_LYEAR DAYSPERLYEAR
+#define SECS_PER_HOUR SECSPERHOUR
+#define SECS_PER_DAY SECSPERDAY
+#define MONS_PER_YEAR MONSPERYEAR
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_TZFILE_H */
diff --git a/usr/src/uts/common/sys/unistd.h b/usr/src/uts/common/sys/unistd.h
index 7cfbb9744f..29e0476abd 100644
--- a/usr/src/uts/common/sys/unistd.h
+++ b/usr/src/uts/common/sys/unistd.h
@@ -310,6 +310,10 @@ extern "C" {
#define _PC_2_SYMLINKS 19
#define _PC_ACL_ENABLED 20
#define _PC_MIN_HOLE_SIZE 21
+#define _PC_CASE_BEHAVIOR 22
+#define _PC_SATTR_ENABLED 23
+#define _PC_SATTR_EXISTS 24
+
/*
* Large File Summit names
*
@@ -326,6 +330,12 @@ extern "C" {
#define _PC_XATTR_EXISTS 101
/*
+ * Case sensitivity values (related to _PC_CASE_BEHAVIOR)
+ */
+#define _CASE_SENSITIVE 0x1
+#define _CASE_INSENSITIVE 0x2
+
+/*
* The value of 0 is returned when
* ACL's are not supported
*/
diff --git a/usr/src/uts/common/sys/vfs.h b/usr/src/uts/common/sys/vfs.h
index 114ce97811..2b627cd344 100644
--- a/usr/src/uts/common/sys/vfs.h
+++ b/usr/src/uts/common/sys/vfs.h
@@ -175,6 +175,24 @@ extern avl_tree_t vskstat_tree;
extern kmutex_t vskstat_tree_lock;
/*
+ * Private vfs data, NOT to be used by a file system implementation.
+ */
+
+#define VFS_FEATURE_MAXSZ 4
+
+typedef struct vfs_impl {
+ /* Counted array - Bitmap of vfs features */
+ uint32_t vi_featureset[VFS_FEATURE_MAXSZ];
+ /*
+ * Support for statistics on the vnode operations
+ */
+ vsk_anchor_t *vi_vskap; /* anchor for vopstats' kstat */
+ vopstats_t *vi_fstypevsp; /* ptr to per-fstype vopstats */
+ vopstats_t vi_vopstats; /* per-mount vnode op stats */
+} vfs_impl_t;
+
+
+/*
* Structure per mounted file system. Each mounted file system has
* an array of operations and an instance record.
*
@@ -200,19 +218,6 @@ extern kmutex_t vskstat_tree_lock;
struct zone; /* from zone.h */
struct fem_head; /* from fem.h */
-/*
- * Private vfs data, NOT to be used by a file system implementation.
- */
-typedef struct vfs_impl {
- struct fem_head *vi_femhead; /* fs monitoring */
- /*
- * Support for statistics on the vnode operations
- */
- vsk_anchor_t *vi_vskap; /* anchor for vopstats' kstat */
- vopstats_t *vi_fstypevsp; /* ptr to per-fstype vopstats */
- vopstats_t vi_vopstats; /* per-mount vnode op stats */
-} vfs_impl_t;
-
typedef struct vfs {
struct vfs *vfs_next; /* next VFS in VFS list */
struct vfs *vfs_prev; /* prev VFS in VFS list */
@@ -246,9 +251,10 @@ typedef struct vfs {
struct zone *vfs_zone; /* zone that owns the mount */
struct vfs *vfs_zone_next; /* next VFS visible in zone */
struct vfs *vfs_zone_prev; /* prev VFS visible in zone */
+ struct fem_head *vfs_femhead; /* fs monitoring */
} vfs_t;
-#define vfs_femhead vfs_implp->vi_femhead
+#define vfs_featureset vfs_implp->vi_featureset
#define vfs_vskap vfs_implp->vi_vskap
#define vfs_fstypevsp vfs_implp->vi_fstypevsp
#define vfs_vopstats vfs_implp->vi_vopstats
@@ -275,6 +281,22 @@ typedef struct vfs {
#define VFS_NOMNTPT "unspecified_mountpoint"
/*
+ * VFS features are implemented as bits set in the vfs_t.
+ * The vfs_feature_t typedef is a 64-bit number that will translate
+ * into an element in an array of bitmaps and a bit in that element.
+ * Developers must not depend on the implementation of this and
+ * need to use vfs_has_feature()/vfs_set_feature() routines.
+ */
+typedef uint64_t vfs_feature_t;
+
+#define VFSFT_XVATTR 0x100000001 /* Supports xvattr for attrs */
+#define VFSFT_CASEINSENSITIVE 0x100000002 /* Supports case-insensitive */
+#define VFSFT_NOCASESENSITIVE 0x100000004 /* NOT case-sensitive */
+#define VFSFT_DIRENTFLAGS 0x100000008 /* Supports dirent flags */
+#define VFSFT_ACLONCREATE 0x100000010 /* Supports ACL on create */
+#define VFSFT_ACEMASKONACCESS 0x100000020 /* Can use ACEMASK for access */
+
+/*
* Argument structure for mount(2).
*
* Flags are defined in <sys/mount.h>.
@@ -380,21 +402,22 @@ typedef struct vfssw {
/*
* Filesystem type definition record. All file systems must export a record
- * of this type through their modlfs structure.
+ * of this type through their modlfs structure. N.B., changing the version
+ * number requires a change in sys/modctl.h.
*/
-typedef struct vfsdef_v3 {
+typedef struct vfsdef_v4 {
int def_version; /* structure version, must be first */
char *name; /* filesystem type name */
int (*init) (int, char *); /* init routine */
int flags; /* filesystem flags */
mntopts_t *optproto; /* mount options table prototype */
-} vfsdef_v3;
+} vfsdef_v4;
-typedef struct vfsdef_v3 vfsdef_t;
+typedef struct vfsdef_v4 vfsdef_t;
enum {
- VFSDEF_VERSION = 3
+ VFSDEF_VERSION = 4
};
/*
@@ -424,6 +447,8 @@ void vfs_setops(vfs_t *, vfsops_t *);
vfsops_t *vfs_getops(vfs_t *vfsp);
int vfs_matchops(vfs_t *, vfsops_t *);
int vfs_can_sync(vfs_t *vfsp);
+vfs_t *vfs_alloc(int);
+void vfs_free(vfs_t *);
void vfs_init(vfs_t *vfsp, vfsops_t *, void *);
void vfsimpl_setup(vfs_t *vfsp);
void vfsimpl_teardown(vfs_t *vfsp);
@@ -450,6 +475,10 @@ void vfs_mountroot(void);
void vfs_add(vnode_t *, struct vfs *, int);
void vfs_remove(struct vfs *);
+/* VFS feature routines */
+void vfs_set_feature(vfs_t *, vfs_feature_t);
+int vfs_has_feature(vfs_t *, vfs_feature_t);
+
/* The following functions are not for general use by filesystems */
void vfs_createopttbl(mntopts_t *, const char *);
@@ -545,7 +574,6 @@ extern const mntopts_t vfs_mntopts; /* globally recognized options */
#define VFS_INIT(vfsp, op, data) { \
vfs_init((vfsp), (op), (data)); \
- vfsimpl_setup((vfsp)); \
}
diff --git a/usr/src/uts/common/sys/vnode.h b/usr/src/uts/common/sys/vnode.h
index 56f4ac42d8..3195fb4ebd 100644
--- a/usr/src/uts/common/sys/vnode.h
+++ b/usr/src/uts/common/sys/vnode.h
@@ -194,6 +194,7 @@ struct vsd_node {
* v_shrlocks
* v_path
* v_vsd
+ * v_xattrdir
*
* A special lock (implemented by vn_vfswlock in vnode.c) protects:
* v_vfsmountedhere
@@ -262,6 +263,7 @@ typedef struct vnode {
krwlock_t v_mslock; /* protects v_mset */
void *v_fopdata; /* list of file ops event watches */
struct vsd_node *v_vsd; /* vnode specific data */
+ struct vnode *v_xattrdir; /* unnamed extended attr dir (GFS) */
} vnode_t;
#define IS_DEVVP(vp) \
@@ -334,6 +336,8 @@ typedef struct vn_vfslocks_entry {
#define VISSWAPFS 0x20000 /* vnode is being used for swapfs */
#define IS_SWAPFSVP(vp) (((vp)->v_flag & VISSWAPFS) != 0)
+#define V_SYSATTR 0x40000 /* vnode is a GFS system attribute */
+
/*
* Vnode attributes. A bit-mask is supplied as part of the
* structure to indicate the attributes the caller wants to
@@ -366,6 +370,101 @@ typedef struct vattr {
uint_t va_seq; /* sequence number */
} vattr_t;
+#define AV_SCANSTAMP_SZ 32 /* length of anti-virus scanstamp */
+
+/*
+ * Structure of all optional attributes.
+ */
+typedef struct xoptattr {
+ timestruc_t xoa_createtime; /* Create time of file */
+ uint8_t xoa_archive;
+ uint8_t xoa_system;
+ uint8_t xoa_readonly;
+ uint8_t xoa_hidden;
+ uint8_t xoa_nounlink;
+ uint8_t xoa_immutable;
+ uint8_t xoa_appendonly;
+ uint8_t xoa_nodump;
+ uint8_t xoa_opaque;
+ uint8_t xoa_av_quarantined;
+ uint8_t xoa_av_modified;
+ uint8_t xoa_av_scanstamp[AV_SCANSTAMP_SZ];
+} xoptattr_t;
+
+/*
+ * The xvattr structure is really a variable length structure that
+ * is made up of:
+ * - The classic vattr_t (xva_vattr)
+ * - a 32 bit quantity (xva_mapsize) that specifies the size of the
+ * attribute bitmaps in 32 bit words.
+ * - A pointer to the returned attribute bitmap (needed because the
+ * previous element, the requested attribute bitmap) is variable lenth.
+ * - The requested attribute bitmap, which is an array of 32 bit words.
+ * Callers use the XVA_SET_REQ() macro to set the bits corresponding to
+ * the attributes that are being requested.
+ * - The returned attribute bitmap, which is an array of 32 bit words.
+ * File systems that support optional attributes use the XVA_SET_RTN()
+ * macro to set the bits corresponding to the attributes that are being
+ * returned.
+ * - The xoptattr_t structure which contains the attribute values
+ *
+ * xva_mapsize determines how many words in the attribute bitmaps.
+ * Immediately following the attribute bitmaps is the xoptattr_t.
+ * xva_getxoptattr() is used to get the pointer to the xoptattr_t
+ * section.
+ */
+
+#define XVA_MAPSIZE 3 /* Size of attr bitmaps */
+#define XVA_MAGIC 0x78766174 /* Magic # for verification */
+
+/*
+ * The xvattr structure is an extensible structure which permits optional
+ * attributes to be requested/returned. File systems may or may not support
+ * optional attributes. They do so at their own discretion but if they do
+ * support optional attributes, they must register the VFSFT_XVATTR feature
+ * so that the optional attributes can be set/retrived.
+ *
+ * The fields of the xvattr structure are:
+ *
+ * xva_vattr - The first element of an xvattr is a legacy vattr structure
+ * which includes the common attributes. If AT_XVATTR is set in the va_mask
+ * then the entire structure is treated as an xvattr. If AT_XVATTR is not
+ * set, then only the xva_vattr structure can be used.
+ *
+ * xva_magic - 0x78766174 (hex for "xvat"). Magic number for verification.
+ *
+ * xva_mapsize - Size of requested and returned attribute bitmaps.
+ *
+ * xva_rtnattrmapp - Pointer to xva_rtnattrmap[]. We need this since the
+ * size of the array before it, xva_reqattrmap[], could change which means
+ * the location of xva_rtnattrmap[] could change. This will allow unbundled
+ * file systems to find the location of xva_rtnattrmap[] when the sizes change.
+ *
+ * xva_reqattrmap[] - Array of requested attributes. Attributes are
+ * represented by a specific bit in a specific element of the attribute
+ * map array. Callers set the bits corresponding to the attributes
+ * that the caller wants to get/set.
+ *
+ * xva_rtnattrmap[] - Array of attributes that the file system was able to
+ * process. Not all file systems support all optional attributes. This map
+ * informs the caller which attributes the underlying file system was able
+ * to set/get. (Same structure as the requested attributes array in terms
+ * of each attribute corresponding to specific bits and array elements.)
+ *
+ * xva_xoptattrs - Structure containing values of optional attributes.
+ * These values are only valid if the corresponding bits in xva_reqattrmap
+ * are set and the underlying file system supports those attributes.
+ */
+typedef struct xvattr {
+ vattr_t xva_vattr; /* Embedded vattr structure */
+ uint32_t xva_magic; /* Magic Number */
+ uint32_t xva_mapsize; /* Size of attr bitmap (32-bit words) */
+ uint32_t *xva_rtnattrmapp; /* Ptr to xva_rtnattrmap[] */
+ uint32_t xva_reqattrmap[XVA_MAPSIZE]; /* Requested attrs */
+ uint32_t xva_rtnattrmap[XVA_MAPSIZE]; /* Returned attrs */
+ xoptattr_t xva_xoptattrs; /* Optional attributes */
+} xvattr_t;
+
#ifdef _SYSCALL32
/*
* For bigtypes time_t changed to 64 bit on the 64-bit kernel.
@@ -407,22 +506,29 @@ typedef vattr_t vattr32_t;
/*
* Attributes of interest to the caller of setattr or getattr.
*/
-#define AT_TYPE 0x0001
-#define AT_MODE 0x0002
-#define AT_UID 0x0004
-#define AT_GID 0x0008
-#define AT_FSID 0x0010
-#define AT_NODEID 0x0020
-#define AT_NLINK 0x0040
-#define AT_SIZE 0x0080
-#define AT_ATIME 0x0100
-#define AT_MTIME 0x0200
-#define AT_CTIME 0x0400
-#define AT_RDEV 0x0800
-#define AT_BLKSIZE 0x1000
-#define AT_NBLOCKS 0x2000
-/* 0x4000 */ /* unused */
-#define AT_SEQ 0x8000
+#define AT_TYPE 0x00001
+#define AT_MODE 0x00002
+#define AT_UID 0x00004
+#define AT_GID 0x00008
+#define AT_FSID 0x00010
+#define AT_NODEID 0x00020
+#define AT_NLINK 0x00040
+#define AT_SIZE 0x00080
+#define AT_ATIME 0x00100
+#define AT_MTIME 0x00200
+#define AT_CTIME 0x00400
+#define AT_RDEV 0x00800
+#define AT_BLKSIZE 0x01000
+#define AT_NBLOCKS 0x02000
+/* 0x04000 */ /* unused */
+#define AT_SEQ 0x08000
+/*
+ * If AT_XVATTR is set then there are additional bits to process in
+ * the xvattr_t's attribute bitmap. If this is not set then the bitmap
+ * MUST be ignored. Note that this bit must be set/cleared explicitly.
+ * That is, setting AT_ALL will NOT set AT_XVATTR.
+ */
+#define AT_XVATTR 0x10000
#define AT_ALL (AT_TYPE|AT_MODE|AT_UID|AT_GID|AT_FSID|AT_NODEID|\
AT_NLINK|AT_SIZE|AT_ATIME|AT_MTIME|AT_CTIME|\
@@ -437,6 +543,116 @@ typedef vattr_t vattr32_t;
AT_BLKSIZE|AT_NBLOCKS|AT_SEQ)
/*
+ * Attribute bits used in the extensible attribute's (xva's) attribute
+ * bitmaps. Note that the bitmaps are made up of a variable length number
+ * of 32-bit words. The convention is to use XAT{n}_{attrname} where "n"
+ * is the element in the bitmap (starting at 1). This convention is for
+ * the convenience of the maintainer to keep track of which element each
+ * attribute belongs to.
+ *
+ * NOTE THAT CONSUMERS MUST *NOT* USE THE XATn_* DEFINES DIRECTLY. CONSUMERS
+ * MUST USE THE XAT_* DEFINES.
+ */
+#define XAT0_INDEX 0LL /* Index into bitmap for XAT0 attrs */
+#define XAT0_CREATETIME 0x00000001 /* Create time of file */
+#define XAT0_ARCHIVE 0x00000002 /* Archive */
+#define XAT0_SYSTEM 0x00000004 /* System */
+#define XAT0_READONLY 0x00000008 /* Readonly */
+#define XAT0_HIDDEN 0x00000010 /* Hidden */
+#define XAT0_NOUNLINK 0x00000020 /* Nounlink */
+#define XAT0_IMMUTABLE 0x00000040 /* immutable */
+#define XAT0_APPENDONLY 0x00000080 /* appendonly */
+#define XAT0_NODUMP 0x00000100 /* nodump */
+#define XAT0_OPAQUE 0x00000200 /* opaque */
+#define XAT0_AV_QUARANTINED 0x00000400 /* anti-virus quarantine */
+#define XAT0_AV_MODIFIED 0x00000800 /* anti-virus modified */
+#define XAT0_AV_SCANSTAMP 0x00001000 /* anti-virus scanstamp */
+
+#define XAT0_ALL_ATTRS (XAT0_CREATETIME|XAT0_ARCHIVE|XAT0_SYSTEM| \
+ XAT0_READONLY|XAT0_HIDDEN|XAT0_NOUNLINK|XAT0_IMMUTABLE|XAT0_APPENDONLY| \
+ XAT0_NODUMP|XAT0_OPAQUE|XAT0_AV_QUARANTINED| \
+ XAT0_AV_MODIFIED|XAT0_AV_SCANSTAMP)
+
+/* Support for XAT_* optional attributes */
+#define XVA_MASK 0xffffffff /* Used to mask off 32 bits */
+#define XVA_SHFT 32 /* Used to shift index */
+
+/*
+ * Used to pry out the index and attribute bits from the XAT_* attributes
+ * defined below. Note that we're masking things down to 32 bits then
+ * casting to uint32_t.
+ */
+#define XVA_INDEX(attr) ((uint32_t)(((attr) >> XVA_SHFT) & XVA_MASK))
+#define XVA_ATTRBIT(attr) ((uint32_t)((attr) & XVA_MASK))
+
+/*
+ * The following defines present a "flat namespace" so that consumers don't
+ * need to keep track of which element belongs to which bitmap entry.
+ *
+ * NOTE THAT THESE MUST NEVER BE OR-ed TOGETHER
+ */
+#define XAT_CREATETIME ((XAT0_INDEX << XVA_SHFT) | XAT0_CREATETIME)
+#define XAT_ARCHIVE ((XAT0_INDEX << XVA_SHFT) | XAT0_ARCHIVE)
+#define XAT_SYSTEM ((XAT0_INDEX << XVA_SHFT) | XAT0_SYSTEM)
+#define XAT_READONLY ((XAT0_INDEX << XVA_SHFT) | XAT0_READONLY)
+#define XAT_HIDDEN ((XAT0_INDEX << XVA_SHFT) | XAT0_HIDDEN)
+#define XAT_NOUNLINK ((XAT0_INDEX << XVA_SHFT) | XAT0_NOUNLINK)
+#define XAT_IMMUTABLE ((XAT0_INDEX << XVA_SHFT) | XAT0_IMMUTABLE)
+#define XAT_APPENDONLY ((XAT0_INDEX << XVA_SHFT) | XAT0_APPENDONLY)
+#define XAT_NODUMP ((XAT0_INDEX << XVA_SHFT) | XAT0_NODUMP)
+#define XAT_OPAQUE ((XAT0_INDEX << XVA_SHFT) | XAT0_OPAQUE)
+#define XAT_AV_QUARANTINED ((XAT0_INDEX << XVA_SHFT) | XAT0_AV_QUARANTINED)
+#define XAT_AV_MODIFIED ((XAT0_INDEX << XVA_SHFT) | XAT0_AV_MODIFIED)
+#define XAT_AV_SCANSTAMP ((XAT0_INDEX << XVA_SHFT) | XAT0_AV_SCANSTAMP)
+
+/*
+ * The returned attribute map array (xva_rtnattrmap[]) is located past the
+ * requested attribute map array (xva_reqattrmap[]). Its location changes
+ * when the array sizes change. We use a separate pointer in a known location
+ * (xva_rtnattrmapp) to hold the location of xva_rtnattrmap[]. This is
+ * set in xva_init()
+ */
+#define XVA_RTNATTRMAP(xvap) ((xvap)->xva_rtnattrmapp)
+
+/*
+ * XVA_SET_REQ() sets an attribute bit in the proper element in the bitmap
+ * of requested attributes (xva_reqattrmap[]).
+ */
+#define XVA_SET_REQ(xvap, attr) \
+ ASSERT((xvap)->xva_vattr.va_mask | AT_XVATTR); \
+ ASSERT((xvap)->xva_magic == XVA_MAGIC); \
+ (xvap)->xva_reqattrmap[XVA_INDEX(attr)] |= XVA_ATTRBIT(attr)
+
+/*
+ * XVA_SET_RTN() sets an attribute bit in the proper element in the bitmap
+ * of returned attributes (xva_rtnattrmap[]).
+ */
+#define XVA_SET_RTN(xvap, attr) \
+ ASSERT((xvap)->xva_vattr.va_mask | AT_XVATTR); \
+ ASSERT((xvap)->xva_magic == XVA_MAGIC); \
+ (XVA_RTNATTRMAP(xvap))[XVA_INDEX(attr)] |= XVA_ATTRBIT(attr)
+
+/*
+ * XVA_ISSET_REQ() checks the requested attribute bitmap (xva_reqattrmap[])
+ * to see of the corresponding attribute bit is set. If so, returns non-zero.
+ */
+#define XVA_ISSET_REQ(xvap, attr) \
+ ((((xvap)->xva_vattr.va_mask | AT_XVATTR) && \
+ ((xvap)->xva_magic == XVA_MAGIC) && \
+ ((xvap)->xva_mapsize > XVA_INDEX(attr))) ? \
+ ((xvap)->xva_reqattrmap[XVA_INDEX(attr)] & XVA_ATTRBIT(attr)) : 0)
+
+/*
+ * XVA_ISSET_RTN() checks the returned attribute bitmap (xva_rtnattrmap[])
+ * to see of the corresponding attribute bit is set. If so, returns non-zero.
+ */
+#define XVA_ISSET_RTN(xvap, attr) \
+ ((((xvap)->xva_vattr.va_mask | AT_XVATTR) && \
+ ((xvap)->xva_magic == XVA_MAGIC) && \
+ ((xvap)->xva_mapsize > XVA_INDEX(attr))) ? \
+ ((XVA_RTNATTRMAP(xvap))[XVA_INDEX(attr)] & XVA_ATTRBIT(attr)) : 0)
+
+/*
* Modes. Some values same as S_xxx entries from stat.h for convenience.
*/
#define VSUID 04000 /* set user id on execution */
@@ -454,6 +670,12 @@ typedef vattr_t vattr32_t;
#define PERMMASK 00777 /* permission bits */
/*
+ * VOP_ACCESS flags
+ */
+#define V_ACE_MASK 0x1 /* mask represents NFSv4 ACE permissions */
+#define V_APPEND 0x2 /* want to do append only check */
+
+/*
* Check whether mandatory file locking is enabled.
*/
@@ -506,15 +728,19 @@ typedef struct vsecattr {
void *vsa_aclentp; /* pointer to ACL entries */
int vsa_dfaclcnt; /* default ACL entry count */
void *vsa_dfaclentp; /* pointer to default ACL entries */
+ size_t vsa_aclentsz; /* ACE size in bytes of vsa_aclentp */
+ uint_t vsa_aclflags; /* ACE ACL flags */
} vsecattr_t;
/* vsa_mask values */
-#define VSA_ACL 0x0001
-#define VSA_ACLCNT 0x0002
-#define VSA_DFACL 0x0004
-#define VSA_DFACLCNT 0x0008
-#define VSA_ACE 0x0010
-#define VSA_ACECNT 0x0020
+#define VSA_ACL 0x0001
+#define VSA_ACLCNT 0x0002
+#define VSA_DFACL 0x0004
+#define VSA_DFACLCNT 0x0008
+#define VSA_ACE 0x0010
+#define VSA_ACECNT 0x0020
+#define VSA_ACE_ALLTYPES 0x0040
+#define VSA_ACE_ACLFLAGS 0x0080 /* get/set ACE ACL flags */
/*
* Structure used by various vnode operations to determine
@@ -552,79 +778,110 @@ struct pollhead;
* the vnodeops structure (below) and the fs_func_p union (vfs_opreg.h).
*/
#define VNODE_OPS \
- int (*vop_open)(vnode_t **, int, cred_t *); \
- int (*vop_close)(vnode_t *, int, int, offset_t, cred_t *); \
+ int (*vop_open)(vnode_t **, int, cred_t *, \
+ caller_context_t *); \
+ int (*vop_close)(vnode_t *, int, int, offset_t, cred_t *, \
+ caller_context_t *); \
int (*vop_read)(vnode_t *, uio_t *, int, cred_t *, \
caller_context_t *); \
int (*vop_write)(vnode_t *, uio_t *, int, cred_t *, \
caller_context_t *); \
int (*vop_ioctl)(vnode_t *, int, intptr_t, int, cred_t *, \
- int *); \
- int (*vop_setfl)(vnode_t *, int, int, cred_t *); \
- int (*vop_getattr)(vnode_t *, vattr_t *, int, cred_t *); \
+ int *, caller_context_t *); \
+ int (*vop_setfl)(vnode_t *, int, int, cred_t *, \
+ caller_context_t *); \
+ int (*vop_getattr)(vnode_t *, vattr_t *, int, cred_t *, \
+ caller_context_t *); \
int (*vop_setattr)(vnode_t *, vattr_t *, int, cred_t *, \
caller_context_t *); \
- int (*vop_access)(vnode_t *, int, int, cred_t *); \
+ int (*vop_access)(vnode_t *, int, int, cred_t *, \
+ caller_context_t *); \
int (*vop_lookup)(vnode_t *, char *, vnode_t **, \
struct pathname *, \
- int, vnode_t *, cred_t *); \
+ int, vnode_t *, cred_t *, \
+ caller_context_t *, int *, \
+ struct pathname *); \
int (*vop_create)(vnode_t *, char *, vattr_t *, vcexcl_t, \
- int, vnode_t **, cred_t *, int); \
- int (*vop_remove)(vnode_t *, char *, cred_t *); \
- int (*vop_link)(vnode_t *, vnode_t *, char *, cred_t *); \
+ int, vnode_t **, cred_t *, int, \
+ caller_context_t *, vsecattr_t *); \
+ int (*vop_remove)(vnode_t *, char *, cred_t *, \
+ caller_context_t *, int); \
+ int (*vop_link)(vnode_t *, vnode_t *, char *, cred_t *, \
+ caller_context_t *, int); \
int (*vop_rename)(vnode_t *, char *, vnode_t *, char *, \
- cred_t *); \
+ cred_t *, caller_context_t *, int); \
int (*vop_mkdir)(vnode_t *, char *, vattr_t *, vnode_t **, \
- cred_t *); \
- int (*vop_rmdir)(vnode_t *, char *, vnode_t *, cred_t *); \
- int (*vop_readdir)(vnode_t *, uio_t *, cred_t *, int *); \
+ cred_t *, caller_context_t *, int, \
+ vsecattr_t *); \
+ int (*vop_rmdir)(vnode_t *, char *, vnode_t *, cred_t *, \
+ caller_context_t *, int); \
+ int (*vop_readdir)(vnode_t *, uio_t *, cred_t *, int *, \
+ caller_context_t *, int); \
int (*vop_symlink)(vnode_t *, char *, vattr_t *, char *, \
- cred_t *); \
- int (*vop_readlink)(vnode_t *, uio_t *, cred_t *); \
- int (*vop_fsync)(vnode_t *, int, cred_t *); \
- void (*vop_inactive)(vnode_t *, cred_t *); \
- int (*vop_fid)(vnode_t *, struct fid *); \
+ cred_t *, caller_context_t *, int); \
+ int (*vop_readlink)(vnode_t *, uio_t *, cred_t *, \
+ caller_context_t *); \
+ int (*vop_fsync)(vnode_t *, int, cred_t *, \
+ caller_context_t *); \
+ void (*vop_inactive)(vnode_t *, cred_t *, \
+ caller_context_t *); \
+ int (*vop_fid)(vnode_t *, struct fid *, \
+ caller_context_t *); \
int (*vop_rwlock)(vnode_t *, int, caller_context_t *); \
void (*vop_rwunlock)(vnode_t *, int, caller_context_t *); \
- int (*vop_seek)(vnode_t *, offset_t, offset_t *); \
- int (*vop_cmp)(vnode_t *, vnode_t *); \
+ int (*vop_seek)(vnode_t *, offset_t, offset_t *, \
+ caller_context_t *); \
+ int (*vop_cmp)(vnode_t *, vnode_t *, caller_context_t *); \
int (*vop_frlock)(vnode_t *, int, struct flock64 *, \
int, offset_t, \
- struct flk_callback *, cred_t *); \
+ struct flk_callback *, cred_t *, \
+ caller_context_t *); \
int (*vop_space)(vnode_t *, int, struct flock64 *, \
int, offset_t, \
cred_t *, caller_context_t *); \
- int (*vop_realvp)(vnode_t *, vnode_t **); \
+ int (*vop_realvp)(vnode_t *, vnode_t **, \
+ caller_context_t *); \
int (*vop_getpage)(vnode_t *, offset_t, size_t, uint_t *, \
struct page **, size_t, struct seg *, \
- caddr_t, enum seg_rw, cred_t *); \
+ caddr_t, enum seg_rw, cred_t *, \
+ caller_context_t *); \
int (*vop_putpage)(vnode_t *, offset_t, size_t, \
- int, cred_t *); \
+ int, cred_t *, caller_context_t *); \
int (*vop_map)(vnode_t *, offset_t, struct as *, \
caddr_t *, size_t, \
- uchar_t, uchar_t, uint_t, cred_t *); \
+ uchar_t, uchar_t, uint_t, cred_t *, \
+ caller_context_t *); \
int (*vop_addmap)(vnode_t *, offset_t, struct as *, \
caddr_t, size_t, \
- uchar_t, uchar_t, uint_t, cred_t *); \
+ uchar_t, uchar_t, uint_t, cred_t *, \
+ caller_context_t *); \
int (*vop_delmap)(vnode_t *, offset_t, struct as *, \
caddr_t, size_t, \
- uint_t, uint_t, uint_t, cred_t *); \
+ uint_t, uint_t, uint_t, cred_t *, \
+ caller_context_t *); \
int (*vop_poll)(vnode_t *, short, int, short *, \
- struct pollhead **); \
- int (*vop_dump)(vnode_t *, caddr_t, int, int); \
- int (*vop_pathconf)(vnode_t *, int, ulong_t *, cred_t *); \
+ struct pollhead **, \
+ caller_context_t *); \
+ int (*vop_dump)(vnode_t *, caddr_t, int, int, \
+ caller_context_t *); \
+ int (*vop_pathconf)(vnode_t *, int, ulong_t *, cred_t *, \
+ caller_context_t *); \
int (*vop_pageio)(vnode_t *, struct page *, \
- u_offset_t, size_t, int, cred_t *); \
- int (*vop_dumpctl)(vnode_t *, int, int *); \
+ u_offset_t, size_t, int, cred_t *, \
+ caller_context_t *); \
+ int (*vop_dumpctl)(vnode_t *, int, int *, \
+ caller_context_t *); \
void (*vop_dispose)(vnode_t *, struct page *, \
- int, int, cred_t *); \
+ int, int, cred_t *, \
+ caller_context_t *); \
int (*vop_setsecattr)(vnode_t *, vsecattr_t *, \
- int, cred_t *); \
+ int, cred_t *, caller_context_t *); \
int (*vop_getsecattr)(vnode_t *, vsecattr_t *, \
- int, cred_t *); \
+ int, cred_t *, caller_context_t *); \
int (*vop_shrlock)(vnode_t *, int, struct shrlock *, \
- int, cred_t *); \
- int (*vop_vnevent)(vnode_t *, vnevent_t, vnode_t *, char *) \
+ int, cred_t *, caller_context_t *); \
+ int (*vop_vnevent)(vnode_t *, vnevent_t, vnode_t *, \
+ char *, caller_context_t *)
/* NB: No ";" */
/*
@@ -639,153 +896,178 @@ typedef struct vnodeops {
typedef int (*fs_generic_func_p) (); /* Generic vop/vfsop/femop/fsemop ptr */
-extern int fop_open(vnode_t **, int, cred_t *);
-extern int fop_close(vnode_t *, int, int, offset_t, cred_t *);
+extern int fop_open(vnode_t **, int, cred_t *, caller_context_t *);
+extern int fop_close(vnode_t *, int, int, offset_t, cred_t *,
+ caller_context_t *);
extern int fop_read(vnode_t *, uio_t *, int, cred_t *, caller_context_t *);
extern int fop_write(vnode_t *, uio_t *, int, cred_t *,
caller_context_t *);
-extern int fop_ioctl(vnode_t *, int, intptr_t, int, cred_t *, int *);
-extern int fop_setfl(vnode_t *, int, int, cred_t *);
-extern int fop_getattr(vnode_t *, vattr_t *, int, cred_t *);
+extern int fop_ioctl(vnode_t *, int, intptr_t, int, cred_t *, int *,
+ caller_context_t *);
+extern int fop_setfl(vnode_t *, int, int, cred_t *, caller_context_t *);
+extern int fop_getattr(vnode_t *, vattr_t *, int, cred_t *,
+ caller_context_t *);
extern int fop_setattr(vnode_t *, vattr_t *, int, cred_t *,
caller_context_t *);
-extern int fop_access(vnode_t *, int, int, cred_t *);
+extern int fop_access(vnode_t *, int, int, cred_t *, caller_context_t *);
extern int fop_lookup(vnode_t *, char *, vnode_t **, struct pathname *,
- int, vnode_t *, cred_t *);
+ int, vnode_t *, cred_t *, caller_context_t *,
+ int *, struct pathname *);
extern int fop_create(vnode_t *, char *, vattr_t *, vcexcl_t, int,
- vnode_t **, cred_t *, int);
-extern int fop_remove(vnode_t *vp, char *, cred_t *);
-extern int fop_link(vnode_t *, vnode_t *, char *, cred_t *);
-extern int fop_rename(vnode_t *, char *, vnode_t *, char *, cred_t *);
-extern int fop_mkdir(vnode_t *, char *, vattr_t *, vnode_t **, cred_t *);
-extern int fop_rmdir(vnode_t *, char *, vnode_t *, cred_t *);
-extern int fop_readdir(vnode_t *, uio_t *, cred_t *, int *);
-extern int fop_symlink(vnode_t *, char *, vattr_t *, char *, cred_t *);
-extern int fop_readlink(vnode_t *, uio_t *, cred_t *);
-extern int fop_fsync(vnode_t *, int, cred_t *);
-extern void fop_inactive(vnode_t *, cred_t *);
-extern int fop_fid(vnode_t *, struct fid *);
+ vnode_t **, cred_t *, int, caller_context_t *,
+ vsecattr_t *);
+extern int fop_remove(vnode_t *vp, char *, cred_t *, caller_context_t *,
+ int);
+extern int fop_link(vnode_t *, vnode_t *, char *, cred_t *,
+ caller_context_t *, int);
+extern int fop_rename(vnode_t *, char *, vnode_t *, char *, cred_t *,
+ caller_context_t *, int);
+extern int fop_mkdir(vnode_t *, char *, vattr_t *, vnode_t **, cred_t *,
+ caller_context_t *, int, vsecattr_t *);
+extern int fop_rmdir(vnode_t *, char *, vnode_t *, cred_t *,
+ caller_context_t *, int);
+extern int fop_readdir(vnode_t *, uio_t *, cred_t *, int *,
+ caller_context_t *, int);
+extern int fop_symlink(vnode_t *, char *, vattr_t *, char *, cred_t *,
+ caller_context_t *, int);
+extern int fop_readlink(vnode_t *, uio_t *, cred_t *, caller_context_t *);
+extern int fop_fsync(vnode_t *, int, cred_t *, caller_context_t *);
+extern void fop_inactive(vnode_t *, cred_t *, caller_context_t *);
+extern int fop_fid(vnode_t *, struct fid *, caller_context_t *);
extern int fop_rwlock(vnode_t *, int, caller_context_t *);
extern void fop_rwunlock(vnode_t *, int, caller_context_t *);
-extern int fop_seek(vnode_t *, offset_t, offset_t *);
-extern int fop_cmp(vnode_t *, vnode_t *);
+extern int fop_seek(vnode_t *, offset_t, offset_t *, caller_context_t *);
+extern int fop_cmp(vnode_t *, vnode_t *, caller_context_t *);
extern int fop_frlock(vnode_t *, int, struct flock64 *, int, offset_t,
- struct flk_callback *, cred_t *);
+ struct flk_callback *, cred_t *,
+ caller_context_t *);
extern int fop_space(vnode_t *, int, struct flock64 *, int, offset_t,
cred_t *, caller_context_t *);
-extern int fop_realvp(vnode_t *, vnode_t **);
+extern int fop_realvp(vnode_t *, vnode_t **, caller_context_t *);
extern int fop_getpage(vnode_t *, offset_t, size_t, uint_t *,
struct page **, size_t, struct seg *,
- caddr_t, enum seg_rw, cred_t *);
-extern int fop_putpage(vnode_t *, offset_t, size_t, int, cred_t *);
+ caddr_t, enum seg_rw, cred_t *,
+ caller_context_t *);
+extern int fop_putpage(vnode_t *, offset_t, size_t, int, cred_t *,
+ caller_context_t *);
extern int fop_map(vnode_t *, offset_t, struct as *, caddr_t *, size_t,
- uchar_t, uchar_t, uint_t, cred_t *cr);
+ uchar_t, uchar_t, uint_t, cred_t *cr,
+ caller_context_t *);
extern int fop_addmap(vnode_t *, offset_t, struct as *, caddr_t, size_t,
- uchar_t, uchar_t, uint_t, cred_t *);
+ uchar_t, uchar_t, uint_t, cred_t *,
+ caller_context_t *);
extern int fop_delmap(vnode_t *, offset_t, struct as *, caddr_t, size_t,
- uint_t, uint_t, uint_t, cred_t *);
-extern int fop_poll(vnode_t *, short, int, short *, struct pollhead **);
-extern int fop_dump(vnode_t *, caddr_t, int, int);
-extern int fop_pathconf(vnode_t *, int, ulong_t *, cred_t *);
+ uint_t, uint_t, uint_t, cred_t *,
+ caller_context_t *);
+extern int fop_poll(vnode_t *, short, int, short *, struct pollhead **,
+ caller_context_t *);
+extern int fop_dump(vnode_t *, caddr_t, int, int, caller_context_t *);
+extern int fop_pathconf(vnode_t *, int, ulong_t *, cred_t *,
+ caller_context_t *);
extern int fop_pageio(vnode_t *, struct page *, u_offset_t, size_t, int,
- cred_t *);
-extern int fop_dumpctl(vnode_t *, int, int *);
-extern void fop_dispose(vnode_t *, struct page *, int, int, cred_t *);
-extern int fop_setsecattr(vnode_t *, vsecattr_t *, int, cred_t *);
-extern int fop_getsecattr(vnode_t *, vsecattr_t *, int, cred_t *);
-extern int fop_shrlock(vnode_t *, int, struct shrlock *, int, cred_t *);
-extern int fop_vnevent(vnode_t *, vnevent_t, vnode_t *, char *);
+ cred_t *, caller_context_t *);
+extern int fop_dumpctl(vnode_t *, int, int *, caller_context_t *);
+extern void fop_dispose(vnode_t *, struct page *, int, int, cred_t *,
+ caller_context_t *);
+extern int fop_setsecattr(vnode_t *, vsecattr_t *, int, cred_t *,
+ caller_context_t *);
+extern int fop_getsecattr(vnode_t *, vsecattr_t *, int, cred_t *,
+ caller_context_t *);
+extern int fop_shrlock(vnode_t *, int, struct shrlock *, int, cred_t *,
+ caller_context_t *);
+extern int fop_vnevent(vnode_t *, vnevent_t, vnode_t *, char *,
+ caller_context_t *);
#endif /* _KERNEL */
-#define VOP_OPEN(vpp, mode, cr) \
- fop_open(vpp, mode, cr)
-#define VOP_CLOSE(vp, f, c, o, cr) \
- fop_close(vp, f, c, o, cr)
+#define VOP_OPEN(vpp, mode, cr, ct) \
+ fop_open(vpp, mode, cr, ct)
+#define VOP_CLOSE(vp, f, c, o, cr, ct) \
+ fop_close(vp, f, c, o, cr, ct)
#define VOP_READ(vp, uiop, iof, cr, ct) \
fop_read(vp, uiop, iof, cr, ct)
#define VOP_WRITE(vp, uiop, iof, cr, ct) \
fop_write(vp, uiop, iof, cr, ct)
-#define VOP_IOCTL(vp, cmd, a, f, cr, rvp) \
- fop_ioctl(vp, cmd, a, f, cr, rvp)
-#define VOP_SETFL(vp, f, a, cr) \
- fop_setfl(vp, f, a, cr)
-#define VOP_GETATTR(vp, vap, f, cr) \
- fop_getattr(vp, vap, f, cr)
+#define VOP_IOCTL(vp, cmd, a, f, cr, rvp, ct) \
+ fop_ioctl(vp, cmd, a, f, cr, rvp, ct)
+#define VOP_SETFL(vp, f, a, cr, ct) \
+ fop_setfl(vp, f, a, cr, ct)
+#define VOP_GETATTR(vp, vap, f, cr, ct) \
+ fop_getattr(vp, vap, f, cr, ct)
#define VOP_SETATTR(vp, vap, f, cr, ct) \
fop_setattr(vp, vap, f, cr, ct)
-#define VOP_ACCESS(vp, mode, f, cr) \
- fop_access(vp, mode, f, cr)
-#define VOP_LOOKUP(vp, cp, vpp, pnp, f, rdir, cr) \
- fop_lookup(vp, cp, vpp, pnp, f, rdir, cr)
-#define VOP_CREATE(dvp, p, vap, ex, mode, vpp, cr, flag) \
- fop_create(dvp, p, vap, ex, mode, vpp, cr, flag)
-#define VOP_REMOVE(dvp, p, cr) \
- fop_remove(dvp, p, cr)
-#define VOP_LINK(tdvp, fvp, p, cr) \
- fop_link(tdvp, fvp, p, cr)
-#define VOP_RENAME(fvp, fnm, tdvp, tnm, cr) \
- fop_rename(fvp, fnm, tdvp, tnm, cr)
-#define VOP_MKDIR(dp, p, vap, vpp, cr) \
- fop_mkdir(dp, p, vap, vpp, cr)
-#define VOP_RMDIR(dp, p, cdir, cr) \
- fop_rmdir(dp, p, cdir, cr)
-#define VOP_READDIR(vp, uiop, cr, eofp) \
- fop_readdir(vp, uiop, cr, eofp)
-#define VOP_SYMLINK(dvp, lnm, vap, tnm, cr) \
- fop_symlink(dvp, lnm, vap, tnm, cr)
-#define VOP_READLINK(vp, uiop, cr) \
- fop_readlink(vp, uiop, cr)
-#define VOP_FSYNC(vp, syncflag, cr) \
- fop_fsync(vp, syncflag, cr)
-#define VOP_INACTIVE(vp, cr) \
- fop_inactive(vp, cr)
-#define VOP_FID(vp, fidp) \
- fop_fid(vp, fidp)
+#define VOP_ACCESS(vp, mode, f, cr, ct) \
+ fop_access(vp, mode, f, cr, ct)
+#define VOP_LOOKUP(vp, cp, vpp, pnp, f, rdir, cr, ct, defp, rpnp) \
+ fop_lookup(vp, cp, vpp, pnp, f, rdir, cr, ct, defp, rpnp)
+#define VOP_CREATE(dvp, p, vap, ex, mode, vpp, cr, flag, ct, vsap) \
+ fop_create(dvp, p, vap, ex, mode, vpp, cr, flag, ct, vsap)
+#define VOP_REMOVE(dvp, p, cr, ct, f) \
+ fop_remove(dvp, p, cr, ct, f)
+#define VOP_LINK(tdvp, fvp, p, cr, ct, f) \
+ fop_link(tdvp, fvp, p, cr, ct, f)
+#define VOP_RENAME(fvp, fnm, tdvp, tnm, cr, ct, f) \
+ fop_rename(fvp, fnm, tdvp, tnm, cr, ct, f)
+#define VOP_MKDIR(dp, p, vap, vpp, cr, ct, f, vsap) \
+ fop_mkdir(dp, p, vap, vpp, cr, ct, f, vsap)
+#define VOP_RMDIR(dp, p, cdir, cr, ct, f) \
+ fop_rmdir(dp, p, cdir, cr, ct, f)
+#define VOP_READDIR(vp, uiop, cr, eofp, ct, f) \
+ fop_readdir(vp, uiop, cr, eofp, ct, f)
+#define VOP_SYMLINK(dvp, lnm, vap, tnm, cr, ct, f) \
+ fop_symlink(dvp, lnm, vap, tnm, cr, ct, f)
+#define VOP_READLINK(vp, uiop, cr, ct) \
+ fop_readlink(vp, uiop, cr, ct)
+#define VOP_FSYNC(vp, syncflag, cr, ct) \
+ fop_fsync(vp, syncflag, cr, ct)
+#define VOP_INACTIVE(vp, cr, ct) \
+ fop_inactive(vp, cr, ct)
+#define VOP_FID(vp, fidp, ct) \
+ fop_fid(vp, fidp, ct)
#define VOP_RWLOCK(vp, w, ct) \
fop_rwlock(vp, w, ct)
#define VOP_RWUNLOCK(vp, w, ct) \
fop_rwunlock(vp, w, ct)
-#define VOP_SEEK(vp, ooff, noffp) \
- fop_seek(vp, ooff, noffp)
-#define VOP_CMP(vp1, vp2) \
- fop_cmp(vp1, vp2)
-#define VOP_FRLOCK(vp, cmd, a, f, o, cb, cr) \
- fop_frlock(vp, cmd, a, f, o, cb, cr)
+#define VOP_SEEK(vp, ooff, noffp, ct) \
+ fop_seek(vp, ooff, noffp, ct)
+#define VOP_CMP(vp1, vp2, ct) \
+ fop_cmp(vp1, vp2, ct)
+#define VOP_FRLOCK(vp, cmd, a, f, o, cb, cr, ct) \
+ fop_frlock(vp, cmd, a, f, o, cb, cr, ct)
#define VOP_SPACE(vp, cmd, a, f, o, cr, ct) \
fop_space(vp, cmd, a, f, o, cr, ct)
-#define VOP_REALVP(vp1, vp2) \
- fop_realvp(vp1, vp2)
-#define VOP_GETPAGE(vp, of, sz, pr, pl, ps, sg, a, rw, cr) \
- fop_getpage(vp, of, sz, pr, pl, ps, sg, a, rw, cr)
-#define VOP_PUTPAGE(vp, of, sz, fl, cr) \
- fop_putpage(vp, of, sz, fl, cr)
-#define VOP_MAP(vp, of, as, a, sz, p, mp, fl, cr) \
- fop_map(vp, of, as, a, sz, p, mp, fl, cr)
-#define VOP_ADDMAP(vp, of, as, a, sz, p, mp, fl, cr) \
- fop_addmap(vp, of, as, a, sz, p, mp, fl, cr)
-#define VOP_DELMAP(vp, of, as, a, sz, p, mp, fl, cr) \
- fop_delmap(vp, of, as, a, sz, p, mp, fl, cr)
-#define VOP_POLL(vp, events, anyyet, reventsp, phpp) \
- fop_poll(vp, events, anyyet, reventsp, phpp)
-#define VOP_DUMP(vp, addr, bn, count) \
- fop_dump(vp, addr, bn, count)
-#define VOP_PATHCONF(vp, cmd, valp, cr) \
- fop_pathconf(vp, cmd, valp, cr)
-#define VOP_PAGEIO(vp, pp, io_off, io_len, flags, cr) \
- fop_pageio(vp, pp, io_off, io_len, flags, cr)
-#define VOP_DUMPCTL(vp, action, blkp) \
- fop_dumpctl(vp, action, blkp)
-#define VOP_DISPOSE(vp, pp, flag, dn, cr) \
- fop_dispose(vp, pp, flag, dn, cr)
-#define VOP_GETSECATTR(vp, vsap, f, cr) \
- fop_getsecattr(vp, vsap, f, cr)
-#define VOP_SETSECATTR(vp, vsap, f, cr) \
- fop_setsecattr(vp, vsap, f, cr)
-#define VOP_SHRLOCK(vp, cmd, shr, f, cr) \
- fop_shrlock(vp, cmd, shr, f, cr)
-#define VOP_VNEVENT(vp, vnevent, dvp, fnm) \
- fop_vnevent(vp, vnevent, dvp, fnm)
+#define VOP_REALVP(vp1, vp2, ct) \
+ fop_realvp(vp1, vp2, ct)
+#define VOP_GETPAGE(vp, of, sz, pr, pl, ps, sg, a, rw, cr, ct) \
+ fop_getpage(vp, of, sz, pr, pl, ps, sg, a, rw, cr, ct)
+#define VOP_PUTPAGE(vp, of, sz, fl, cr, ct) \
+ fop_putpage(vp, of, sz, fl, cr, ct)
+#define VOP_MAP(vp, of, as, a, sz, p, mp, fl, cr, ct) \
+ fop_map(vp, of, as, a, sz, p, mp, fl, cr, ct)
+#define VOP_ADDMAP(vp, of, as, a, sz, p, mp, fl, cr, ct) \
+ fop_addmap(vp, of, as, a, sz, p, mp, fl, cr, ct)
+#define VOP_DELMAP(vp, of, as, a, sz, p, mp, fl, cr, ct) \
+ fop_delmap(vp, of, as, a, sz, p, mp, fl, cr, ct)
+#define VOP_POLL(vp, events, anyyet, reventsp, phpp, ct) \
+ fop_poll(vp, events, anyyet, reventsp, phpp, ct)
+#define VOP_DUMP(vp, addr, bn, count, ct) \
+ fop_dump(vp, addr, bn, count, ct)
+#define VOP_PATHCONF(vp, cmd, valp, cr, ct) \
+ fop_pathconf(vp, cmd, valp, cr, ct)
+#define VOP_PAGEIO(vp, pp, io_off, io_len, flags, cr, ct) \
+ fop_pageio(vp, pp, io_off, io_len, flags, cr, ct)
+#define VOP_DUMPCTL(vp, action, blkp, ct) \
+ fop_dumpctl(vp, action, blkp, ct)
+#define VOP_DISPOSE(vp, pp, flag, dn, cr, ct) \
+ fop_dispose(vp, pp, flag, dn, cr, ct)
+#define VOP_GETSECATTR(vp, vsap, f, cr, ct) \
+ fop_getsecattr(vp, vsap, f, cr, ct)
+#define VOP_SETSECATTR(vp, vsap, f, cr, ct) \
+ fop_setsecattr(vp, vsap, f, cr, ct)
+#define VOP_SHRLOCK(vp, cmd, shr, f, cr, ct) \
+ fop_shrlock(vp, cmd, shr, f, cr, ct)
+#define VOP_VNEVENT(vp, vnevent, dvp, fnm, ct) \
+ fop_vnevent(vp, vnevent, dvp, fnm, ct)
#define VOPNAME_OPEN "open"
#define VOPNAME_CLOSE "close"
@@ -834,10 +1116,19 @@ extern int fop_vnevent(vnode_t *, vnevent_t, vnode_t *, char *);
/*
* Flags for VOP_LOOKUP
+ *
+ * Defined in file.h, but also possible, FIGNORECASE
+ *
*/
#define LOOKUP_DIR 0x01 /* want parent dir vp */
#define LOOKUP_XATTR 0x02 /* lookup up extended attr dir */
#define CREATE_XATTR_DIR 0x04 /* Create extended attr dir */
+#define LOOKUP_HAVE_SYSATTR_DIR 0x08 /* Already created virtual GFS dir */
+
+/*
+ * Flags for VOP_READDIR
+ */
+#define V_RDDIR_ENTFLAGS 0x01 /* request dirent flags */
/*
* Flags for VOP_RWLOCK/VOP_RWUNLOCK
@@ -866,6 +1157,9 @@ void vn_free(vnode_t *);
int vn_is_readonly(vnode_t *);
int vn_is_opened(vnode_t *, v_mode_t);
int vn_is_mapped(vnode_t *, v_mode_t);
+int vn_has_other_opens(vnode_t *, v_mode_t);
+void vn_open_upgrade(vnode_t *, int);
+void vn_open_downgrade(vnode_t *, int);
int vn_can_change_zones(vnode_t *vp);
@@ -890,7 +1184,7 @@ int vn_open(char *pnamep, enum uio_seg seg, int filemode, int createmode,
struct vnode **vpp, enum create crwhy, mode_t umask);
int vn_openat(char *pnamep, enum uio_seg seg, int filemode, int createmode,
struct vnode **vpp, enum create crwhy,
- mode_t umask, struct vnode *startvp);
+ mode_t umask, struct vnode *startvp, int fd);
int vn_create(char *pnamep, enum uio_seg seg, struct vattr *vap,
enum vcexcl excl, int mode, struct vnode **vpp,
enum create why, int flag, mode_t umask);
@@ -927,15 +1221,15 @@ void vn_setpath(vnode_t *rootvp, struct vnode *startvp, struct vnode *vp,
const char *path, size_t plen);
/* Vnode event notification */
-void vnevent_rename_src(vnode_t *, vnode_t *, char *);
-void vnevent_rename_dest(vnode_t *, vnode_t *, char *);
-void vnevent_remove(vnode_t *, vnode_t *, char *);
-void vnevent_rmdir(vnode_t *, vnode_t *, char *);
-void vnevent_create(vnode_t *);
-void vnevent_link(vnode_t *);
-void vnevent_rename_dest_dir(vnode_t *);
-void vnevent_mountedover(vnode_t *);
-int vnevent_support(vnode_t *);
+void vnevent_rename_src(vnode_t *, vnode_t *, char *, caller_context_t *);
+void vnevent_rename_dest(vnode_t *, vnode_t *, char *, caller_context_t *);
+void vnevent_remove(vnode_t *, vnode_t *, char *, caller_context_t *);
+void vnevent_rmdir(vnode_t *, vnode_t *, char *, caller_context_t *);
+void vnevent_create(vnode_t *, caller_context_t *);
+void vnevent_link(vnode_t *, caller_context_t *);
+void vnevent_rename_dest_dir(vnode_t *, caller_context_t *ct);
+void vnevent_mountedover(vnode_t *, caller_context_t *);
+int vnevent_support(vnode_t *, caller_context_t *);
/* Vnode specific data */
void vsd_create(uint_t *, void (*)(void *));
@@ -944,6 +1238,19 @@ void *vsd_get(vnode_t *, uint_t);
int vsd_set(vnode_t *, uint_t, void *);
void vsd_free(vnode_t *);
+/*
+ * Extensible vnode attribute (xva) routines:
+ * xva_init() initializes an xvattr_t (zero struct, init mapsize, set AT_XATTR)
+ * xva_getxoptattr() returns a ponter to the xoptattr_t section of xvattr_t
+ */
+void xva_init(xvattr_t *);
+xoptattr_t *xva_getxoptattr(xvattr_t *); /* Get ptr to xoptattr_t */
+
+void xattr_init(void); /* Initialize vnodeops for xattrs */
+
+/* GFS tunnel for xattrs */
+int xattr_dir_lookup(vnode_t *, vnode_t **, int, cred_t *);
+
/* Context identification */
u_longlong_t fs_new_caller_id();
@@ -976,7 +1283,7 @@ extern uint_t pvn_vmodsort_supported;
*/
#define VN_CMP(VP1, VP2) ((VP1) == (VP2) ? 1 : \
((VP1) && (VP2) && (vn_getops(VP1) == vn_getops(VP2)) ? \
- VOP_CMP(VP1, VP2) : 0))
+ VOP_CMP(VP1, VP2, NULL) : 0))
extern struct vnode kvp;
extern struct vnode zvp;
@@ -993,8 +1300,8 @@ extern struct vnode zvp;
#define ATTR_COMM 0x04 /* yield common vp attributes */
#define ATTR_HINT 0x08 /* information returned will be `hint' */
#define ATTR_REAL 0x10 /* yield attributes of the real vp */
+#define ATTR_NOACLCHECK 0x20 /* Don't check ACL when checking permissions */
#define ATTR_TRIGGER 0x40 /* Mount first if vnode is a trigger mount */
-
/*
* Generally useful macros.
*/
@@ -1026,7 +1333,7 @@ struct async_reqs {
#define VN_DISPOSE(pp, flag, dn, cr) { \
extern struct vnode kvp; \
if ((pp)->p_vnode != NULL && !VN_ISKAS((pp)->p_vnode)) \
- VOP_DISPOSE((pp)->p_vnode, (pp), (flag), (dn), (cr)); \
+ VOP_DISPOSE((pp)->p_vnode, (pp), (flag), (dn), (cr), NULL); \
else if ((flag) == B_FREE) \
page_free((pp), (dn)); \
else \