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 /e2fsck/pass3.c | |
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 'e2fsck/pass3.c')
-rw-r--r-- | e2fsck/pass3.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c index f9d4aae3..fb217273 100644 --- a/e2fsck/pass3.c +++ b/e2fsck/pass3.c @@ -804,8 +804,9 @@ errcode_t e2fsck_expand_directory(e2fsck_t ctx, ext2_ino_t dir, return retval; sz = (es.last_block + 1) * fs->blocksize; - inode.i_size = sz; - inode.i_size_high = sz >> 32; + retval = ext2fs_inode_size_set(fs, &inode, sz); + if (retval) + return retval; ext2fs_iblk_add_blocks(fs, &inode, es.newblocks); quota_data_add(ctx->qctx, &inode, dir, es.newblocks * fs->blocksize); |