]> git.proxmox.com Git - ceph.git/blob - ceph/src/osd/mClockOpClassQueue.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / osd / mClockOpClassQueue.cc
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) 2016 Red Hat Inc.
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
16 #include <memory>
17
18 #include "osd/mClockOpClassQueue.h"
19 #include "common/dout.h"
20
21 namespace dmc = crimson::dmclock;
22 using namespace std::placeholders;
23
24 #define dout_context cct
25 #define dout_subsys ceph_subsys_osd
26 #undef dout_prefix
27 #define dout_prefix *_dout
28
29
30 namespace ceph {
31
32 /*
33 * class mClockOpClassQueue
34 */
35
36 mClockOpClassQueue::mClockOpClassQueue(CephContext *cct) :
37 queue(std::bind(&mClockOpClassQueue::op_class_client_info_f, this, _1),
38 cct->_conf->osd_op_queue_mclock_anticipation_timeout),
39 client_info_mgr(cct)
40 {
41 // empty
42 }
43
44 const dmc::ClientInfo* mClockOpClassQueue::op_class_client_info_f(
45 const osd_op_type_t& op_type)
46 {
47 return client_info_mgr.get_client_info(op_type);
48 }
49
50 // Formatted output of the queue
51 void mClockOpClassQueue::dump(ceph::Formatter *f) const {
52 queue.dump(f);
53 }
54 } // namespace ceph