Properly set the starting inode number for allocation after restarting.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Fri, 10 Sep 2010 22:58:09 +0000 (15:58 -0700)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Fri, 10 Sep 2010 22:58:09 +0000 (15:58 -0700)
bluesky/imap.c

index a3d27ca..cc8f1ba 100644 (file)
@@ -201,12 +201,13 @@ static void bluesky_inode_map_deserialize(BlueSkyFS *fs, BlueSkyCloudLog *imap)
         for (int j = 0; j < section->links->len; j++) {
             InodeMapEntry *entry;
             entry = bluesky_inode_map_lookup(fs->inode_map, *inum, 1);
-            entry->inum = *inum;
+            entry->inum = GUINT64_FROM_LE(*inum);
             entry->item = g_array_index(section->links,
                                         BlueSkyCloudLog *, j);
             bluesky_cloudlog_ref(entry->item);
             entry->id = entry->item->id;
             entry->location = entry->item->location;
+            fs->next_inum = MAX(fs->next_inum, entry->inum + 1);
             inum++;
         }
         g_mutex_unlock(section->lock);