]>
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_
22 * Externally input parameters for a scrub, associated with the root
23 * of where we are doing a recursive scrub
27 ScrubHeader(const std::string
&tag_
, bool force_
, bool recursive_
,
28 bool repair_
, Formatter
*f_
)
29 : tag(tag_
), force(force_
), recursive(recursive_
), repair(repair_
),
30 formatter(f_
), origin(nullptr)
32 assert(formatter
!= nullptr);
35 // Set after construction because it won't be known until we've
36 // started resolving path and locking
37 void set_origin(CInode
*origin_
) { origin
= origin_
; }
39 bool get_recursive() const { return recursive
; }
40 bool get_repair() const { return repair
; }
41 bool get_force() const { return force
; }
42 const CInode
*get_origin() const { return origin
; }
43 const std::string
&get_tag() const { return tag
; }
44 Formatter
&get_formatter() const { return *formatter
; }
46 bool get_repaired() const { return repaired
; }
47 void set_repaired() { repaired
= true; }
50 const std::string tag
;
54 Formatter
* const formatter
;
57 bool repaired
= false; // May be set during scrub if repairs happened
60 typedef ceph::shared_ptr
<ScrubHeader
> ScrubHeaderRef
;
61 typedef ceph::shared_ptr
<const ScrubHeader
> ScrubHeaderRefConst
;
63 #endif // SCRUB_HEADER_H_