1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
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.
15 #ifndef CEPH_BTRFSFILESTOREBACKEDN_H
16 #define CEPH_BTRFSFILESTOREBACKEDN_H
18 #if defined(__linux__)
19 #include "GenericFileStoreBackend.h"
21 class BtrfsFileStoreBackend
: public GenericFileStoreBackend
{
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
29 bool m_filestore_btrfs_clone_range
;
30 bool m_filestore_btrfs_snap
;
32 explicit BtrfsFileStoreBackend(FileStore
*fs
);
33 ~BtrfsFileStoreBackend() override
{}
34 const char *get_name() override
{
37 int detect_features() override
;
38 bool can_checkpoint() override
;
39 int create_current() override
;
40 int list_checkpoints(std::list
<std::string
>& ls
) override
;
41 int create_checkpoint(const std::string
& name
, uint64_t *cid
) override
;
42 int sync_checkpoint(uint64_t cid
) override
;
43 int rollback_to(const std::string
& name
) override
;
44 int destroy_checkpoint(const std::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
;