[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140922025109.GF30646@thunk.org>
Date: Sun, 21 Sep 2014 22:51:09 -0400
From: Theodore Ts'o <tytso@....edu>
To: "Darrick J. Wong" <darrick.wong@...cle.com>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [PATCH 15/34] libext2fs: support BLKZEROOUT/FALLOC_FL_ZERO_RANGE
in ext2fs_zero_blocks
On Sat, Sep 13, 2014 at 03:12:53PM -0700, Darrick J. Wong wrote:
> +#if defined(HAVE_FALLOCATE) && defined(FALLOC_FL_ZERO_RANGE)
> + int flag = FALLOC_FL_ZERO_RANGE;
> + struct stat statbuf;
> +
> + /*
> + * If we're trying to zero a range past the end of the file,
> + * just use regular fallocate to get there, because zeroing
> + * a range past EOF does not extend the file.
> + */
If we are operating on a regular file (for example, "mkfs.ext4
/tmp/foo.img 64M") we want to keep the file a sparse one; so if we are
trying to zero a range past the end of the file, it should be
sufficient simply use trucate to set i_size. In fact, if we can use
FALLOC_FL_PUNCH on the regular file, we should try to use that
instead, I would think.
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists