aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2011-07-05 18:35:02 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-07-22 05:37:46 -0400
commit21bca31c9678edda8eb1dc823be00d190965c53b (patch)
treebef78367227b6d71a25e7842ea9b6c419df844b1 /drivers/target
parent8f3d14e2b0352e41c8e64a39c95c7d9498c96e89 (diff)
target/iblock: Remove unused iblock_dev members
ibd_depth and ibd_force are used write-only. Remove them. ibd_major/minor can be easily retrieved from ibd_bd, so get rid of them too. Signed-off-by: Roland Dreier <roland@purestorage.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_iblock.c17
-rw-r--r--drivers/target/target_core_iblock.h5
2 files changed, 3 insertions, 19 deletions
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index d43fc910a4fa..160c484fd3da 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -167,8 +167,6 @@ static struct se_device *iblock_create_virtdevice(
167 dev_limits.hw_queue_depth = q->nr_requests; 167 dev_limits.hw_queue_depth = q->nr_requests;
168 dev_limits.queue_depth = q->nr_requests; 168 dev_limits.queue_depth = q->nr_requests;
169 169
170 ib_dev->ibd_major = MAJOR(bd->bd_dev);
171 ib_dev->ibd_minor = MINOR(bd->bd_dev);
172 ib_dev->ibd_bd = bd; 170 ib_dev->ibd_bd = bd;
173 171
174 dev = transport_add_device_to_core_hba(hba, 172 dev = transport_add_device_to_core_hba(hba,
@@ -177,8 +175,6 @@ static struct se_device *iblock_create_virtdevice(
177 if (!(dev)) 175 if (!(dev))
178 goto failed; 176 goto failed;
179 177
180 ib_dev->ibd_depth = dev->queue_depth;
181
182 /* 178 /*
183 * Check if the underlying struct block_device request_queue supports 179 * Check if the underlying struct block_device request_queue supports
184 * the QUEUE_FLAG_DISCARD bit for UNMAP/WRITE_SAME in SCSI + TRIM 180 * the QUEUE_FLAG_DISCARD bit for UNMAP/WRITE_SAME in SCSI + TRIM
@@ -208,8 +204,6 @@ failed:
208 ib_dev->ibd_bio_set = NULL; 204 ib_dev->ibd_bio_set = NULL;
209 } 205 }
210 ib_dev->ibd_bd = NULL; 206 ib_dev->ibd_bd = NULL;
211 ib_dev->ibd_major = 0;
212 ib_dev->ibd_minor = 0;
213 return ERR_PTR(ret); 207 return ERR_PTR(ret);
214} 208}
215 209
@@ -467,7 +461,7 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
467 struct iblock_dev *ib_dev = se_dev->se_dev_su_ptr; 461 struct iblock_dev *ib_dev = se_dev->se_dev_su_ptr;
468 char *orig, *ptr, *arg_p, *opts; 462 char *orig, *ptr, *arg_p, *opts;
469 substring_t args[MAX_OPT_ARGS]; 463 substring_t args[MAX_OPT_ARGS];
470 int ret = 0, arg, token; 464 int ret = 0, token;
471 465
472 opts = kstrdup(page, GFP_KERNEL); 466 opts = kstrdup(page, GFP_KERNEL);
473 if (!opts) 467 if (!opts)
@@ -501,10 +495,6 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
501 ib_dev->ibd_flags |= IBDF_HAS_UDEV_PATH; 495 ib_dev->ibd_flags |= IBDF_HAS_UDEV_PATH;
502 break; 496 break;
503 case Opt_force: 497 case Opt_force:
504 match_int(args, &arg);
505 ib_dev->ibd_force = arg;
506 printk(KERN_INFO "IBLOCK: Set force=%d\n",
507 ib_dev->ibd_force);
508 break; 498 break;
509 default: 499 default:
510 break; 500 break;
@@ -552,12 +542,11 @@ static ssize_t iblock_show_configfs_dev_params(
552 bl += sprintf(b + bl, " "); 542 bl += sprintf(b + bl, " ");
553 if (bd) { 543 if (bd) {
554 bl += sprintf(b + bl, "Major: %d Minor: %d %s\n", 544 bl += sprintf(b + bl, "Major: %d Minor: %d %s\n",
555 ibd->ibd_major, ibd->ibd_minor, (!bd->bd_contains) ? 545 MAJOR(bd->bd_dev), MINOR(bd->bd_dev), (!bd->bd_contains) ?
556 "" : (bd->bd_holder == (struct iblock_dev *)ibd) ? 546 "" : (bd->bd_holder == (struct iblock_dev *)ibd) ?
557 "CLAIMED: IBLOCK" : "CLAIMED: OS"); 547 "CLAIMED: IBLOCK" : "CLAIMED: OS");
558 } else { 548 } else {
559 bl += sprintf(b + bl, "Major: %d Minor: %d\n", 549 bl += sprintf(b + bl, "Major: 0 Minor: 0\n");
560 ibd->ibd_major, ibd->ibd_minor);
561 } 550 }
562 551
563 return bl; 552 return bl;
diff --git a/drivers/target/target_core_iblock.h b/drivers/target/target_core_iblock.h
index a69b7c28de92..2aa1d27a49b9 100644
--- a/drivers/target/target_core_iblock.h
+++ b/drivers/target/target_core_iblock.h
@@ -16,14 +16,9 @@ struct iblock_req {
16} ____cacheline_aligned; 16} ____cacheline_aligned;
17 17
18#define IBDF_HAS_UDEV_PATH 0x01 18#define IBDF_HAS_UDEV_PATH 0x01
19#define IBDF_HAS_FORCE 0x02
20 19
21struct iblock_dev { 20struct iblock_dev {
22 unsigned char ibd_udev_path[SE_UDEV_PATH_LEN]; 21 unsigned char ibd_udev_path[SE_UDEV_PATH_LEN];
23 int ibd_force;
24 int ibd_major;
25 int ibd_minor;
26 u32 ibd_depth;
27 u32 ibd_flags; 22 u32 ibd_flags;
28 struct bio_set *ibd_bio_set; 23 struct bio_set *ibd_bio_set;
29 struct block_device *ibd_bd; 24 struct block_device *ibd_bd;