]>
git.proxmox.com Git - ceph.git/blob - ceph/src/mds/ScrubHeader.h
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) 2016 Red Hat Inc
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.
16 #ifndef SCRUB_HEADER_H_
17 #define SCRUB_HEADER_H_
19 #include <string_view>
24 * Externally input parameters for a scrub, associated with the root
25 * of where we are doing a recursive scrub
29 ScrubHeader(std::string_view tag_
, bool is_tag_internal_
, bool force_
,
30 bool recursive_
, bool repair_
, Formatter
*f_
)
31 : tag(tag_
), is_tag_internal(is_tag_internal_
), force(force_
),
32 recursive(recursive_
), repair(repair_
), formatter(f_
)
34 ceph_assert(formatter
!= nullptr);
37 // Set after construction because it won't be known until we've
38 // started resolving path and locking
39 void set_origin(CInode
*origin_
) { origin
= origin_
; }
41 bool get_recursive() const { return recursive
; }
42 bool get_repair() const { return repair
; }
43 bool get_force() const { return force
; }
44 bool is_internal_tag() const { return is_tag_internal
; }
45 CInode
*get_origin() const { return origin
; }
46 std::string_view
get_tag() const { return tag
; }
47 Formatter
&get_formatter() const { return *formatter
; }
49 bool get_repaired() const { return repaired
; }
50 void set_repaired() { repaired
= true; }
53 const std::string tag
;
58 Formatter
* const formatter
;
59 CInode
*origin
= nullptr;
61 bool repaired
= false; // May be set during scrub if repairs happened
64 typedef std::shared_ptr
<ScrubHeader
> ScrubHeaderRef
;
65 typedef std::shared_ptr
<const ScrubHeader
> ScrubHeaderRefConst
;
67 #endif // SCRUB_HEADER_H_