diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2014-07-26 14:34:56 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-07-26 14:34:56 -0400 |
commit | 97c607b1a25e1f4e83bf246c76b679d91470f5dc (patch) | |
tree | b542ac7ef606e7e60e2d2133755956808db9c774 /misc | |
parent | a30a4e93f3fd51d81687de82ab96e57a3694d71c (diff) | |
download | e2fsprogs-97c607b1a25e1f4e83bf246c76b679d91470f5dc.tar.gz |
libext2fs: provide a function to set inode size
Provide an API to set i_size in an inode and take care of all required
feature flag modifications. Refactor the code to use this new
function.
[ Moved the function to lib/ext2fs/blk_num.c, which is the rest of
these sorts of functions live, and renamed it to be
ext2fs_inode_size_set() instead of ext2fs_inode_set_size() to be
consistent with the other functions in in blk_num.c -- tytso ]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/mk_hugefiles.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/mk_hugefiles.c b/misc/mk_hugefiles.c index 7f1be2ee..c292ddc1 100644 --- a/misc/mk_hugefiles.c +++ b/misc/mk_hugefiles.c @@ -357,8 +357,9 @@ static errcode_t mk_hugefile(ext2_filsys fs, blk64_t num, if (retval) goto errout; size = (__u64) count * fs->blocksize; - inode.i_size = size & 0xffffffff; - inode.i_size_high = (size >> 32); + retval = ext2fs_inode_size_set(fs, &inode, size); + if (retval) + goto errout; retval = ext2fs_write_new_inode(fs, *ino, &inode); if (retval) |