1.1 --- a/libfsserver/lib/files/ext2_file_operations.cc Fri Aug 06 19:30:20 2021 +0200
1.2 +++ b/libfsserver/lib/files/ext2_file_operations.cc Fri Aug 06 19:32:06 2021 +0200
1.3 @@ -155,4 +155,28 @@
1.4 ext2fs_file_write(file, addr, size, NULL);
1.5 }
1.6
1.7 +/* Initiate iteration over a directory, with the given 'func' being called
1.8 + with directory entry details for each entry. */
1.9 +
1.10 +long Ext2FileOperations::directory_iterate(ext2_ino_t dir,
1.11 + int func(struct ext2_dir_entry *, int, int,
1.12 + char *, void *),
1.13 + void *priv_data)
1.14 +{
1.15 + if (ext2fs_dir_iterate(_fs, dir, 0, 0, func, priv_data))
1.16 + return -L4_EIO;
1.17 +
1.18 + return L4_EOK;
1.19 +}
1.20 +
1.21 +long Ext2FileOperations::read_inode(ext2_ino_t ino_file, struct ext2_inode *inode)
1.22 +{
1.23 + std::lock_guard<std::mutex> guard(_lock);
1.24 +
1.25 + if (ext2fs_read_inode(_fs, ino_file, inode))
1.26 + return -L4_EIO;
1.27 +
1.28 + return L4_EOK;
1.29 +}
1.30 +
1.31 // vim: tabstop=4 expandtab shiftwidth=4