]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[SCSI] scsi_debug: call map_region() and unmap_region() only when needed
authorAkinobu Mita <akinobu.mita@gmail.com>
Tue, 16 Apr 2013 13:11:55 +0000 (22:11 +0900)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 2 May 2013 22:39:04 +0000 (15:39 -0700)
commit9ed8d3dc5b46f86ab9117937bd24427ac10e8de5
tree0a09ac5278743d2e3054822770818ed3f93ede73
parent025a1f5029497c12a800a10d4540bf2313413b59
[SCSI] scsi_debug: call map_region() and unmap_region() only when needed

If the logical block provisioning is not enabled, map_region() and
unmap_region() have no effect and they don't need to be called.

So this makes map_region() and unmap_region() to be called only
when scsi_debug_lbp() returns true, i.e. logical block provisioning is
enabled.

While I'm at it, this also removes meaningless non-zero check for
scsi_debug_unmap_granularity.

Because scsi_debug_unmap_granularity cannot be zero with usual setting:
scsi_debug_unmap_granularity is 1 by default, and it can be changed to
zero with explicit module parameter setting only when the logical block
provisioning is disabled.  But it is only meaningful module parameter
when the logical block provisioning is enabled.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi_debug.c