DEVEL15-windows-64bit-printf-sanity-20090218
[openafs.git] / src / volser / dumpstuff.c
index 7a814b9..96a4dfe 100644 (file)
@@ -77,7 +77,7 @@ struct iod {
     struct rx_call *call;      /* call to which to write, might be an array */
     int device;                        /* dump device ID for volume */
     int parentId;              /* dump parent ID for volume */
-    struct DiskPartition *dumpPartition;       /* Dump partition. */
+    struct DiskPartition64 *dumpPartition;     /* Dump partition. */
     struct rx_call **calls;    /* array of pointers to calls */
     int ncalls;                        /* how many calls/codes in array */
     int *codes;                        /* one return code for each call */
@@ -519,9 +519,10 @@ static int
 DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
 {
     int code = 0, error = 0;
-    afs_int32 pad = 0, offset;
+    afs_int32 pad = 0;
+    afs_int32 offset = 0;
     afs_sfsize_t n, nbytes, howMany, howBig;
-    afs_foff_t lcode;
+    afs_foff_t lcode = 0;
     byte *p;
 #ifndef AFS_NT40_ENV
     struct afs_stat status;
@@ -559,7 +560,6 @@ DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
        return VOLSERDUMPERROR;
     }
     howMany = (afs_sfsize_t) tstatfs.f_bsize;
-    Log("DumpFile: fstatfs returned block size of %lld; howMany=%lld", tstatfs.f_bsize, howMany);
 #else
     howMany = status.st_blksize;
 #endif /* AFS_AIX_ENV */
@@ -988,6 +988,10 @@ ProcessIndex(Volume * vp, VnodeClass class, afs_int32 ** Bufp, int *sizep,
            (size <=
             vcp->diskSize ? 0 : size - vcp->diskSize) >> vcp->logSize;
        if (nVnodes > 0) {
+           if (DoLogging) {
+               Log("RestoreVolume ProcessIndex: Set up %d inodes for volume %d\n",
+                   nVnodes, V_id(vp));
+           }
            Buf = (afs_int32 *) malloc(nVnodes * sizeof(afs_int32));
            if (Buf == NULL) {
                STREAM_CLOSE(afile);
@@ -1007,6 +1011,9 @@ ProcessIndex(Volume * vp, VnodeClass class, afs_int32 ** Bufp, int *sizep,
                }
                offset += vcp->diskSize;
            }
+           if (DoLogging) {
+               Log("RestoreVolume ProcessIndex: found %d inodes\n", cnt);
+           }
            *Bufp = Buf;
            *sizep = nVnodes;
        }
@@ -1035,8 +1042,6 @@ RestoreVolume(register struct rx_call *call, Volume * avp, int incremental,
     iod_Init(iodp, call);
 
     vp = avp;
-    if (V_parentId(vp) == V_id(vp))
-      delo = incremental;
 
     if (!ReadDumpHeader(iodp, &header)) {
        Log("1 Volser: RestoreVolume: Error reading header file for dump; aborted\n");
@@ -1149,6 +1154,10 @@ ReadVnodes(register struct iod *iodp, Volume * vp, int incremental,
 
        if (!ReadInt32(iodp, &vnode->uniquifier))
            return VOLSERREAD_DUMPERROR;
+
+       if (DoLogging) {
+           Log("ReadVnodes: setup %d/%d\n", vnodeNumber, vnode->uniquifier);
+       }
        while ((tag = iod_getc(iodp)) > D_MAX && tag != EOF) {
            haveStuff = 1;
            switch (tag) {
@@ -1217,8 +1226,8 @@ ReadVnodes(register struct iod *iodp, Volume * vp, int incremental,
                                  V_parentId(vp), vnodeNumber,
                                  vnode->uniquifier, vnode->dataVersion);
                    if (!VALID_INO(ino)) {
-                       perror("unable to allocate inode");
-                       Log("1 Volser: ReadVnodes: Restore aborted\n");
+                       Log("1 Volser: ReadVnodes: IH_CREATE: %s - restore aborted\n",
+                            afs_error_message(errno));
                        return VOLSERREAD_DUMPERROR;
                    }
                    nearInode = ino;
@@ -1226,6 +1235,8 @@ ReadVnodes(register struct iod *iodp, Volume * vp, int incremental,
                    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",
+                            afs_error_message(errno));
                        IH_RELEASE(tmpH);
                        return VOLSERREAD_DUMPERROR;
                    }