Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / common / io_priority.h
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) 2012 Red Hat
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 #ifndef CEPH_COMMON_IO_PRIORITY_H
16 #define CEPH_COMMON_IO_PRIORITY_H
17
18 #include <string>
19
20 extern pid_t ceph_gettid();
21
22 #ifndef IOPRIO_WHO_PROCESS
23 # define IOPRIO_WHO_PROCESS 1
24 #endif
25 #ifndef IOPRIO_PRIO_VALUE
26 # define IOPRIO_CLASS_SHIFT 13
27 # define IOPRIO_PRIO_VALUE(class, data) \
28                 (((class) << IOPRIO_CLASS_SHIFT) | (data))
29 #endif
30 #ifndef IOPRIO_CLASS_RT
31 # define IOPRIO_CLASS_RT 1
32 #endif
33 #ifndef IOPRIO_CLASS_BE
34 # define IOPRIO_CLASS_BE 2
35 #endif
36 #ifndef IOPRIO_CLASS_IDLE
37 # define IOPRIO_CLASS_IDLE 3
38 #endif
39
40 extern int ceph_ioprio_set(int whence, int who, int ioprio);
41
42 extern int ceph_ioprio_string_to_class(const std::string& s);
43
44 #endif