Skip to contentSkip to conversation

- export scsilun_to_int

PATCH In review Eric Moore 2 participants 2 messages Jan 29, 2007 – Jan 31, 2007 SCSI

lore
Share & tools
lore

Eric Moore

author
#0 lore raw

PATCH 1/1 - export scsilun_to_int

export symbol to be used in 1st fusion patch

drivers/scsi/scsi_scan.c +2 -1
diff -uarpN b/drivers/scsi/scsi_scan.c a/drivers/scsi/scsi_scan.c
@@ -1192,7 +1192,7 @@ static void scsi_sequential_lun_scan(str
  *     Given a struct scsi_lun of: 0a 04 0b 03 00 00 00 00, this function returns
  *     the integer: 0x0b030a04
  **/
-static int scsilun_to_int(struct scsi_lun *scsilun)
+int scsilun_to_int(struct scsi_lun *scsilun)
 {
 	int i;
 	unsigned int lun;
@@ -1203,6 +1203,7 @@ static int scsilun_to_int(struct scsi_lu
 			      scsilun->scsi_lun[i + 1]) << (i * 8));
 	return lun;
 }
+EXPORT_SYMBOL(scsilun_to_int);
 
 /**
  * int_to_scsilun: reverts an int into a scsi_lun
include/scsi/scsi_device.h +1 -0
diff -uarpN b/include/scsi/scsi_device.h a/include/scsi/scsi_device.h
@@ -281,6 +281,7 @@ extern void scsi_target_block(struct dev
 extern void scsi_target_unblock(struct device *);
 extern void scsi_remove_target(struct device *);
 extern void int_to_scsilun(unsigned int, struct scsi_lun *);
+extern int scsilun_to_int(struct scsi_lun *scsilun);
 extern const char *scsi_device_state_name(enum scsi_device_state);
 extern int scsi_is_sdev_device(const struct device *);
 extern int scsi_is_target_device(const struct device *);
#1 lore raw
Quoted 3 lines · Eric Moore

export symbol to be used in 1st fusion patch

This is wrong. the "int" represents our internal coding of the 8 byte extended LUN (currently it's a lossy transform that only allows up to two level LUNs, so one day this will definitely change). No driver should be using this internally. From the patches it merely looks like you want to print out the value of a struct scsilun in debugging code, so perhaps a simple print_scsilun or something would be better?

James