imbvscsi: use 4k buffer to transfer config data
Subsystems (3)
PATCH 1/1 imbvscsi: use 4k buffer to transfer config data
Hi James,
This patch changes the size of the buffer used for transfering config data to 4K. It was tested against 2.6.19-rc2 tree.
Please consider it for inclusion in upstream.
Thanks,
Linda Xie
IBM LTC
drivers/scsi/ibmvscsi/ibmvscsi.c +9 -7
@@ -86,8 +86,10 @@ static int max_id = 64;static int max_channel =3 ;static int init_timeout =5 ;static int max_requests =50 ; +/* host data buffer size */ +#define buff_size 4096 -#define IBMVSCSI_VERSION "1.5.8" +#define IBMVSCSI_VERSION "1.5.9"MODULE_DESCRIPTION ("IBM Virtual SCSI" );MODULE_AUTHOR ("Dave Boutcher" );
@@ -1347,7 +1349,7 @@ static ssize_t show_host_srp_version(str (struct ibmvscsi_host_data *)shost->hostdata;int len; - len =snprintf (buf,PAGE_SIZE ,"%s\n" , + len =snprintf (buf, buff_size,"%s\n" , hostdata->madapter_info.srp_version);return len; }
@@ -1368,7 +1370,7 @@ static ssize_t show_host_partition_name( (struct ibmvscsi_host_data *)shost->hostdata;int len; - len =snprintf (buf,PAGE_SIZE ,"%s\n" , + len =snprintf (buf, buff_size,"%s\n" , hostdata->madapter_info.partition_name);return len; }
@@ -1389,7 +1391,7 @@ static ssize_t show_host_partition_numbe (struct ibmvscsi_host_data *)shost->hostdata;int len; - len =snprintf (buf,PAGE_SIZE ,"%d\n" , + len =snprintf (buf, buff_size,"%d\n" , hostdata->madapter_info.partition_number);return len; }
@@ -1409,7 +1411,7 @@ static ssize_t show_host_mad_version(str (struct ibmvscsi_host_data *)shost->hostdata;int len; - len =snprintf (buf,PAGE_SIZE ,"%d\n" , + len =snprintf (buf, buff_size,"%d\n" , hostdata->madapter_info.mad_version);return len; }
@@ -1429,7 +1431,7 @@ static ssize_t show_host_os_type(struct (struct ibmvscsi_host_data *)shost->hostdata;int len; - len =snprintf (buf,PAGE_SIZE ,"%d\n" , hostdata->madapter_info.os_type); + len =snprintf (buf, buff_size,"%d\n" , hostdata->madapter_info.os_type);return len; }
@@ -1448,7 +1450,7 @@ static ssize_t show_host_config(struct c (struct ibmvscsi_host_data *)shost->hostdata;/* returns null-terminated host config data */ -if (ibmvscsi_do_host_config (hostdata, buf,PAGE_SIZE ) ==0 ) +if (ibmvscsi_do_host_config (hostdata, buf, buff_size) ==0 )return strlen (buf);else return 0 ;
Quoted 7 lines · On Fri, 08 Dec 2006 20:51:37 -0600 Linda Xie wrote:
Hi James,
This patch changes the size of the buffer used for transfering config data to 4K. It was tested against
2.6.19-rc2 tree.Please consider it for inclusion in upstream.
+/* host data buffer size */
+#define buff_size 4096
from Documentation/CodingStyle:
<quote>
Names of macros defining constants and labels in enums are capitalized.
#define CONSTANT 0x12345
Enums are preferred when defining several related constants.
CAPITALIZED macro names are appreciated but macros resembling functions may be named in lower case.
</quote>
I conclude that it should be BUFF_SIZE.
---
~Randy