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 */ 00024 00025 #ifndef _ZFS_CTLDIR_H 00026 #define _ZFS_CTLDIR_H 00027 00028 #include <sys/vnode.h> 00029 #include <sys/zfs_vfsops.h> 00030 #include <sys/zfs_znode.h> 00031 00032 #ifdef __cplusplus 00033 extern "C" { 00034 #endif 00035 00036 #define ZFS_CTLDIR_NAME ".zfs" 00037 00038 #define zfs_has_ctldir(zdp) \ 00039 ((zdp)->z_id == (zdp)->z_zfsvfs->z_root && \ 00040 ((zdp)->z_zfsvfs->z_ctldir != NULL)) 00041 #define zfs_show_ctldir(zdp) \ 00042 (zfs_has_ctldir(zdp) && \ 00043 ((zdp)->z_zfsvfs->z_show_ctldir)) 00044 00045 void zfsctl_create(zfsvfs_t *); 00046 void zfsctl_destroy(zfsvfs_t *); 00047 vnode_t *zfsctl_root(znode_t *); 00048 void zfsctl_init(void); 00049 void zfsctl_fini(void); 00050 boolean_t zfsctl_is_node(vnode_t *); 00051 00052 int zfsctl_rename_snapshot(const char *from, const char *to); 00053 int zfsctl_destroy_snapshot(const char *snapname, int force); 00054 int zfsctl_umount_snapshots(vfs_t *, int, cred_t *); 00055 00056 int zfsctl_root_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, pathname_t *pnp, 00057 int flags, vnode_t *rdir, cred_t *cr, caller_context_t *ct, 00058 int *direntflags, pathname_t *realpnp); 00059 00060 int zfsctl_lookup_objset(vfs_t *vfsp, uint64_t objsetid, zfsvfs_t **zfsvfsp); 00061 00062 #define ZFSCTL_INO_ROOT 0x1 00063 #define ZFSCTL_INO_SNAPDIR 0x2 00064 #define ZFSCTL_INO_SHARES 0x3 00065 00066 #ifdef __cplusplus 00067 } 00068 #endif 00069 00070 #endif /* _ZFS_CTLDIR_H */