From fa633bf9f60b1fe69444fd5c1fdcbce437a4f3c6 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 22 Jul 2014 12:44:42 -0400 Subject: [PATCH] debugfs: allow bmap to allocate blocks Allow set_inode_field's bmap command in debugfs to allocate blocks, which enables us to allocate blocks for indirect blocks and internal extent tree blocks. True, we could do this manually, but seems like unnecessary bookkeeping activity for humans. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o --- debugfs/set_fields.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c index d017eea..40dc5e7 100644 --- a/debugfs/set_fields.c +++ b/debugfs/set_fields.c @@ -554,8 +554,9 @@ static errcode_t parse_bmap(struct field_set_info *info, } retval = ext2fs_bmap2(current_fs, set_ino, - (struct ext2_inode *) &set_inode, - NULL, BMAP_SET, array_idx, NULL, &blk); + (struct ext2_inode *) &set_inode, + NULL, BMAP_ALLOC | BMAP_SET, array_idx, NULL, + &blk); if (retval) { com_err("set_inode", retval, "while setting block map"); } -- 1.8.3.1