Author: adrian.chadd
Date: Tue Apr 28 04:25:38 2009
New Revision: 14005

Modified:
    branches/LUSCA_HEAD/tools/ufsdump.c

Log:
Convert the ufsdump code over to use the ufs file object.



Modified: branches/LUSCA_HEAD/tools/ufsdump.c
==============================================================================
--- branches/LUSCA_HEAD/tools/ufsdump.c (original)
+++ branches/LUSCA_HEAD/tools/ufsdump.c Tue Apr 28 04:25:38 2009
@@ -194,7 +194,7 @@
  }

  void
-read_dir(const char *dirpath, int l1, int l2)
+read_dir(store_ufs_dir_t *sd)
  {
        DIR *d;
        struct dirent *de;
@@ -204,9 +204,9 @@
        int fn;
        int i, j;

-       for (i = 0; i < l1; i++) {
-               for (j = 0; j < l2; j++) {
-                       (void) store_ufs_createDir(dirpath, i, j, dir);
+       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);
                        debug(47, 1) ("read_dir: opening dir %s\n", dir);
                        d = opendir(dir);
                        if (! d) {
@@ -228,7 +228,7 @@
                                        debug(47, 1) ("read_dir: invalid %s\n", 
de->d_name);
                                                continue;
                                }
-                               if (! store_ufs_filenum_correct_dir(fn, i, j, 
l1, l2)) {
+                               if (! store_ufs_filenum_correct_dir(sd, fn, i, 
j)) {
                                        debug(47, 1) ("read_dir: %s does not 
belong in %d/%d\n", de->d_name,  
i, j);
                                                continue;
                                }
@@ -245,7 +245,6 @@
                        closedir(d);
                }
        }
-
  }

  int
@@ -256,6 +255,7 @@
      _db_set_stderr_debug(1);
      char buf[sizeof(storeSwapLogData)];
      storeSwapLogHeader *sh = (storeSwapLogHeader *) buf;
+    store_ufs_dir_t store_ufs_info;

      bzero(buf, sizeof(buf));

@@ -264,6 +264,8 @@
        exit(1);
      }

+    store_ufs_init(&store_ufs_info, argv[1], atoi(argv[2]), atoi(argv[3]));
+
      /* Output swap header */
      sh->op = SWAP_LOG_VERSION;
      sh->version = 1;
@@ -271,7 +273,8 @@

      write(1, sh, sizeof(storeSwapLogData));

-    read_dir(argv[1], atoi(argv[2]), atoi(argv[3]));
+    read_dir(&store_ufs_info);
+    store_ufs_done(&store_ufs_info);

      return 0;
  }

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to