Re: [PATCH 1/2] libata: Remove dependence on host_set->dev for SAS

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

 



On 10/25/05 15:43, Jeff Garzik wrote:
> Brian King wrote:
> 
>>Or, we just live with the duplication...
> 
> 
> That may be the best practical solution.
> 
> I wonder, additionally, if we need to be getting a reference each time 
> we store the pointer.  Traditionally the struct device object lifetime 
> has always been entirely within the bus device lifetime, but with this 
> new work that may need rethinking.

Would it be a good idea to abstract most of this in
say something like 

	struct satl_device_struct {
		-- data... ;
		
		/* The registering entity calls this for SATL to translate
		   to an ATA task(s) and execute. Filled in by the SATL Layer. */
		int (*execute_scsi_task)(struct satl_device_struct *, struct scsi_cmnd *);
		
		/* SATL layer calls this to send an ata_task to the device.
		   Filled in by the registering entity. */
		int (*execute_ata_task)(struct satl_device_struct *, struct ata_task *);

		-- recovery methods common to SATA-over-anything; filled in by registering
			\ entity
	};

(ata task to be properly constructed: FIS, sg lists, etc.)

Then libata-scsi would only have to export two (2) functions:

int  satl_register_device(struct satl_device_struct *);
void satl_unregister_device(struct satl_device_struct *);

EXPORT_SYMBOL_GPL(satl_register_device);
EXPORT_SYMBOL_GPL(satl_unregister_device);

And the rest are in the struct satl_device_struct for which
translation is being provided.

Thus, error handling can also be "commonalized" as per
the entity registering for the service.

The whole point is to have this at device level as opposed
to libata's port level.  Plus it simplifies the code of entities
registering for this service.

<I was going to draw ascii art, but ran out of time>

	Luben
-- 
http://linux.adaptec.com/sas/
http://www.adaptec.com/sas/
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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