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 (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 00023 * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>. 00024 * All rights reserved. 00025 */ 00026 00027 #ifndef _SYS_FS_ZFS_VFSOPS_H 00028 #define _SYS_FS_ZFS_VFSOPS_H 00029 00030 #include <sys/list.h> 00031 #include <sys/vfs.h> 00032 #include <sys/zil.h> 00033 #include <sys/sa.h> 00034 #include <sys/rrwlock.h> 00035 #include <sys/zfs_ioctl.h> 00036 00037 #ifdef __cplusplus 00038 extern "C" { 00039 #endif 00040 00041 typedef struct zfsvfs zfsvfs_t; 00042 struct znode; 00043 00044 struct zfsvfs { 00045 vfs_t *z_vfs; 00046 zfsvfs_t *z_parent; 00047 objset_t *z_os; 00048 uint64_t z_root; 00049 uint64_t z_unlinkedobj; 00050 uint64_t z_max_blksz; 00051 uint64_t z_fuid_obj; 00052 uint64_t z_fuid_size; 00053 avl_tree_t z_fuid_idx; 00054 avl_tree_t z_fuid_domain; 00055 krwlock_t z_fuid_lock; 00056 boolean_t z_fuid_loaded; 00057 boolean_t z_fuid_dirty; 00058 struct zfs_fuid_info *z_fuid_replay; 00059 zilog_t *z_log; 00060 uint_t z_acl_mode; 00061 uint_t z_acl_inherit; 00062 zfs_case_t z_case; 00063 boolean_t z_utf8; 00064 int z_norm; 00065 boolean_t z_atime; 00066 boolean_t z_unmounted; 00067 rrwlock_t z_teardown_lock; 00068 krwlock_t z_teardown_inactive_lock; 00069 list_t z_all_znodes; 00070 kmutex_t z_znodes_lock; 00071 vnode_t *z_ctldir; 00072 boolean_t z_show_ctldir; 00073 boolean_t z_issnap; 00074 boolean_t z_vscan; 00075 boolean_t z_use_fuids; 00076 boolean_t z_replay; 00077 boolean_t z_use_sa; 00078 uint64_t z_version; 00079 uint64_t z_shares_dir; 00080 kmutex_t z_lock; 00081 uint64_t z_userquota_obj; 00082 uint64_t z_groupquota_obj; 00083 uint64_t z_replay_eof; 00084 sa_attr_type_t *z_attr_table; 00085 #define ZFS_OBJ_MTX_SZ 64 00086 kmutex_t z_hold_mtx[ZFS_OBJ_MTX_SZ]; 00087 }; 00088 00108 typedef struct zfid_short { 00109 uint16_t zf_len; 00110 uint8_t zf_object[6]; 00111 uint8_t zf_gen[4]; 00112 } zfid_short_t; 00113 00132 typedef struct zfid_long { 00133 zfid_short_t z_fid; 00134 uint8_t zf_setid[6]; 00135 uint8_t zf_setgen[2]; 00136 } zfid_long_t; 00137 00138 #define SHORT_FID_LEN (sizeof (zfid_short_t) - sizeof (uint16_t)) 00139 #define LONG_FID_LEN (sizeof (zfid_long_t) - sizeof (uint16_t)) 00140 00141 extern uint_t zfs_fsyncer_key; 00142 extern int zfs_super_owner; 00143 00144 extern int zfs_suspend_fs(zfsvfs_t *zfsvfs); 00145 extern int zfs_resume_fs(zfsvfs_t *zfsvfs, const char *osname); 00146 extern int zfs_userspace_one(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, 00147 const char *domain, uint64_t rid, uint64_t *valuep); 00148 extern int zfs_userspace_many(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, 00149 uint64_t *cookiep, void *vbuf, uint64_t *bufsizep); 00150 extern int zfs_set_userquota(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, 00151 const char *domain, uint64_t rid, uint64_t quota); 00152 extern boolean_t zfs_owner_overquota(zfsvfs_t *zfsvfs, struct znode *, 00153 boolean_t isgroup); 00154 extern boolean_t zfs_fuid_overquota(zfsvfs_t *zfsvfs, boolean_t isgroup, 00155 uint64_t fuid); 00156 extern int zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers); 00157 extern int zfsvfs_create(const char *name, zfsvfs_t **zfvp); 00158 extern void zfsvfs_free(zfsvfs_t *zfsvfs); 00159 extern int zfs_check_global_label(const char *dsname, const char *hexsl); 00160 extern int zfs_vnode_lock(vnode_t *vp, int flags); 00161 00162 #ifdef _KERNEL 00163 extern void zfsvfs_update_fromname(const char *oldname, const char *newname); 00164 #endif 00165 00166 #ifdef __cplusplus 00167 } 00168 #endif 00169 00170 #endif /* _SYS_FS_ZFS_VFSOPS_H */