]> git.proxmox.com Git - ceph.git/blob - ceph/src/os/fs/ZFS.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / os / fs / ZFS.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef CEPH_ZFS_H
5 #define CEPH_ZFS_H
6
7 // Simple wrapper to hide libzfs.h. (it conflicts with standard linux headers)
8 class ZFS {
9 void *g_zfs;
10 public:
11
12 static const int TYPE_FILESYSTEM;
13 static const int TYPE_SNAPSHOT;
14 static const int TYPE_VOLUME;
15 static const int TYPE_POOL;
16 static const int TYPE_DATASET;
17
18 typedef void Handle;
19 typedef int (*iter_func)(Handle *, void *);
20
21 static const char *get_name(Handle *);
22
23 ZFS() : g_zfs(NULL) {}
24 ~ZFS();
25 int init();
26 Handle *open(const char *, int);
27 void close(Handle *);
28 Handle *path_to_zhandle(const char *, int);
29 int create(const char *, int);
30 int snapshot(const char *, bool);
31 int rollback(Handle *, Handle *, bool);
32 int destroy_snaps(Handle *, const char *, bool);
33 int iter_snapshots_sorted(Handle *, iter_func, void *);
34 int mount(Handle *, const char *, int);
35 int umount(Handle *, const char *, int);
36 bool is_mounted(Handle *, char **);
37 };
38
39 #endif