]>
git.proxmox.com Git - ceph.git/blob - 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
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2012 Red Hat
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.
15 #ifndef CEPH_COMMON_IO_PRIORITY_H
16 #define CEPH_COMMON_IO_PRIORITY_H
20 extern pid_t
ceph_gettid();
22 #ifndef IOPRIO_WHO_PROCESS
23 # define IOPRIO_WHO_PROCESS 1
25 #ifndef IOPRIO_PRIO_VALUE
26 # define IOPRIO_CLASS_SHIFT 13
27 # define IOPRIO_PRIO_VALUE(class, data) \
28 (((class) << IOPRIO_CLASS_SHIFT) | (data))
30 #ifndef IOPRIO_CLASS_RT
31 # define IOPRIO_CLASS_RT 1
33 #ifndef IOPRIO_CLASS_BE
34 # define IOPRIO_CLASS_BE 2
36 #ifndef IOPRIO_CLASS_IDLE
37 # define IOPRIO_CLASS_IDLE 3
40 extern int ceph_ioprio_set(int whence
, int who
, int ioprio
);
42 extern int ceph_ioprio_string_to_class(const std::string
& s
);