[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1315267986-28937-8-git-send-email-fweisbec@gmail.com>
Date: Tue, 6 Sep 2011 02:13:01 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>,
Paul Menage <paul@...lmenage.org>,
Li Zefan <lizf@...fujitsu.com>,
Johannes Weiner <hannes@...xchg.org>,
Aditya Kali <adityakali@...gle.com>,
Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Kay Sievers <kay.sievers@...y.org>,
Tim Hockin <thockin@...kin.org>, Tejun Heo <tj@...nel.org>
Subject: [PATCH 07/12] res_counter: Allow charge failure pointer to be null
So that callers of res_counter_charge() don't have to create and
pass this pointer even if they aren't interested in it.
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Paul Menage <paul@...lmenage.org>
Cc: Li Zefan <lizf@...fujitsu.com>
Cc: Johannes Weiner <hannes@...xchg.org>
Cc: Aditya Kali <adityakali@...gle.com>
Cc: Oleg Nesterov <oleg@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Kay Sievers <kay.sievers@...y.org>
Cc: Tim Hockin <thockin@...kin.org>
Cc: Tejun Heo <tj@...nel.org>
---
kernel/res_counter.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/res_counter.c b/kernel/res_counter.c
index 67a9ae4..4aaa790 100644
--- a/kernel/res_counter.c
+++ b/kernel/res_counter.c
@@ -43,14 +43,16 @@ int res_counter_charge_until(struct res_counter *counter,
unsigned long flags;
struct res_counter *c, *u;
- *limit_fail_at = NULL;
+ if (limit_fail_at)
+ *limit_fail_at = NULL;
local_irq_save(flags);
for (c = counter; c != limit; c = c->parent) {
spin_lock(&c->lock);
ret = res_counter_charge_locked(c, val);
spin_unlock(&c->lock);
if (ret < 0) {
- *limit_fail_at = c;
+ if (limit_fail_at)
+ *limit_fail_at = c;
goto undo;
}
}
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists