[Iprdd-commit] iprutils iprconfig.c, 1.138, 1.139 iprlib.c, 1.123, 1.124 iprlib.h, 1.106, 1.107 ver
Brought to you by:
brking
|
From: Wayne B. <wb...@us...> - 2009-06-30 23:32:50
|
Update of /cvsroot/iprdd/iprutils In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18452/iprutils Modified Files: iprconfig.c iprlib.c iprlib.h version.mk Log Message: fixes for disable IOA caching and fix for IOA cache reclaim timeout problem Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- version.mk 9 Apr 2009 00:25:11 -0000 1.73 +++ version.mk 30 Jun 2009 23:32:40 -0000 1.74 @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=14 +IPR_FIX_LEVEL=15 IPR_RELEASE=1 -IPR_FIX_DATE=(April 07, 2009) +IPR_FIX_DATE=(June 30, 2009) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- iprlib.c 9 Apr 2009 00:25:11 -0000 1.123 +++ iprlib.c 30 Jun 2009 23:32:40 -0000 1.124 @@ -3022,7 +3022,7 @@ int fd; u8 cdb[IPR_CCB_CDB_LEN]; struct sense_data_t sense_data; - int rc; + int timeout, rc; int length = sizeof(struct ipr_reclaim_query_data); if (strlen(file) == 0) @@ -3042,9 +3042,14 @@ cdb[7] = (length & 0xff00) >> 8; cdb[8] = length & 0xff; + if ((action & IPR_RECLAIM_ACTION) == IPR_RECLAIM_PERFORM) + timeout = IPR_CACHE_RECLAIM_TIMEOUT; + else + timeout = IPR_INTERNAL_DEV_TIMEOUT; + rc = sg_ioctl(fd, cdb, buff, length, SG_DXFER_FROM_DEV, - &sense_data, IPR_INTERNAL_DEV_TIMEOUT); + &sense_data, timeout); if (rc != 0) { if (sense_data.sense_key != ILLEGAL_REQUEST) @@ -6100,17 +6105,17 @@ { int rc; int found = 0; - struct ipr_query_ioa_caching_info *info; + struct ipr_query_ioa_caching_info info; struct ipr_global_cache_params_term *term; + int term_size = sizeof(struct ipr_query_ioa_caching_info); - info = malloc(IPR_CACHE_QUERY_SIZE); - memset(info, 0, IPR_CACHE_QUERY_SIZE); + memset(&info, 0, term_size); - rc = ipr_query_cache_parameters(ioa, info, IPR_CACHE_QUERY_SIZE); + rc = ipr_query_cache_parameters(ioa, &info, term_size); if (rc) return IPR_IOA_REQUESTED_CACHING_DEFAULT; - for_each_cache_term(info, term) + for_each_cache_term(term, &info) if (term && term->term_id == IPR_CACHE_PARAM_TERM_ID) { found = 1; break; Index: iprlib.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.h,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- iprlib.h 9 Apr 2009 00:25:11 -0000 1.106 +++ iprlib.h 30 Jun 2009 23:32:40 -0000 1.107 @@ -97,6 +97,7 @@ #define IPR_SUSPEND_DEV_BUS_TIMEOUT (35) /* 35 seconds */ #define IPR_EVALUATE_DEVICE_TIMEOUT (2 * 60) /* 2 minutes */ #define IPR_WRITE_BUFFER_TIMEOUT (8 * 60) /* 8 minutes */ +#define IPR_CACHE_RECLAIM_TIMEOUT (10 * 60) /* 10 minutes */ #define SET_DASD_TIMEOUTS_TIMEOUT (2 * 60) #define IPR_NUM_DRIVE_ELEM_STATUS_ENTRIES 50 #define IPR_DRIVE_ELEM_STATUS_EMPTY 5 @@ -1797,9 +1798,6 @@ struct ipr_sas_expander_info exp[1]; }; -/* define space for the header and 512 term ID records */ -#define IPR_CACHE_QUERY_SIZE 2049 - struct ipr_global_cache_params_term { #define IPR_CACHE_PARAM_TERM_ID 0x10 u8 term_id; @@ -1816,18 +1814,19 @@ u8 reserved2; }; -#define for_each_cache_term(info, term) \ - for (term = (info)->term; \ - ((unsigned long)term) < ((unsigned long)((unsigned long)(info) + ntohs((info)->len))) && \ - ((unsigned long)term) < ((unsigned long)((unsigned long)((info)->term + sizeof((info)->term)))); \ - term = term + term->len) - struct ipr_query_ioa_caching_info { u16 len; u8 reserved[2]; - struct ipr_global_cache_params_term term[1]; +#define IPR_MAX_TERMS 512 + struct ipr_global_cache_params_term term[IPR_MAX_TERMS]; }; +#define for_each_cache_term(term, info) \ + for (term = (info)->term; \ + ((unsigned long)term) < ((unsigned long)((unsigned long)(info) + ntohs((info)->len)) + 2) && \ + ((unsigned long)term + term->len + 2 - (unsigned long)(info)->term) < sizeof((info)->term); \ + term = (struct ipr_global_cache_params_term *)(((unsigned long)term) + term->len + 2)) + struct ipr_log_page18 { u8 page_code; u8 reserved; Index: iprconfig.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.c,v retrieving revision 1.138 retrieving revision 1.139 diff -u -d -r1.138 -r1.139 --- iprconfig.c 9 Apr 2009 00:25:11 -0000 1.138 +++ iprconfig.c 30 Jun 2009 23:32:40 -0000 1.139 @@ -15493,7 +15493,7 @@ fprintf(stderr, "Cannot find %s\n", args[0]); return -EINVAL; } - if (dev != &dev->ioa->ioa || dev->ioa->is_aux_cache) { + if (dev != &dev->ioa->ioa) { fprintf(stderr, "%s is not an IOA.\n", args[0]); return -EINVAL; } @@ -15530,10 +15530,13 @@ fprintf(stderr, "Cannot find %s\n", args[0]); return -EINVAL; } - if (dev != &dev->ioa->ioa || dev->ioa->is_aux_cache) { + if (dev != &dev->ioa->ioa) { fprintf(stderr, "%s is not an IOA.\n", args[0]); return -EINVAL; } + if (dev->ioa->is_aux_cache) { + return -EINVAL; + } if (!dev->ioa->has_cache) { fprintf(stderr, "%s does not have cache.\n", args[0]); return -EINVAL; |