Whamcloud - gitweb
ext2fs: add new APIs needed for fast commits
authorHarshad Shirwadkar <harshadshirwadkar@gmail.com>
Fri, 22 Jan 2021 05:44:57 +0000 (21:44 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 28 Jan 2021 01:11:20 +0000 (20:11 -0500)
commitcf2d9de7ee2f35ae0e1095c86a77c3fe6fb8ce7d
tree866d240d18b6f36aac4087ed3cceab2ad50b07ac
parent45fa214d623e4e4a8844535a7e80dece63f121c8
ext2fs: add new APIs needed for fast commits

This patch adds the following new APIs:

Count the total number of blocks occupied by inode including
intermediate extent tree nodes.
extern errcode_t ext2fs_count_blocks(ext2_filsys fs, ext2_ino_t ino,
                                     struct ext2_inode *inode,
     blk64_t *ret_count);

Convert the on-disk reputation of an extent to the in-memory
representation.
extern errcode_t ext2fs_decode_extent(struct ext2fs_extent *to, void *from,
                                     int len);

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ext2fs.h
lib/ext2fs/extent.c