Fix FileStore walk not to circle around
This commit is contained in:
@@ -273,7 +273,7 @@ class FileStore {
|
|||||||
uint16_t fsType();
|
uint16_t fsType();
|
||||||
|
|
||||||
uint16_t version();
|
uint16_t version();
|
||||||
|
|
||||||
static uint8_t *format(uint8_t *buffer, typename Header::FsSize_t size, uint16_t fsType = 0);
|
static uint8_t *format(uint8_t *buffer, typename Header::FsSize_t size, uint16_t fsType = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -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