]> git.proxmox.com Git - ceph.git/blame - ceph/src/mds/RecoveryQueue.h
bump version to 19.2.0-pve1
[ceph.git] / ceph / src / mds / RecoveryQueue.h
CommitLineData
7c673cae
FG
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//class C_MDC_Recover;
16//
17#ifndef RECOVERY_QUEUE_H
18#define RECOVERY_QUEUE_H
19
20#include <set>
21
9f95a23c 22#include "include/common_fwd.h"
7c673cae
FG
23#include "osdc/Filer.h"
24
25class CInode;
26class MDSRank;
7c673cae
FG
27
28class RecoveryQueue {
29public:
9f95a23c
TL
30 explicit RecoveryQueue(MDSRank *mds_);
31
7c673cae
FG
32 void enqueue(CInode *in);
33 void advance();
34 void prioritize(CInode *in); ///< do this inode now/soon
7c673cae
FG
35
36 void set_logger(PerfCounters *p) {logger=p;}
37
38private:
9f95a23c
TL
39 friend class C_MDC_Recover;
40
7c673cae 41 void _start(CInode *in); ///< start recovering this file
7c673cae 42 void _recovered(CInode *in, int r, uint64_t size, utime_t mtime);
b32b8144
FG
43
44 size_t file_recover_queue_size = 0;
45 size_t file_recover_queue_front_size = 0;
46
47 elist<CInode*> file_recover_queue; ///< the queue
48 elist<CInode*> file_recover_queue_front; ///< elevated priority items
49 std::map<CInode*, bool> file_recovering; // inode -> need_restart
50
7c673cae 51 MDSRank *mds;
9f95a23c 52 PerfCounters *logger = nullptr;
7c673cae 53 Filer filer;
7c673cae
FG
54};
55
56#endif // RECOVERY_QUEUE_H