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_FS_ZFS_DIR_H 00027 #define _SYS_FS_ZFS_DIR_H 00028 00029 #include <sys/pathname.h> 00030 #include <sys/dmu.h> 00031 #include <sys/zfs_znode.h> 00032 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00037 /* zfs_dirent_lock() flags */ 00038 #define ZNEW 0x0001 00039 #define ZEXISTS 0x0002 00040 #define ZSHARED 0x0004 00041 #define ZXATTR 0x0008 00042 #define ZRENAMING 0x0010 00043 #define ZCILOOK 0x0020 00044 #define ZCIEXACT 0x0040 00045 #define ZHAVELOCK 0x0080 00047 /* mknode flags */ 00048 #define IS_ROOT_NODE 0x01 00049 #define IS_XATTR 0x02 00051 extern int zfs_dirent_lock(zfs_dirlock_t **, znode_t *, char *, znode_t **, 00052 int, int *, pathname_t *); 00053 extern void zfs_dirent_unlock(zfs_dirlock_t *); 00054 extern int zfs_link_create(zfs_dirlock_t *, znode_t *, dmu_tx_t *, int); 00055 extern int zfs_link_destroy(zfs_dirlock_t *, znode_t *, dmu_tx_t *, int, 00056 boolean_t *); 00057 extern int zfs_dirlook(znode_t *, char *, vnode_t **, int, int *, 00058 pathname_t *); 00059 extern void zfs_mknode(znode_t *, vattr_t *, dmu_tx_t *, cred_t *, 00060 uint_t, znode_t **, zfs_acl_ids_t *); 00061 extern void zfs_rmnode(znode_t *); 00062 extern void zfs_dl_name_switch(zfs_dirlock_t *dl, char *new, char **old); 00063 extern boolean_t zfs_dirempty(znode_t *); 00064 extern void zfs_unlinked_add(znode_t *, dmu_tx_t *); 00065 extern void zfs_unlinked_drain(zfsvfs_t *zfsvfs); 00066 extern int zfs_sticky_remove_access(znode_t *, znode_t *, cred_t *cr); 00067 extern int zfs_get_xattrdir(znode_t *, vnode_t **, cred_t *, int); 00068 extern int zfs_make_xattrdir(znode_t *, vattr_t *, vnode_t **, cred_t *); 00069 00070 #ifdef __cplusplus 00071 } 00072 #endif 00073 00074 #endif /* _SYS_FS_ZFS_DIR_H */