package scanner

func (fs *FileSystem) rebuildPointers() {
	fs.Directory.rebuildPointers(fs)
}

func (directory *Directory) rebuildPointers(fs *FileSystem) {
	for _, file := range directory.RegularFileList {
		file.rebuildPointers(fs)
	}
	for _, file := range directory.FileList {
		file.rebuildPointers(fs)
	}
	for _, dir := range directory.DirectoryList {
		dir.rebuildPointers(fs)
	}
}

func (file *RegularFile) rebuildPointers(fs *FileSystem) {
	file.inode = fs.RegularInodeTable[file.InodeNumber]
}

func (file *File) rebuildPointers(fs *FileSystem) {
	file.inode = fs.InodeTable[file.InodeNumber]
}

package scanner

func (fs *FileSystem) rebuildPointers() {
	fs.Directory.rebuildPointers(fs)
}

func (directory *Directory) rebuildPointers(fs *FileSystem) {
	for _, file := range directory.FileList {
		file.rebuildPointers(fs)
	}
	for _, dir := range directory.DirectoryList {
		dir.rebuildPointers(fs)
	}
}

func (file *File) rebuildPointers(fs *FileSystem) {
	file.inode = fs.InodeTable[file.InodeNumber]
}

--- 
+++ 
@@ -5,6 +5,9 @@
 }
 
 func (directory *Directory) rebuildPointers(fs *FileSystem) {
+	for _, file := range directory.RegularFileList {
+		file.rebuildPointers(fs)
+	}
 	for _, file := range directory.FileList {
 		file.rebuildPointers(fs)
 	}
@@ -13,6 +16,10 @@
 	}
 }
 
+func (file *RegularFile) rebuildPointers(fs *FileSystem) {
+	file.inode = fs.RegularInodeTable[file.InodeNumber]
+}
+
 func (file *File) rebuildPointers(fs *FileSystem) {
 	file.inode = fs.InodeTable[file.InodeNumber]
 }
Rebuild pointers for regular files.
