Fix FileStore walk not to circle around
This commit is contained in:
@@ -893,11 +893,11 @@ template<typename Header>
|
|||||||
void FileStore<Header>::walk(int(*cb)(const char*, uint64_t start, uint64_t end)) {
|
void FileStore<Header>::walk(int(*cb)(const char*, uint64_t start, uint64_t end)) {
|
||||||
auto err = cb("Header", 0, sizeof(Header));
|
auto err = cb("Header", 0, sizeof(Header));
|
||||||
auto inode = ptr<Inode*>(firstInode());
|
auto inode = ptr<Inode*>(firstInode());
|
||||||
while (!err && inode != (Inode*) begin()) {
|
do {
|
||||||
inode = ptr<Inode*>(inode->getNext());
|
|
||||||
auto start = ptr(inode);
|
auto start = ptr(inode);
|
||||||
err = cb("Inode", start, start + inode->size());
|
err = cb("Inode", start, start + inode->size());
|
||||||
}
|
inode = ptr<Inode*>(inode->getNext());
|
||||||
|
} while (!err && inode != ptr<Inode*>(firstInode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Header>
|
template<typename Header>
|
||||||
|
|||||||
Reference in New Issue
Block a user