Whamcloud - gitweb
ext2fs: add ext2fs_get_stat_i_blocks() function
authorTheodore Ts'o <tytso@mit.edu>
Mon, 30 Dec 2019 15:12:58 +0000 (10:12 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Jan 2020 18:41:28 +0000 (13:41 -0500)
commit3a15d85bfb1bb099d6e0455538f93a7088733272
treef3da8186d01bd20b4f3cd3c61eac6c915a7ac37d
parentdae1ecc2442f43867309ec2f03a7c5422401f690
ext2fs: add ext2fs_get_stat_i_blocks() function

The function ext2fs_inode_i_blocks() is a bit confusing whether it is
returning the inode's i_blocks value, or whether it is returning the
value ala the stat(2) system call, which returns i_blocks in units of
512 byte sectors.  This caused ext2fs_inode_i_blocks() to be
incorrectly used in fuse2fs and the function quota_compute_usage().

To address this, we add a new function, ext2fs_get_stat_i_blocks()
which is clearly labelled what it is returning, and use it in fuse2fs
and quota_compute_usage().  It's also a bit more convenient to use it
in e2fsck, so use it there too.

Reported-by: Wang Shilong <wangshilong1991@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/extents.c
lib/ext2fs/blknum.c
lib/ext2fs/ext2fs.h
lib/support/mkquota.c
misc/fuse2fs.c