[Devel] [PATCH RHEL7 COMMIT] ub: rename private_data2 to iolimit

Konstantin Khorenko khorenko at virtuozzo.com
Thu Sep 3 04:30:17 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.6.6
------>
commit 2b26765194fd30316e5b34aa72a2c5043bd11e8d
Author: Vladimir Davydov <vdavydov at virtuozzo.com>
Date:   Thu Sep 3 15:29:20 2015 +0400

    ub: rename private_data2 to iolimit
    
    ub->private_data2 is only used for storing iolimit housekeeping struct,
    so call it appropriately.
    
    Signed-off-by: Vladimir Davydov <vdavydov at virtuozzo.com>
---
 include/bc/beancounter.h |  2 +-
 kernel/bc/beancounter.c  |  2 +-
 kernel/ve/vziolimit.c    | 14 +++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/bc/beancounter.h b/include/bc/beancounter.h
index a6241f6..5ba999e 100644
--- a/include/bc/beancounter.h
+++ b/include/bc/beancounter.h
@@ -107,7 +107,7 @@ struct user_beancounter {
 	atomic_long_t		wb_requests;
 	atomic_long_t		wb_sectors;
 
-	void			*private_data2;
+	void			*iolimit;
 
 	/* resources statistic and settings */
 	struct ubparm		ub_parms[UB_RESOURCES];
diff --git a/kernel/bc/beancounter.c b/kernel/bc/beancounter.c
index f9e7fea..90fc1dd 100644
--- a/kernel/bc/beancounter.c
+++ b/kernel/bc/beancounter.c
@@ -364,8 +364,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 1da233d..628ec80 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];



More information about the Devel mailing list