Author: adrian.chadd
Date: Thu Jul 9 23:38:29 2009
New Revision: 14176
Modified:
playpen/LUSCA_HEAD_storework/app/ufs_rebuild/ufs_build_dir.c
Log:
Add some quick hackery to write out progress entries each before L2
directory
that is read.
Modified: playpen/LUSCA_HEAD_storework/app/ufs_rebuild/ufs_build_dir.c
==============================================================================
--- playpen/LUSCA_HEAD_storework/app/ufs_rebuild/ufs_build_dir.c
(original)
+++ playpen/LUSCA_HEAD_storework/app/ufs_rebuild/ufs_build_dir.c Thu Jul
9
23:38:29 2009
@@ -89,6 +89,23 @@
}
int
+write_swaplog_progress_entry(store_ufs_dir_t *sd, int curl1, int curl2)
+{
+ char buf[128];
+ storeSwapLogProgress *sp = (storeSwapLogProgress *) buf;
+
+ bzero(buf, sizeof(buf));
+ sp->op = SWAP_LOG_PROGRESS;
+ sp->total = (sd->l1 * sd->l2);
+ sp->progress = (sd->l1 * curl1) + curl2;
+
+ /* storeSwapLogData is the record size */
+ if (write(1, buf, sizeof(storeSwapLogData)) <= 0)
+ return 0;
+ return 1;
+}
+
+int
write_swaplog_entry(rebuild_entry_t *re)
{
storeSwapLogData sd;
@@ -125,6 +142,10 @@
for (i = 0; i < store_ufs_l1(sd); i++) {
for (j = 0; j < store_ufs_l2(sd); j++) {
(void) store_ufs_createDir(sd, i, j, dir);
+ if (! write_swaplog_progress_entry(sd, i, j))
+ return;
+
+
getCurrentTime();
debug(47, 2) ("read_dir: opening dir %s\n", dir);
d = opendir(dir);
@@ -132,7 +153,6 @@
perror("opendir");
continue;
}
-
while ( (de = readdir(d)) != NULL) {
if (de->d_name[0] == '.')
continue;
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---