[Devel] [PATCH rh7 4/5] ub: rename private_data2 to iolimit

Vladimir Davydov vdavydov at parallels.com
Mon Aug 31 02:17:39 PDT 2015


ub->private_data2 is only used for storing iolimit housekeeping struct,
so call it appropriately.

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 include/bc/beancounter.h |  3 +--
 kernel/bc/beancounter.c  |  2 +-
 kernel/ve/vziolimit.c    | 14 +++++++-------
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/include/bc/beancounter.h b/include/bc/beancounter.h
index c0e88f6b6fcb..85e0f9066243 100644
--- a/include/bc/beancounter.h
+++ b/include/bc/beancounter.h
@@ -107,8 +107,7 @@ struct user_beancounter {
 	atomic_long_t		wb_requests;
 	atomic_long_t		wb_sectors;
 
-	void			*private_data2;
-
+	void			*iolimit;
 	unsigned long		oom_score;
 
 	/* resources statistic and settings */
diff --git a/kernel/bc/beancounter.c b/kernel/bc/beancounter.c
index ee3a6f761965..01726636a776 100644
--- a/kernel/bc/beancounter.c
+++ b/kernel/bc/beancounter.c
@@ -393,8 +393,8 @@ static inline void free_ub(struct user_beancounter *ub)
 {
 	free_percpu(ub->ub_percpu);
 	kfree(ub->ub_store);
-	kfree(ub->private_data2);
 	kfree(ub->ub_name);
+	kfree(ub->iolimit);
 	kfree(ub);
 }
 
diff --git a/kernel/ve/vziolimit.c b/kernel/ve/vziolimit.c
index 1da233d2f89d..628ec805116e 100644
--- a/kernel/ve/vziolimit.c
+++ b/kernel/ve/vziolimit.c
@@ -163,7 +163,7 @@ static int iolimit_virtinfo(struct vnotifier_block *nb,
 		unsigned long cmd, void *arg, int old_ret)
 {
 	struct user_beancounter *ub = get_exec_ub();
-	struct iolimit *iolimit = ub->private_data2;
+	struct iolimit *iolimit = ub->iolimit;
 	unsigned long flags, timeout;
 	struct request_queue *q;
 
@@ -257,7 +257,7 @@ static void throttle_state(struct user_beancounter *ub,
 
 static struct iolimit *iolimit_get(struct user_beancounter *ub)
 {
-	struct iolimit *iolimit = ub->private_data2;
+	struct iolimit *iolimit = ub->iolimit;
 
 	if (iolimit)
 		return iolimit;
@@ -268,11 +268,11 @@ static struct iolimit *iolimit_get(struct user_beancounter *ub)
 	init_waitqueue_head(&iolimit->wq);
 
 	spin_lock_irq(&ub->ub_lock);
-	if (ub->private_data2) {
+	if (ub->iolimit) {
 		kfree(iolimit);
-		iolimit = ub->private_data2;
+		iolimit = ub->iolimit;
 	} else
-		ub->private_data2 = iolimit;
+		ub->iolimit = iolimit;
 	spin_unlock_irq(&ub->ub_lock);
 
 	return iolimit;
@@ -296,7 +296,7 @@ static int iolimit_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	if (!ub)
 		return -ENOENT;
 
-	iolimit = ub->private_data2;
+	iolimit = ub->iolimit;
 
 	switch (cmd) {
 		case VZCTL_SET_IOLIMIT:
@@ -365,7 +365,7 @@ static ssize_t iolimit_cgroup_read(struct cgroup *cg, struct cftype *cft,
 			      size_t nbytes, loff_t *ppos)
 {
 	struct user_beancounter *ub = cgroup_ub(cg);
-	struct iolimit *iolimit = ub->private_data2;
+	struct iolimit *iolimit = ub->iolimit;
 	unsigned long val = 0;
 	int len;
 	char str[32];
-- 
2.1.4




More information about the Devel mailing list