[PATCH] [Target_Core_Mod/ConfigFS]: Added CONFIGFS_SYSFS_SYMLINKS support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Added allow_link_kobject() and drop_link_kobject() calls to
/sys/kernel/config/target/core/$HBA_$ID/$STORAGE_OBJECT

Then means the following code now works for accessing struct block_device
and struct scsi_device through Linux/BLOCK and Linux/SCSI subsystems
respectively.

export TARGET=/sys/kernel/config/target/core/
export FABRIC=/sys/kernel/config/target/iscsi/

mkdir -p $TARGET/iblock_0/lvm_test0
ln -s /sys/block/dm-2 $TARGET/iblock_0/lvm_test0/dm-2

mkdir -p $TARGET/pscsi_0/sdd
ln -s /sys/block/sdd/device $TARGET/pscsi_0/sdd/passthrough

export DEF_IQN="iqn.2003-01.org.linux-iscsi.target.i686:sn.e475ed6fcdd0"

<SNIP..>

mkdir -p "$FABRIC/$DEF_IQN/tpgt_1/lun/lun_0"
ln -s $TARGET/iblock_0/lvm_test0 "$FABRIC/$DEF_IQN/tpgt_1/lun/lun_0/lio_west_port"
mkdir -p "$FABRIC/$DEF_IQN/tpgt_1/lun/lun_1"
ln -s $TARGET/pscsi_0/sdd "$FABRIC/$DEF_IQN/tpgt_1/lun/lun_1/lio_east_port"

Signed-off-by: Nicholas A. Bellinger
---
 drivers/lio-core/MCONFIG_TARGET          |    1 +
 drivers/lio-core/Makefile                |    3 +
 drivers/lio-core/target_core_configfs.c  |   95 +++++++++++++++++++++++++++++-
 drivers/lio-core/target_core_iblock.c    |   18 ++++++
 drivers/lio-core/target_core_iblock.h    |    2 +
 drivers/lio-core/target_core_plugin.c    |    2 +-
 drivers/lio-core/target_core_pscsi.c     |   20 ++++++
 drivers/lio-core/target_core_pscsi.h     |    2 +
 drivers/lio-core/target_core_transport.h |    4 +
 9 files changed, 145 insertions(+), 2 deletions(-)

The commit can be found at:

http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=commit;h=7549c55a99139de114852f0e0b356f7ec0739b35

The commit that enables kobject symlinks in configfs can be found at:

http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=commit;h=317aefe74354c0140dc8aebff1ef9467b6f0c9ba


Comments Folks..?

--nab

Attachment: 0002-Target_Core_Mod-ConfigFS-Added-CONFIGFS_SYSFS_SYM.patch
Description: application/mbox


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux