Changeset 2886 for trunk/src/kmk/dir-nt-bird.c
- Timestamp:
- Sep 6, 2016, 4:31:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/dir-nt-bird.c
r2879 r2886 75 75 /** Number of times dir_cache_invalid_missing was called. */ 76 76 static KU32 g_cInvalidates = 0; 77 /** Set by dir_cache_volatile_dir to indicate that the user has marked the 78 * volatile parts of the file system with custom revisioning and we only need to 79 * flush these. This is very handy when using a separate output directory 80 * from the sources. */ 81 static KBOOL g_fFsCacheIsUsingCustomRevision = K_FALSE; 77 82 78 83 … … 505 510 } 506 511 507 508 /** 509 * Invalidate missing bits of the directory cache. 510 * 511 * This is called each time a make job completes. 512 */ 513 void dir_cache_invalid_missing(void) 512 /** 513 * Do cache invalidation after a job completes. 514 */ 515 void dir_cache_invalid_after_job(void) 516 { 517 g_cInvalidates++; 518 if (g_fFsCacheIsUsingCustomRevision) 519 kFsCacheInvalidateCustomBoth(g_pFsCache); 520 else 521 kFsCacheInvalidateAll(g_pFsCache); 522 } 523 524 /** 525 * Invalidate the whole directory cache 526 * 527 * Used by $(dircache-ctl invalidate) 528 */ 529 void dir_cache_invalid_all(void) 514 530 { 515 531 g_cInvalidates++; … … 517 533 } 518 534 535 /** 536 * Invalidate missing bits of the directory cache. 537 * 538 * Used by $(dircache-ctl invalidate-missing) 539 */ 540 void dir_cache_invalid_missing(void) 541 { 542 g_cInvalidates++; 543 kFsCacheInvalidateAll(g_pFsCache); 544 } 545 546 /** 547 * Invalidate the volatile bits of the directory cache. 548 * 549 * Used by $(dircache-ctl invalidate-missing) 550 */ 551 void dir_cache_invalid_volatile(void) 552 { 553 g_cInvalidates++; 554 if (g_fFsCacheIsUsingCustomRevision) 555 kFsCacheInvalidateCustomBoth(g_pFsCache); 556 else 557 kFsCacheInvalidateAll(g_pFsCache); 558 } 559 560 /** 561 * Used by $(dircache-ctl ) to mark a directory subtree or file as volatile. 562 * 563 * The first call changes the rest of the cache to be considered non-volatile. 564 * 565 * @returns 0 on success, -1 on failure. 566 * @param pszDir The directory (or file for what that is worth). 567 */ 568 int dir_cache_volatile_dir(const char *pszDir) 569 { 570 KFSLOOKUPERROR enmError; 571 PKFSOBJ pObj = kFsCacheLookupA(g_pFsCache, pszDir, &enmError); 572 if (pObj) 573 { 574 KBOOL fRc = kFsCacheSetupCustomRevisionForTree(g_pFsCache, pObj); 575 kFsCacheObjRelease(g_pFsCache, pObj); 576 if (fRc) 577 { 578 g_fFsCacheIsUsingCustomRevision = K_TRUE; 579 return 0; 580 } 581 error(reading_file, "failed to mark '%s' as volatile", pszDir); 582 } 583 else 584 error(reading_file, "failed to mark '%s' as volatile (not found)", pszDir); 585 return -1; 586 } 587
Note:
See TracChangeset
for help on using the changeset viewer.