volser: Use the new IH_CREATE_INIT function
authorAndrew Deason <adeason@sinenomine.net>
Mon, 3 Jun 2013 21:28:44 +0000 (16:28 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Fri, 12 Jul 2013 17:38:16 +0000 (10:38 -0700)
Use IH_CREATE_INIT when restoring volume data, so we don't open each
restored data file twice.

Change-Id: I67b3df1c5777a6b022644b042f405dbd6a1976a0
Reviewed-on: http://gerrit.openafs.org/9970
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/volser/dumpstuff.c

index 55efa69..5b4176d 100644 (file)
@@ -1419,20 +1419,20 @@ ReadVnodes(struct iod *iodp, Volume * vp, int incremental,
                    }
                    saw_f = 1;
 
-                   ino =
-                       IH_CREATE(V_linkHandle(vp), V_device(vp),
+                   tmpH =
+                       IH_CREATE_INIT(V_linkHandle(vp), V_device(vp),
                                  VPartitionPath(V_partition(vp)), nearInode,
                                  V_parentId(vp), vnodeNumber,
                                  vnode->uniquifier, vnode->dataVersion);
-                   if (!VALID_INO(ino)) {
+                   if (!tmpH) {
                        Log("1 Volser: ReadVnodes: IH_CREATE: %s - restore aborted\n",
                             afs_error_message(errno));
                        V_needsSalvaged(vp) = 1;
                        return VOLSERREAD_DUMPERROR;
                    }
+                   ino = tmpH->ih_ino;
                    nearInode = ino;
                    VNDISK_SET_INO(vnode, ino);
-                   IH_INIT(tmpH, vp->device, V_parentId(vp), ino);
                    fdP = IH_OPEN(tmpH);
                    if (fdP == NULL) {
                        Log("1 Volser: ReadVnodes: IH_OPEN: %s - restore aborted\n",