[Stgt-devel] [Patch] Merge lu_phy_attr struct into scsi_lu struct

FUJITA Tomonori fujita.tomonori
Fri Jun 15 00:20:47 CEST 2007


From: Mark Harvey <markh794 at gmail.com>
Subject: [Stgt-devel] [Patch] Merge lu_phy_attr struct into scsi_lu struct
Date: Thu, 14 Jun 2007 18:25:15 +1000

> No advantage of having the lu_phy_attr structure. Moved all
> fields into the scsi_lu structure.

I think that it would be nice to have lu_phy_attr for clean
separation.

My preference is (as you did in the previous patch):

struct scsi_lu {
	...
	struct lu_phy_attr attrs;
};


After applying the 'add dynamic lu configuration' patch, I can change
and apply the your previous patch.


> diff --git a/usr/tgtd.h b/usr/tgtd.h
> index 35645b1..a4c787b 100644
> --- a/usr/tgtd.h
> +++ b/usr/tgtd.h
> @@ -30,7 +30,13 @@ struct tgt_cmd_queue {
>  	struct list_head queue;
>  };
>  
> -struct lu_phy_attr {
> +struct scsi_lu {
> +	int fd;
> +	uint64_t addr; /* persistent mapped address */
> +	uint64_t size;
> +	uint64_t lun;
> +	char *path;
> +
>  	char scsi_id[SCSI_ID_LEN];
>  	char scsi_sn[SCSI_SN_LEN];
>  
> @@ -44,14 +50,6 @@ struct lu_phy_attr {
>  	char online;		/* Logical Unit online ? */
>  	char reset;		/* Power-on or reset has occured */
>  	char sense_format;	/* Descrptor format sense data supported */
> -};
> -
> -struct scsi_lu {
> -	int fd;
> -	uint64_t addr; /* persistent mapped address */
> -	uint64_t size;
> -	uint64_t lun;
> -	char *path;
>  
>  	/* the list of devices belonging to a target */
>  	struct list_head device_siblings;
> @@ -63,7 +61,6 @@ struct scsi_lu {
>  	uint64_t reserve_id;
>  
>  	/* TODO: needs a structure for lots of device parameters */
> -	struct lu_phy_attr *attrs;
>  };
>  
>  struct scsi_cmd {
> -- 
> 1.5.2.1
> 
> 
> 
> 
> _______________________________________________
> Stgt-devel mailing list
> Stgt-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/stgt-devel
> 



More information about the stgt mailing list