]>
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_
21 #include <string_view>
23 #include "include/ceph_assert.h"
32 * Externally input parameters for a scrub, associated with the root
33 * of where we are doing a recursive scrub
37 ScrubHeader(std::string_view tag_
, bool is_tag_internal_
, bool force_
,
38 bool recursive_
, bool repair_
)
39 : tag(tag_
), is_tag_internal(is_tag_internal_
), force(force_
),
40 recursive(recursive_
), repair(repair_
) {}
42 // Set after construction because it won't be known until we've
43 // started resolving path and locking
44 void set_origin(inodeno_t ino
) { origin
= ino
; }
46 bool get_recursive() const { return recursive
; }
47 bool get_repair() const { return repair
; }
48 bool get_force() const { return force
; }
49 bool is_internal_tag() const { return is_tag_internal
; }
50 inodeno_t
get_origin() const { return origin
; }
51 const std::string
& get_tag() const { return tag
; }
53 bool get_repaired() const { return repaired
; }
54 void set_repaired() { repaired
= true; }
56 void set_epoch_last_forwarded(unsigned epoch
) { epoch_last_forwarded
= epoch
; }
57 unsigned get_epoch_last_forwarded() const { return epoch_last_forwarded
; }
59 void inc_num_pending() { ++num_pending
; }
60 void dec_num_pending() {
61 ceph_assert(num_pending
> 0);
64 unsigned get_num_pending() const { return num_pending
; }
67 const std::string tag
;
74 bool repaired
= false; // May be set during scrub if repairs happened
75 unsigned epoch_last_forwarded
= 0;
76 unsigned num_pending
= 0;
79 typedef std::shared_ptr
<ScrubHeader
> ScrubHeaderRef
;
80 typedef std::shared_ptr
<const ScrubHeader
> ScrubHeaderRefConst
;
82 #endif // SCRUB_HEADER_H_