FreeBSD ZFS
The Zettabyte File System
|
00001 /* 00002 * CDDL HEADER START 00003 * 00004 * The contents of this file are subject to the terms of the 00005 * Common Development and Distribution License (the "License"). 00006 * You may not use this file except in compliance with the License. 00007 * 00008 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 00009 * or http://www.opensolaris.org/os/licensing. 00010 * See the License for the specific language governing permissions 00011 * and limitations under the License. 00012 * 00013 * When distributing Covered Code, include this CDDL HEADER in each 00014 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 00015 * If applicable, add the following below this CDDL HEADER, with the 00016 * fields enclosed by brackets "[]" replaced with your own identifying 00017 * information: Portions Copyright [yyyy] [name of copyright owner] 00018 * 00019 * CDDL HEADER END 00020 */ 00021 /* 00022 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 00023 * Use is subject to license terms. 00024 */ 00025 00026 #ifndef _SYS_ZFS_SA_H 00027 #define _SYS_ZFS_SA_H 00028 00029 #ifdef _KERNEL 00030 #include <sys/list.h> 00031 #include <sys/dmu.h> 00032 #include <sys/zfs_acl.h> 00033 #include <sys/zfs_znode.h> 00034 #include <sys/sa.h> 00035 #include <sys/zil.h> 00036 00037 00038 #endif 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00055 typedef enum zpl_attr { 00056 ZPL_ATIME, 00057 ZPL_MTIME, 00058 ZPL_CTIME, 00059 ZPL_CRTIME, 00060 ZPL_GEN, 00061 ZPL_MODE, 00062 ZPL_SIZE, 00063 ZPL_PARENT, 00064 ZPL_LINKS, 00065 ZPL_XATTR, 00066 ZPL_RDEV, 00067 ZPL_FLAGS, 00068 ZPL_UID, 00069 ZPL_GID, 00070 ZPL_PAD, 00071 ZPL_ZNODE_ACL, 00072 ZPL_DACL_COUNT, 00073 ZPL_SYMLINK, 00074 ZPL_SCANSTAMP, 00075 ZPL_DACL_ACES, 00076 ZPL_END 00077 } zpl_attr_t; 00078 00079 #define ZFS_OLD_ZNODE_PHYS_SIZE 0x108 00080 #define ZFS_SA_BASE_ATTR_SIZE (ZFS_OLD_ZNODE_PHYS_SIZE - \ 00081 sizeof (zfs_acl_phys_t)) 00082 00083 #define SA_MODE_OFFSET 0 00084 #define SA_SIZE_OFFSET 8 00085 #define SA_GEN_OFFSET 16 00086 #define SA_UID_OFFSET 24 00087 #define SA_GID_OFFSET 32 00088 #define SA_PARENT_OFFSET 40 00089 00090 extern sa_attr_reg_t zfs_attr_table[ZPL_END + 1]; 00091 extern sa_attr_reg_t zfs_legacy_attr_table[ZPL_END + 1]; 00092 00109 typedef struct znode_phys { 00110 uint64_t zp_atime[2]; 00111 uint64_t zp_mtime[2]; 00112 uint64_t zp_ctime[2]; 00113 uint64_t zp_crtime[2]; 00114 uint64_t zp_gen; 00115 uint64_t zp_mode; 00116 uint64_t zp_size; 00117 uint64_t zp_parent; 00118 uint64_t zp_links; 00119 uint64_t zp_xattr; 00120 uint64_t zp_rdev; 00121 uint64_t zp_flags; 00122 uint64_t zp_uid; 00123 uint64_t zp_gid; 00124 uint64_t zp_zap; 00125 uint64_t zp_pad[3]; 00126 zfs_acl_phys_t zp_acl; 00127 } znode_phys_t; 00128 00129 #ifdef _KERNEL 00130 int zfs_sa_readlink(struct znode *, uio_t *); 00131 void zfs_sa_symlink(struct znode *, char *link, int len, dmu_tx_t *); 00132 void zfs_sa_upgrade(struct sa_handle *, dmu_tx_t *); 00133 void zfs_sa_get_scanstamp(struct znode *, xvattr_t *); 00134 void zfs_sa_set_scanstamp(struct znode *, xvattr_t *, dmu_tx_t *); 00135 void zfs_sa_uprade_pre(struct sa_handle *, void *, dmu_tx_t *); 00136 void zfs_sa_upgrade_post(struct sa_handle *, void *, dmu_tx_t *); 00137 void zfs_sa_upgrade_txholds(dmu_tx_t *, struct znode *); 00138 #endif 00139 00140 #ifdef __cplusplus 00141 } 00142 #endif 00143 00144 #endif /* _SYS_ZFS_SA_H */