From 2d2f7c9d41b87b1cb9877c0dc5a116a42415ecd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 25 Nov 2013 15:27:33 +0100 Subject: [PATCH] Feature #2494: The scheduler looks for LIMIT_MB in DS template --- src/scheduler/src/pool/DatastoreXML.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/scheduler/src/pool/DatastoreXML.cc b/src/scheduler/src/pool/DatastoreXML.cc index 93d47bcc59..51af194018 100644 --- a/src/scheduler/src/pool/DatastoreXML.cc +++ b/src/scheduler/src/pool/DatastoreXML.cc @@ -43,6 +43,19 @@ void DatastoreXML::init_attributes() monitored = (free_mb != 0 || total_mb != 0 || used_mb != 0); + vector strings = ((*this)["/DATASTORE/TEMPLATE/LIMIT_MB"]); + + if (!strings.empty()) + { + long long limit_mb = atoll(strings[0].c_str()); + long long free_limited = limit_mb - (total_mb - free_mb); + + if (free_limited < free_mb) + { + free_mb = free_limited; + } + } + string shared_st; this->xpath(shared_st, "/DATASTORE/TEMPLATE/SHARED", "YES");