diff mbox

[04/24] debugfs: allow bmap to allocate blocks

Message ID 20140718225243.31374.87869.stgit@birch.djwong.org
State Accepted, archived
Headers show

Commit Message

Darrick Wong July 18, 2014, 10:52 p.m. UTC
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 <darrick.wong@oracle.com>
---
 debugfs/set_fields.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Theodore Ts'o July 22, 2014, 5:52 p.m. UTC | #1
On Fri, Jul 18, 2014 at 03:52:43PM -0700, Darrick J. Wong wrote:
> 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 <darrick.wong@oracle.com>

Thanks, applied.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c
index b4ca546..c5f865e 100644
--- a/debugfs/set_fields.c
+++ b/debugfs/set_fields.c
@@ -556,8 +556,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");
 	}