Revision: 14241 Author: adrian.chadd Date: Thu Jul 23 03:04:50 2009 Log: Refactor out the object check code.
http://code.google.com/p/lusca-cache/source/detail?r=14241 Modified: /playpen/LUSCA_HEAD_store_clean_log_rework/src/store_dir.c ======================================= --- /playpen/LUSCA_HEAD_store_clean_log_rework/src/store_dir.c Wed Jul 8 15:52:27 2009 +++ /playpen/LUSCA_HEAD_store_clean_log_rework/src/store_dir.c Thu Jul 23 03:04:50 2009 @@ -398,6 +398,24 @@ sd->log.close(sd); } } + +static int +storeDirObjectIsCleanWrite(const StoreEntry *e) +{ + if (e->swap_filen < 0) + return 0; + if (e->swap_status != SWAPOUT_DONE) + return 0; + if (e->swap_file_sz <= 0) + return 0; + if (EBIT_TEST(e->flags, RELEASE_REQUEST)) + return 0; + if (EBIT_TEST(e->flags, KEY_PRIVATE)) + return 0; + if (EBIT_TEST(e->flags, ENTRY_SPECIAL)) + return 0; + return 1; +} /* * storeDirWriteCleanLogs @@ -445,18 +463,9 @@ if (!e) continue; notdone = 1; - if (e->swap_filen < 0) + if (! storeDirObjectIsCleanWrite(e)) continue; - if (e->swap_status != SWAPOUT_DONE) - continue; - if (e->swap_file_sz <= 0) - continue; - if (EBIT_TEST(e->flags, RELEASE_REQUEST)) - continue; - if (EBIT_TEST(e->flags, KEY_PRIVATE)) - continue; - if (EBIT_TEST(e->flags, ENTRY_SPECIAL)) - continue; + (sd->log.clean.write) (sd, e); if ((++n & 0xFFFF) == 0) { getCurrentTime(); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "lusca-commit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/lusca-commit?hl=en -~----------~----~----~----~------~----~------~--~---
