1 /* 2 Copyright 2013-2014 EditShare, 2013-2015 Skytechnology sp. z o.o. 3 4 This file is part of LizardFS. 5 6 LizardFS is free software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, version 3. 9 10 LizardFS is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with LizardFS. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #include "common/platform.h" 20 #include "mount/g_io_limiters.h" 21 22 #include "mount/global_io_limiter.h" 23 gMountLimiter()24ioLimiting::MountLimiter& gMountLimiter() { 25 static ioLimiting::MountLimiter limiter; 26 return limiter; 27 } 28 gLocalIoLimiter()29ioLimiting::LimiterProxy& gLocalIoLimiter() { 30 static ioLimiting::RTClock clock; 31 static ioLimiting::LimiterProxy limiter(gMountLimiter(), clock); 32 return limiter; 33 } 34 gGlobalIoLimiter()35ioLimiting::LimiterProxy& gGlobalIoLimiter() { 36 static ioLimiting::MasterLimiter masterLimiter; 37 static ioLimiting::RTClock clock; 38 static ioLimiting::LimiterProxy limiter(masterLimiter, clock); 39 return limiter; 40 } 41