Revision: 14239 Author: adrian.chadd Date: Thu Jul 23 02:42:18 2009 Log: A hack to override the default read buffer with something larger.
http://code.google.com/p/lusca-cache/source/detail?r=14239 Modified: /playpen/LUSCA_HEAD_store_clean_log_rework/app/ufs_rebuild/ufs_build_log.c ======================================= --- /playpen/LUSCA_HEAD_store_clean_log_rework/app/ufs_rebuild/ufs_build_log.c Thu Jul 23 02:39:47 2009 +++ /playpen/LUSCA_HEAD_store_clean_log_rework/app/ufs_rebuild/ufs_build_log.c Thu Jul 23 02:42:18 2009 @@ -104,6 +104,9 @@ return 1; } + + +#define READ_BUFFER_LEN 65536 void rebuild_from_log(store_ufs_dir_t *ufs) @@ -112,12 +115,17 @@ storeSwapLogHeader hdr; int r; int version = -1; /* -1 = not set, 0 = old, 1 = new */ + char *rbuf; fp = fopen(ufs->swaplog_path, "r"); if (! fp) { perror("fopen"); return; } + + rbuf = malloc(READ_BUFFER_LEN); + if (rbuf) + setbuffer(fp, rbuf, READ_BUFFER_LEN); /* Read an entry - see if its a swap header! */ r = fread(&hdr, sizeof(hdr), 1, fp); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
