Whamcloud - gitweb
libext2fs: support allocating uninit blocks in bmap2()
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 17 May 2015 00:54:29 +0000 (20:54 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 17 May 2015 00:54:29 +0000 (20:54 -0400)
commit60a212f773ba116b4f7a9edb5eb76b40668ea8a0
tree59999358b761d87e5eb3a4750caf86332bca063a
parentfaa427d34f8ae3b63f408fa004925d4be10fe66d
libext2fs: support allocating uninit blocks in bmap2()

As part of supporting fallocate-like functionality, extend
ext2fs_bmap() with two flags -- BMAP_UNINIT and BMAP_ZERO.  The first
will cause it to mark/set a block uninitialized, if it's part of an
extent based file.  For a block mapped file, the mapping is put in,
but there is no way to remember the uninitialized status.  The second
flag causes the block to be zeroed to support the use case of
emulating uninitialized blocks on a block-map file by zeroing them.

Eventually fallocate or fuse2fs or somebody will use these.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/bmap.c
lib/ext2fs/ext2fs.h