Skip to content

Commit

Permalink
target/iblock: Remove unused iblock_dev members
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rolandd authored and Nicholas Bellinger committed Jul 22, 2011
1 parent 8f3d14e commit 21bca31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
17 changes: 3 additions & 14 deletions drivers/target/target_core_iblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ static struct se_device *iblock_create_virtdevice(
dev_limits.hw_queue_depth = q->nr_requests;
dev_limits.queue_depth = q->nr_requests;

ib_dev->ibd_major = MAJOR(bd->bd_dev);
ib_dev->ibd_minor = MINOR(bd->bd_dev);
ib_dev->ibd_bd = bd;

dev = transport_add_device_to_core_hba(hba,
Expand All @@ -177,8 +175,6 @@ static struct se_device *iblock_create_virtdevice(
if (!(dev))
goto failed;

ib_dev->ibd_depth = dev->queue_depth;

/*
* Check if the underlying struct block_device request_queue supports
* the QUEUE_FLAG_DISCARD bit for UNMAP/WRITE_SAME in SCSI + TRIM
Expand Down Expand Up @@ -208,8 +204,6 @@ static struct se_device *iblock_create_virtdevice(
ib_dev->ibd_bio_set = NULL;
}
ib_dev->ibd_bd = NULL;
ib_dev->ibd_major = 0;
ib_dev->ibd_minor = 0;
return ERR_PTR(ret);
}

Expand Down Expand Up @@ -467,7 +461,7 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
struct iblock_dev *ib_dev = se_dev->se_dev_su_ptr;
char *orig, *ptr, *arg_p, *opts;
substring_t args[MAX_OPT_ARGS];
int ret = 0, arg, token;
int ret = 0, token;

opts = kstrdup(page, GFP_KERNEL);
if (!opts)
Expand Down Expand Up @@ -501,10 +495,6 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
ib_dev->ibd_flags |= IBDF_HAS_UDEV_PATH;
break;
case Opt_force:
match_int(args, &arg);
ib_dev->ibd_force = arg;
printk(KERN_INFO "IBLOCK: Set force=%d\n",
ib_dev->ibd_force);
break;
default:
break;
Expand Down Expand Up @@ -552,12 +542,11 @@ static ssize_t iblock_show_configfs_dev_params(
bl += sprintf(b + bl, " ");
if (bd) {
bl += sprintf(b + bl, "Major: %d Minor: %d %s\n",
ibd->ibd_major, ibd->ibd_minor, (!bd->bd_contains) ?
MAJOR(bd->bd_dev), MINOR(bd->bd_dev), (!bd->bd_contains) ?
"" : (bd->bd_holder == (struct iblock_dev *)ibd) ?
"CLAIMED: IBLOCK" : "CLAIMED: OS");
} else {
bl += sprintf(b + bl, "Major: %d Minor: %d\n",
ibd->ibd_major, ibd->ibd_minor);
bl += sprintf(b + bl, "Major: 0 Minor: 0\n");
}

return bl;
Expand Down
5 changes: 0 additions & 5 deletions drivers/target/target_core_iblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@ struct iblock_req {
} ____cacheline_aligned;

#define IBDF_HAS_UDEV_PATH 0x01
#define IBDF_HAS_FORCE 0x02

struct iblock_dev {
unsigned char ibd_udev_path[SE_UDEV_PATH_LEN];
int ibd_force;
int ibd_major;
int ibd_minor;
u32 ibd_depth;
u32 ibd_flags;
struct bio_set *ibd_bio_set;
struct block_device *ibd_bd;
Expand Down

0 comments on commit 21bca31

Please # to comment.