Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread Christoph Hellwig
On Thu, Mar 06, 2014 at 10:01:05AM +0100, Hannes Reinecke wrote: I am somewhat reluctant here. Adding separate flags like 'support_vpd_pg83' is a bit pointless, given that we might as well check for vpg_pg83. So the only 'proper' solution would be to add a bitmap of supported pages;

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread Hannes Reinecke
On 03/07/2014 11:11 AM, Christoph Hellwig wrote: On Thu, Mar 06, 2014 at 10:01:05AM +0100, Hannes Reinecke wrote: I am somewhat reluctant here. Adding separate flags like 'support_vpd_pg83' is a bit pointless, given that we might as well check for vpg_pg83. So the only 'proper' solution

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread James Bottomley
On Thu, 2014-03-06 at 10:01 +0100, Hannes Reinecke wrote: So the only 'proper' solution would be to add a bitmap of supported pages; however, this would be 256 bits = 32 bytes of additional space required for struct sdev. Which I'm a bit reluctant do to, as it'll be a sparse array in most

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread Christoph Hellwig
On Fri, Mar 07, 2014 at 02:40:00PM +0400, James Bottomley wrote: On Thu, 2014-03-06 at 10:01 +0100, Hannes Reinecke wrote: So the only 'proper' solution would be to add a bitmap of supported pages; however, this would be 256 bits = 32 bytes of additional space required for struct sdev.

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread Christoph Hellwig
On Fri, Mar 07, 2014 at 11:35:34AM +0100, Hannes Reinecke wrote: Agree. But for now I'd like to keep it as it is (ie without bitmap); there is no real benefit for just the two pages we're exposing right now. Feel free to go ahead as-is. We'll probably have to change it again soon, but we

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread Hannes Reinecke
On 03/07/2014 11:39 AM, James Bottomley wrote: On Thu, 2014-03-06 at 10:01 +0100, Hannes Reinecke wrote: So the only 'proper' solution would be to add a bitmap of supported pages; however, this would be 256 bits = 32 bytes of additional space required for struct sdev. Which I'm a bit

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread James Bottomley
On Fri, 2014-03-07 at 02:43 -0800, Christoph Hellwig wrote: On Fri, Mar 07, 2014 at 02:40:00PM +0400, James Bottomley wrote: On Thu, 2014-03-06 at 10:01 +0100, Hannes Reinecke wrote: So the only 'proper' solution would be to add a bitmap of supported pages; however, this would be 256 bits

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread James Bottomley
On Fri, 2014-03-07 at 11:51 +0100, Hannes Reinecke wrote: On 03/07/2014 11:39 AM, James Bottomley wrote: On Thu, 2014-03-06 at 10:01 +0100, Hannes Reinecke wrote: So the only 'proper' solution would be to add a bitmap of supported pages; however, this would be 256 bits = 32 bytes of

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread Douglas Gilbert
On 14-03-07 12:01 PM, James Bottomley wrote: On Fri, 2014-03-07 at 11:51 +0100, Hannes Reinecke wrote: On 03/07/2014 11:39 AM, James Bottomley wrote: On Thu, 2014-03-06 at 10:01 +0100, Hannes Reinecke wrote: So the only 'proper' solution would be to add a bitmap of supported pages; however,

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-07 Thread Hannes Reinecke
On 03/07/2014 12:01 PM, James Bottomley wrote: On Fri, 2014-03-07 at 11:51 +0100, Hannes Reinecke wrote: On 03/07/2014 11:39 AM, James Bottomley wrote: On Thu, 2014-03-06 at 10:01 +0100, Hannes Reinecke wrote: So the only 'proper' solution would be to add a bitmap of supported pages; however,

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-06 Thread Hannes Reinecke
On 03/05/2014 08:42 PM, Christoph Hellwig wrote: On Wed, Mar 05, 2014 at 08:38:01AM +0100, Hannes Reinecke wrote: Either way I think the call to query evpd 0 should be a separate function, so even if we don't store the information it's abstracted out. Hmm. That would work if we were just

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-05 Thread Christoph Hellwig
On Wed, Mar 05, 2014 at 08:38:01AM +0100, Hannes Reinecke wrote: Either way I think the call to query evpd 0 should be a separate function, so even if we don't store the information it's abstracted out. Hmm. That would work if we were just asking for a single page; but when we're checking

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-04 Thread Hannes Reinecke
On 02/28/2014 06:01 PM, Christoph Hellwig wrote: On Thu, Feb 13, 2014 at 11:07:11AM +0100, Hannes Reinecke wrote: EVPD page 0x83 is used to uniquely identify the device. So instead of having each and every program issue a separate SG_IO call to retrieve this information it does make far more

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-04 Thread Hannes Reinecke
On 03/02/2014 09:36 AM, Bart Van Assche wrote: On 02/13/14 11:28, Hannes Reinecke wrote: -return 0; +return (buffer[2] 8) + buffer[3] + 4; Has it been considered to use get_unaligned_be16() instead of open coding this function ? Ok. Cheers, Hannes -- Dr. Hannes Reinecke

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-04 Thread Hannes Reinecke
On 03/02/2014 09:34 AM, Bart Van Assche wrote: On 02/13/14 11:28, Hannes Reinecke wrote: static ssize_t -show_iostat_counterbits(struct device *dev, struct device_attribute *attr, char *buf) +show_vpd_pg(const unsigned char *pg_buf, int pg_len, char *buf) +{ +

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-02 Thread Bart Van Assche
On 02/13/14 11:28, Hannes Reinecke wrote: static ssize_t -show_iostat_counterbits(struct device *dev, struct device_attribute *attr, char *buf) +show_vpd_pg(const unsigned char *pg_buf, int pg_len, char *buf) +{ + int len = 0, i; + + if (!pg_buf) +

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-03-02 Thread Bart Van Assche
On 02/13/14 11:28, Hannes Reinecke wrote: - return 0; + return (buffer[2] 8) + buffer[3] + 4; Has it been considered to use get_unaligned_be16() instead of open coding this function ? Bart. -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a

Re: [PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-02-28 Thread Christoph Hellwig
On Thu, Feb 13, 2014 at 11:07:11AM +0100, Hannes Reinecke wrote: EVPD page 0x83 is used to uniquely identify the device. So instead of having each and every program issue a separate SG_IO call to retrieve this information it does make far more sense to display it in sysfs. This just shows

[PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-02-13 Thread Hannes Reinecke
EVPD page 0x83 is used to uniquely identify the device. So instead of having each and every program issue a separate SG_IO call to retrieve this information it does make far more sense to display it in sysfs. Cc: Jeremy Linton jlin...@tributary.com Cc: Kay Sievers k...@vrfy.org Cc: Doug Gilbert

[PATCH 2/3] Add EVPD page 0x83 to sysfs

2014-02-13 Thread Hannes Reinecke
EVPD page 0x83 is used to uniquely identify the device. So instead of having each and every program issue a separate SG_IO call to retrieve this information it does make far more sense to display it in sysfs. Cc: Jeremy Linton jlin...@tributary.com Cc: Kay Sievers k...@vrfy.org Cc: Doug Gilbert