Changeset 9301
- Timestamp:
- 04/30/12 11:16:05 (13 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/acache_improvement/src/client/sysint/acache.c
r9300 r9301 386 386 */ 387 387 388 /* lookup non-static components*/388 /* lookup */ 389 389 ret = PINT_tcache_lookup(acache, &refn, &tmp_entry, &status); 390 390 if(ret < 0 || status != 0) … … 412 412 current_time_msecs += current_time.tv_usec / 1000; 413 413 414 /* Check to see if either the security or dynamic attrs have expired. */ 415 if((current_time_msecs - tmp_payload->msecs_security) > 416 SECURITY_ACACHE_DEFAULT_TIMEOUT_MSECS) 417 { 418 security_expired = 1; 419 420 /* Fetch/update security attr */ 421 422 } 423 424 if((current_time_msecs - tmp_payload->msecs_dynamic) > 425 DYNAMIC_ACACHE_DEFAULT_TIMEOUT_MSECS) 426 { 427 dynamic_attrs_expired = 1; 428 429 /* Fetch/update dynamic attrs */ 430 431 } 414 /* Reset Dynamic attrs timestamp since it was hit regardless of timeout. */ 415 tmp_payload->msecs_dynamic = current_time_msecs; 432 416 433 417 … … 656 640 uint32_t old_mask; 657 641 int ret = -1; 642 /* Storage of current time */ 643 struct timeval current_time = { 0, 0}; 644 uint64_t current_time_msecs = 0; 658 645 659 646 /* skip out immediately if the cache is disabled */ … … 736 723 if(size || (attr && (attr->mask & (~(PVFS_STATIC_ATTR_MASK))))) 737 724 { 738 tmp_payload = 739 (struct acache_payload*)calloc(1, sizeof(*tmp_payload)); 725 /* Allocate memory for acache payload if not previously done. */ 740 726 if(!tmp_payload) 741 727 { 742 ret = -PVFS_ENOMEM; 743 goto err; 744 } 745 tmp_payload->refn = refn; 728 tmp_payload = 729 (struct acache_payload*)calloc(1, sizeof(*tmp_payload)); 730 if(!tmp_payload) 731 { 732 ret = -PVFS_ENOMEM; 733 goto err; 734 } 735 tmp_payload->refn = refn; 736 } 737 746 738 tmp_payload->attr_status = -PVFS_ETIME; 747 739 tmp_payload->size_status = -PVFS_ETIME; … … 770 762 771 763 } 772 764 765 /* Get the time of day and convert to millisecond resolution. */ 766 gettimeofday(¤t_time, NULL); 767 current_time_msecs = current_time.tv_sec * 1000; 768 current_time_msecs += current_time.tv_usec / 1000; 769 770 /* See if the security attr timestamp has been set, if not then set it. */ 771 if(!tmp_payload->msecs_security) 772 { 773 tmp_payload->msecs_security = current_time_msecs; 774 } 775 /* Update the dynamic attrs' timestamp regardless of if it has already been set. */ 776 tmp_payload->msecs_dynamic = current_time_msecs; 777 773 778 #if 0 774 779 gossip_debug(GOSSIP_ACACHE_DEBUG, "acache: update(): attr_status=%d, size_status=%d\n",
