]> git.baikalelectronics.ru Git - kernel.git/commit
tcm_loop: Show address of tpg in configfs
authorSheng Yang <sheng@yasker.org>
Sat, 14 Nov 2015 22:17:16 +0000 (14:17 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 29 Nov 2015 11:01:45 +0000 (03:01 -0800)
commitc1efc2322da0354d19192458cda49e5e8f972b4b
tree632ad805862f0b022c668ed5d0192eb4a0e37a58
parentdb40e31ebbf3ef7dc8769277dd7bd9cc45daf866
tcm_loop: Show address of tpg in configfs

In the past, the scsi_host's number wasn't shown anywhere, user have
to depends on vpg_83 to find the block device, which is also depends
on backstore implementation.

It's better for tcm_loop to provide necessary straightforward
information on locate the block device it created.

This patch would help to locate the block device created by tcm_loop.
The address would be shown at e.g.

  /sys/kernel/config/target/loopback/naa.60014059436855c1/tpgt_1/address

which would looks like "2:0:1", and the lun number can be found at
"/tpgt_1/lun/lun_0".  Altogether they formated the scsi address of
device as "2:0:1:0", which can be used to locate the device easily
through 'lsscsi'.

(Update to >= v4.4-rc1 configfs attribute usage - nab)

Signed-off-by: Sheng Yang <sheng@yasker.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/loopback/tcm_loop.c