hammer2 - Config notifications, cleanup HAMMER2 VFS API
[dragonfly.git] / sys / vfs / hammer2 / hammer2_ioctl.h
CommitLineData
2910a90c
MD
1/*
2 * Copyright (c) 2011-2012 The DragonFly Project. All rights reserved.
3 *
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@dragonflybsd.org>
6 * by Venkatesh Srinivas <vsrinivas@dragonflybsd.org>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * 3. Neither the name of The DragonFly Project nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific, prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 */
35#ifndef VFS_HAMMER2_IOCTL_H_
36#define VFS_HAMMER2_IOCTL_H_
37
38#ifndef _SYS_IOCCOM_H_
39#include <sys/ioccom.h>
40#endif
41#ifndef _VFS_HAMMER2_DISK_H_
42#include "hammer2_disk.h"
43#endif
44#ifndef _VFS_HAMMER2_MOUNT_H_
45#include "hammer2_mount.h"
46#endif
47
48/*
49 * get_version
50 */
51struct hammer2_ioc_version {
52 int version;
53 char reserved[256 - 4];
54};
55
56typedef struct hammer2_ioc_version hammer2_ioc_version_t;
57
1a34728c
MD
58struct hammer2_ioc_recluster {
59 int fd;
60 char reserved[256 - 4];
61};
62
63typedef struct hammer2_ioc_recluster hammer2_ioc_recluster_t;
64
2910a90c
MD
65/*
66 * Ioctls to manage the volume->copyinfo[] array and to associate or
67 * disassociate sockets
68 */
69struct hammer2_ioc_remote {
70 int copyid;
71 int nextid; /* for iteration (get only) */
72 int fd; /* socket descriptor if applicable */
73 int reserved03;
74 int reserved04[8];
75 hammer2_copy_data_t copy1; /* copy spec */
76 hammer2_copy_data_t copy2; /* copy spec (rename ops only) */
77};
78
79typedef struct hammer2_ioc_remote hammer2_ioc_remote_t;
80
ae183399
MD
81/*
82 * Ioctls to manage PFSs
83 *
8c280d5d 84 * PFSs can be clustered by matching their pfs_clid, and the PFSs making up
ae183399 85 * a cluster can be uniquely identified by combining the vol_id with
8c280d5d 86 * the pfs_clid.
ae183399
MD
87 */
88struct hammer2_ioc_pfs {
89 hammer2_key_t name_key; /* super-root directory scan */
90 hammer2_key_t name_next; /* (GET only) */
91 uint8_t pfs_type; /* e.g. MASTER, SLAVE, ... */
92 uint8_t reserved0011;
93 uint8_t reserved0012;
94 uint8_t reserved0013;
95 uint32_t reserved0014;
96 uint64_t reserved0018;
97 uuid_t pfs_fsid; /* identifies PFS instance */
8c280d5d 98 uuid_t pfs_clid; /* identifies PFS cluster */
ae183399
MD
99 char name[NAME_MAX+1]; /* device@name mtpt */
100};
101
102typedef struct hammer2_ioc_pfs hammer2_ioc_pfs_t;
103
344d4f82
MD
104/*
105 * Ioctls to manage inodes
106 */
107struct hammer2_ioc_inode {
108 uint32_t flags;
26b047fa 109 void *kdata;
344d4f82
MD
110 hammer2_inode_data_t ip_data;
111};
112
113typedef struct hammer2_ioc_inode hammer2_ioc_inode_t;
114
115#define HAMMER2IOC_INODE_FLAG_IQUOTA 0x00000001
116#define HAMMER2IOC_INODE_FLAG_DQUOTA 0x00000002
117#define HAMMER2IOC_INODE_FLAG_COPIES 0x00000004
118
119/*
120 * Ioctl list
121 */
122
ae183399 123#define HAMMER2IOC_VERSION_GET _IOWR('h', 64, struct hammer2_ioc_version)
1a34728c 124#define HAMMER2IOC_RECLUSTER _IOWR('h', 65, struct hammer2_ioc_recluster)
ae183399 125
1a34728c 126#define HAMMER2IOC_REMOTE_SCAN _IOWR('h', 68, struct hammer2_ioc_remote)
ae183399
MD
127#define HAMMER2IOC_REMOTE_ADD _IOWR('h', 69, struct hammer2_ioc_remote)
128#define HAMMER2IOC_REMOTE_DEL _IOWR('h', 70, struct hammer2_ioc_remote)
129#define HAMMER2IOC_REMOTE_REP _IOWR('h', 71, struct hammer2_ioc_remote)
2910a90c 130
ae183399
MD
131#define HAMMER2IOC_SOCKET_GET _IOWR('h', 76, struct hammer2_ioc_remote)
132#define HAMMER2IOC_SOCKET_SET _IOWR('h', 77, struct hammer2_ioc_remote)
2910a90c 133
ae183399
MD
134#define HAMMER2IOC_PFS_GET _IOWR('h', 80, struct hammer2_ioc_pfs)
135#define HAMMER2IOC_PFS_CREATE _IOWR('h', 81, struct hammer2_ioc_pfs)
136#define HAMMER2IOC_PFS_DELETE _IOWR('h', 82, struct hammer2_ioc_pfs)
458ecb1b 137#define HAMMER2IOC_PFS_LOOKUP _IOWR('h', 83, struct hammer2_ioc_pfs)
2910a90c 138
344d4f82
MD
139#define HAMMER2IOC_INODE_GET _IOWR('h', 86, struct hammer2_ioc_inode)
140#define HAMMER2IOC_INODE_SET _IOWR('h', 87, struct hammer2_ioc_inode)
141
2910a90c 142#endif