diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-03-21 00:26:48 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-04-14 19:04:58 -0400 |
commit | 58d926187758f76647d68e2f51ce44e6ace81873 (patch) | |
tree | c877294c394ab14cbdeca4af1a3e7835d644f73b /drivers/target | |
parent | 0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff) |
target: Remove obsolete DF_READ_ONLY usage
This was used at one time as a hack by FILEIO backend registration to
allow a struct block_device that was claimed with blkdev_get (by a local
filesystem mount for example) to be exported as read-only (SCSI WP=1).
Since FILEIO backend registration will no longer attempt to obtain
exclusive access to an underlying struct block_device here, this flag is
now obsolete.
Reported-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_device.c | 9 | ||||
-rw-r--r-- | drivers/target/target_core_tpg.c | 5 |
2 files changed, 3 insertions, 11 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index aa6267746383..d175ee260a06 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c | |||
@@ -1341,7 +1341,6 @@ struct se_lun *core_dev_add_lun( | |||
1341 | u32 lun) | 1341 | u32 lun) |
1342 | { | 1342 | { |
1343 | struct se_lun *lun_p; | 1343 | struct se_lun *lun_p; |
1344 | u32 lun_access = 0; | ||
1345 | int rc; | 1344 | int rc; |
1346 | 1345 | ||
1347 | if (atomic_read(&dev->dev_access_obj.obj_access_count) != 0) { | 1346 | if (atomic_read(&dev->dev_access_obj.obj_access_count) != 0) { |
@@ -1354,12 +1353,8 @@ struct se_lun *core_dev_add_lun( | |||
1354 | if (IS_ERR(lun_p)) | 1353 | if (IS_ERR(lun_p)) |
1355 | return lun_p; | 1354 | return lun_p; |
1356 | 1355 | ||
1357 | if (dev->dev_flags & DF_READ_ONLY) | 1356 | rc = core_tpg_post_addlun(tpg, lun_p, |
1358 | lun_access = TRANSPORT_LUNFLAGS_READ_ONLY; | 1357 | TRANSPORT_LUNFLAGS_READ_WRITE, dev); |
1359 | else | ||
1360 | lun_access = TRANSPORT_LUNFLAGS_READ_WRITE; | ||
1361 | |||
1362 | rc = core_tpg_post_addlun(tpg, lun_p, lun_access, dev); | ||
1363 | if (rc < 0) | 1358 | if (rc < 0) |
1364 | return ERR_PTR(rc); | 1359 | return ERR_PTR(rc); |
1365 | 1360 | ||
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index 70c3ffb981e7..c672a40cbfe2 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c | |||
@@ -175,10 +175,7 @@ void core_tpg_add_node_to_devs( | |||
175 | * demo_mode_write_protect is ON, or READ_ONLY; | 175 | * demo_mode_write_protect is ON, or READ_ONLY; |
176 | */ | 176 | */ |
177 | if (!tpg->se_tpg_tfo->tpg_check_demo_mode_write_protect(tpg)) { | 177 | if (!tpg->se_tpg_tfo->tpg_check_demo_mode_write_protect(tpg)) { |
178 | if (dev->dev_flags & DF_READ_ONLY) | 178 | lun_access = TRANSPORT_LUNFLAGS_READ_WRITE; |
179 | lun_access = TRANSPORT_LUNFLAGS_READ_ONLY; | ||
180 | else | ||
181 | lun_access = TRANSPORT_LUNFLAGS_READ_WRITE; | ||
182 | } else { | 179 | } else { |
183 | /* | 180 | /* |
184 | * Allow only optical drives to issue R/W in default RO | 181 | * Allow only optical drives to issue R/W in default RO |