[Devel] [PATCH 3/3] Revert "target/iscsi: add an ability to set io limits for iscsi targets"

Andrei Vagin avagin at openvz.org
Sat May 5 01:42:37 MSK 2018


This reverts commit 8edf0797df883502bdd885090bfbd34920866d62.
---
 drivers/target/iscsi/iscsi_target_configfs.c | 46 ----------------------------
 drivers/target/iscsi/iscsi_target_login.c    | 34 +-------------------
 drivers/target/iscsi/iscsi_target_tpg.c      | 36 ----------------------
 drivers/target/iscsi/iscsi_target_tpg.h      |  2 --
 include/target/iscsi/iscsi_target_core.h     |  2 --
 kernel/cgroup.c                              |  1 -
 6 files changed, 1 insertion(+), 120 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c
index f43e975..cf68964 100644
--- a/drivers/target/iscsi/iscsi_target_configfs.c
+++ b/drivers/target/iscsi/iscsi_target_configfs.c
@@ -1412,51 +1412,6 @@ TPG_PARAM_ATTR(IFMarkInt, S_IRUGO | S_IWUSR);
 DEF_TPG_PARAM(OFMarkInt);
 TPG_PARAM_ATTR(OFMarkInt, S_IRUGO | S_IWUSR);
 
-static ssize_t iscsi_tpg_param_show_BlkioCgroup(
-	struct se_portal_group *se_tpg,
-	char *page)
-{
-	struct iscsi_portal_group *tpg = container_of(se_tpg,
-			struct iscsi_portal_group, tpg_se_tpg);
-	ssize_t rb;
-
-	if (iscsit_get_tpg(tpg) < 0)
-		return -EINVAL;
-
-	rb = iscsit_ta_tpg_show_blkcg(tpg, page);
-	iscsit_put_tpg(tpg);
-	return rb;
-}
-
-static ssize_t iscsi_tpg_param_store_BlkioCgroup(
-	struct se_portal_group *se_tpg,
-	const char *page,
-	size_t count)
-{
-	struct iscsi_portal_group *tpg = container_of(se_tpg,
-			struct iscsi_portal_group, tpg_se_tpg);
-	u32 val;
-	int ret;
-
-	if (iscsit_get_tpg(tpg) < 0)
-		return -EINVAL;
-
-	ret = kstrtou32(page, 0, &val);
-	if (ret)
-		goto out;
-	ret = iscsit_ta_tpg_set_blkcg(tpg, val);
-	if (ret < 0)
-		goto out;
-
-	iscsit_put_tpg(tpg);
-	return count;
-out:
-	iscsit_put_tpg(tpg);
-	return ret;
-}
-
-TPG_PARAM_ATTR(BlkioCgroup, S_IRUGO | S_IWUSR);
-
 static struct configfs_attribute *lio_target_tpg_param_attrs[] = {
 	&iscsi_tpg_param_AuthMethod.attr,
 	&iscsi_tpg_param_HeaderDigest.attr,
@@ -1479,7 +1434,6 @@ static struct configfs_attribute *lio_target_tpg_param_attrs[] = {
 	&iscsi_tpg_param_OFMarker.attr,
 	&iscsi_tpg_param_IFMarkInt.attr,
 	&iscsi_tpg_param_OFMarkInt.attr,
-	&iscsi_tpg_param_BlkioCgroup.attr,
 	NULL,
 };
 
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
index 4f59416..c20b561 100644
--- a/drivers/target/iscsi/iscsi_target_login.c
+++ b/drivers/target/iscsi/iscsi_target_login.c
@@ -20,7 +20,6 @@
 #include <linux/string.h>
 #include <linux/kthread.h>
 #include <linux/idr.h>
-#include <linux/cgroup.h>
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
 #include <target/target_core_fabric.h>
@@ -713,18 +712,8 @@ static void iscsi_post_login_start_timers(struct iscsi_conn *conn)
 
 int iscsit_start_kthreads(struct iscsi_conn *conn)
 {
-	struct iscsi_portal_group *tpg = conn->tpg;
-	struct cgroup_subsys_state *blk_css = NULL;
 	int ret = 0;
 
-	if (iscsit_get_tpg(tpg) < 0)
-		return -EINVAL;
-	if (tpg->blk_css) {
-		blk_css = tpg->blk_css;
-		css_get(blk_css);
-	}
-	iscsit_put_tpg(tpg);
-
 	spin_lock(&iscsit_global->ts_bitmap_lock);
 	conn->bitmap_id = bitmap_find_free_region(iscsit_global->ts_bitmap,
 					ISCSIT_BITMAP_BITS, get_order(1));
@@ -733,8 +722,7 @@ int iscsit_start_kthreads(struct iscsi_conn *conn)
 	if (conn->bitmap_id < 0) {
 		pr_err("bitmap_find_free_region() failed for"
 		       " iscsit_start_kthreads()\n");
-		ret = -ENOMEM;
-		goto put_blk_css;
+		return -ENOMEM;
 	}
 
 	conn->tx_thread = kthread_run(iscsi_target_tx_thread, conn,
@@ -744,11 +732,6 @@ int iscsit_start_kthreads(struct iscsi_conn *conn)
 		ret = PTR_ERR(conn->tx_thread);
 		goto out_bitmap;
 	}
-	if (blk_css) {
-		ret = cgroup_kernel_attach(blk_css->cgroup, conn->tx_thread);
-		if (ret < 0)
-			goto out_tx;
-	}
 	conn->tx_thread_active = true;
 
 	conn->rx_thread = kthread_run(iscsi_target_rx_thread, conn,
@@ -758,21 +741,9 @@ int iscsit_start_kthreads(struct iscsi_conn *conn)
 		ret = PTR_ERR(conn->rx_thread);
 		goto out_tx;
 	}
-	if (blk_css) {
-		ret = cgroup_kernel_attach(blk_css->cgroup, conn->rx_thread);
-		if (ret < 0)
-			goto out_rx;
-	}
 	conn->rx_thread_active = true;
 
-	if (blk_css)
-		css_put(blk_css);
-
 	return 0;
-out_rx:
-	send_sig(SIGINT, conn->rx_thread, 1);
-	kthread_stop(conn->rx_thread);
-	conn->rx_thread_active = false;
 out_tx:
 	send_sig(SIGINT, conn->tx_thread, 1);
 	kthread_stop(conn->tx_thread);
@@ -782,9 +753,6 @@ out_bitmap:
 	bitmap_release_region(iscsit_global->ts_bitmap, conn->bitmap_id,
 			      get_order(1));
 	spin_unlock(&iscsit_global->ts_bitmap_lock);
-put_blk_css:
-	if (blk_css)
-		css_put(blk_css);
 	return ret;
 }
 
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
index 8966816..7005d3d 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -16,7 +16,6 @@
  * GNU General Public License for more details.
  ******************************************************************************/
 
-#include <linux/cgroup.h>
 #include <target/target_core_base.h>
 #include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
@@ -301,9 +300,6 @@ int iscsit_tpg_del_portal_group(
 	list_del(&tpg->tpg_list);
 	spin_unlock(&tiqn->tiqn_tpg_lock);
 
-	if (tpg->blk_css)
-		css_put(tpg->blk_css);
-
 	pr_debug("CORE[%s]_TPG[%hu] - Deleted iSCSI Target Portal Group\n",
 			tiqn->tiqn, tpg->tpgt);
 
@@ -897,35 +893,3 @@ int iscsit_ta_tpg_enabled_sendtargets(
 
 	return 0;
 }
-
-int iscsit_ta_tpg_set_blkcg(struct iscsi_portal_group *tpg, u32 flag)
-{
-	struct cgroup_subsys_state *css;
-
-	if (flag != 1)
-		return -EINVAL;
-
-	css = task_get_css(current, blkio_subsys_id);
-	if (tpg->blk_css)
-		css_put(tpg->blk_css);
-	tpg->blk_css = css;
-
-	return 0;
-}
-
-int iscsit_ta_tpg_show_blkcg(struct iscsi_portal_group *tpg, char *page)
-{
-	int rb;
-
-	if (tpg->blk_css) {
-		rb = cgroup_path(tpg->blk_css->cgroup, page, PAGE_SIZE - 1);
-		if (rb == 0)
-			rb = strlen(page);
-		page[rb] = '\n';
-		page[rb + 1] = 0;
-		rb++;
-	} else
-		rb = 0;
-
-	return rb;
-}
diff --git a/drivers/target/iscsi/iscsi_target_tpg.h b/drivers/target/iscsi/iscsi_target_tpg.h
index 416b929..b2f49c0 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.h
+++ b/drivers/target/iscsi/iscsi_target_tpg.h
@@ -40,7 +40,5 @@ extern int iscsit_ta_demo_mode_discovery(struct iscsi_portal_group *, u32);
 extern int iscsit_ta_default_erl(struct iscsi_portal_group *, u32);
 extern int iscsit_ta_t10_pi(struct iscsi_portal_group *, u32);
 extern int iscsit_ta_tpg_enabled_sendtargets(struct iscsi_portal_group *, u32);
-extern int iscsit_ta_tpg_set_blkcg(struct iscsi_portal_group *tpg, u32 flag);
-extern int iscsit_ta_tpg_show_blkcg(struct iscsi_portal_group *tpg, char *page);
 
 #endif /* ISCSI_TARGET_TPG_H */
diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h
index 83eb63b..3e3b2f9 100644
--- a/include/target/iscsi/iscsi_target_core.h
+++ b/include/target/iscsi/iscsi_target_core.h
@@ -838,8 +838,6 @@ struct iscsi_portal_group {
 	struct iscsi_tiqn	*tpg_tiqn;
 	struct list_head	tpg_gnp_list;
 	struct list_head	tpg_list;
-
-	struct cgroup_subsys_state *blk_css;
 } ____cacheline_aligned;
 
 struct iscsi_wwn_stat_grps {
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index e17e952..dd80868 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -5927,7 +5927,6 @@ int cgroup_kernel_attach(struct cgroup *cgrp, struct task_struct *tsk)
 	mutex_unlock(&cgroup_mutex);
 	return ret;
 }
-EXPORT_SYMBOL_GPL(cgroup_kernel_attach);
 
 void cgroup_kernel_close(struct cgroup *cgrp)
 {
-- 
1.8.3.1



More information about the Devel mailing list