]>
git.proxmox.com Git - ceph.git/blob - ceph/src/common/io_priority.cc
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.
16 #if defined(__FreeBSD__)
20 #include <sys/syscall.h> /* For SYS_xxx definitions */
24 #include "io_priority.h"
26 pid_t
ceph_gettid(void)
29 return syscall(SYS_gettid
);
35 int ceph_ioprio_set(int whence
, int who
, int ioprio
)
38 return syscall(SYS_ioprio_set
, whence
, who
, ioprio
);
44 int ceph_ioprio_string_to_class(const std::string
& s
)
47 std::transform(l
.begin(), l
.end(), l
.begin(), ::tolower
);
50 return IOPRIO_CLASS_IDLE
;
51 if (l
== "be" || l
== "besteffort" || l
== "best effort")
52 return IOPRIO_CLASS_BE
;
53 if (l
== "rt" || l
== "realtime" || l
== "real time")
54 return IOPRIO_CLASS_RT
;