Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / os / filestore / BtrfsFileStoreBackend.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph - scalable distributed file system
5  *
6  * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7  *
8  * This is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License version 2.1, as published by the Free Software
11  * Foundation.  See file COPYING.
12  *
13  */
14
15 #ifndef CEPH_BTRFSFILESTOREBACKEDN_H
16 #define CEPH_BTRFSFILESTOREBACKEDN_H
17
18 #if defined(__linux__)
19 #include "GenericFileStoreBackend.h"
20
21 class BtrfsFileStoreBackend : public GenericFileStoreBackend {
22 private:
23   bool has_clone_range;       ///< clone range ioctl is supported
24   bool has_snap_create;       ///< snap create ioctl is supported
25   bool has_snap_destroy;      ///< snap destroy ioctl is supported
26   bool has_snap_create_v2;    ///< snap create v2 ioctl (async!) is supported
27   bool has_wait_sync;         ///< wait sync ioctl is supported
28   bool stable_commits;
29   bool m_filestore_btrfs_clone_range;
30   bool m_filestore_btrfs_snap;
31 public:
32   explicit BtrfsFileStoreBackend(FileStore *fs);
33   ~BtrfsFileStoreBackend() override {}
34   const char *get_name() override {
35     return "btrfs";
36   }
37   int detect_features() override;
38   bool can_checkpoint() override;
39   int create_current() override;
40   int list_checkpoints(list<string>& ls) override;
41   int create_checkpoint(const string& name, uint64_t *cid) override;
42   int sync_checkpoint(uint64_t cid) override;
43   int rollback_to(const string& name) override;
44   int destroy_checkpoint(const string& name) override;
45   int syncfs() override;
46   int clone_range(int from, int to, uint64_t srcoff, uint64_t len, uint64_t dstoff) override;
47 };
48 #endif
49 #endif