4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_FS_ZFS_DIR_H
27 #define _SYS_FS_ZFS_DIR_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/pathname.h>
33 #include <sys/zfs_znode.h>
39 /* zfs_dirent_lock() flags */
40 #define ZNEW 0x0001 /* entry should not exist */
41 #define ZEXISTS 0x0002 /* entry should exist */
42 #define ZSHARED 0x0004 /* shared access (zfs_dirlook()) */
43 #define ZXATTR 0x0008 /* we want the xattr dir */
44 #define ZRENAMING 0x0010 /* znode is being renamed */
45 #define ZCILOOK 0x0020 /* case-insensitive lookup requested */
46 #define ZCIEXACT 0x0040 /* c-i requires c-s match (rename) */
47 #define ZSAMEDIR 0x0080 /* already hold z_name_lock */
50 #define IS_ROOT_NODE 0x01 /* create a root node */
51 #define IS_XATTR 0x02 /* create an extended attribute node */
52 #define IS_REPLAY 0x04 /* we are replaying intent log */
54 extern int zfs_dirent_lock(zfs_dirlock_t
**, znode_t
*, char *, znode_t
**,
55 int, int *, pathname_t
*);
56 extern void zfs_dirent_unlock(zfs_dirlock_t
*, int);
57 extern int zfs_link_create(zfs_dirlock_t
*, znode_t
*, dmu_tx_t
*, int);
58 extern int zfs_link_destroy(zfs_dirlock_t
*, znode_t
*, dmu_tx_t
*, int,
60 extern int zfs_dirlook(znode_t
*, char *, vnode_t
**, int, int *,
62 extern void zfs_mknode(znode_t
*, vattr_t
*, dmu_tx_t
*, cred_t
*,
63 uint_t
, znode_t
**, int, zfs_acl_t
*, zfs_fuid_info_t
**);
64 extern void zfs_rmnode(znode_t
*);
65 extern void zfs_dl_name_switch(zfs_dirlock_t
*dl
, char *new, char **old
);
66 extern boolean_t
zfs_dirempty(znode_t
*);
67 extern void zfs_unlinked_add(znode_t
*, dmu_tx_t
*);
68 extern void zfs_unlinked_drain(zfsvfs_t
*zfsvfs
);
69 extern int zfs_sticky_remove_access(znode_t
*, znode_t
*, cred_t
*cr
);
70 extern int zfs_get_xattrdir(znode_t
*, vnode_t
**, cred_t
*, int);
71 extern int zfs_make_xattrdir(znode_t
*, vattr_t
*, vnode_t
**, cred_t
*);
77 #endif /* _SYS_FS_ZFS_DIR_H */