xfs
[Top] [All Lists]

Re: [PATCH 3/3] block: implement (some of) fallocate for block devices

To: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>, axboe@xxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx
Subject: Re: [PATCH 3/3] block: implement (some of) fallocate for block devices
From: Hannes Reinecke <hare@xxxxxxx>
Date: Thu, 29 Sep 2016 07:57:13 +0200
Cc: linux-block@xxxxxxxxxxxxxxx, tytso@xxxxxxx, martin.petersen@xxxxxxxxxx, snitzer@xxxxxxxxxx, linux-api@xxxxxxxxxxxxxxx, bfoster@xxxxxxxxxx, xfs@xxxxxxxxxxx, hch@xxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, bart.vanassche@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <147510959149.8940.2897845352082568677.stgit@xxxxxxxxxxxxxxxx>
References: <147510957066.8940.13803086684642725401.stgit@xxxxxxxxxxxxxxxx> <147510959149.8940.2897845352082568677.stgit@xxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0
On 09/29/2016 02:39 AM, Darrick J. Wong wrote:
> After much discussion, it seems that the fallocate feature flag
> FALLOC_FL_ZERO_RANGE maps nicely to SCSI WRITE SAME; and the feature
> FALLOC_FL_PUNCH_HOLE maps nicely to the devices that have been
> whitelisted for zeroing SCSI UNMAP.  Punch still requires that
> FALLOC_FL_KEEP_SIZE is set.  A length that goes past the end of the
> device will be clamped to the device size if KEEP_SIZE is set; or will
> return -EINVAL if not.  Both start and length must be aligned to the
> device's logical block size.
> 
> Since the semantics of fallocate are fairly well established already,
> wire up the two pieces.  The other fallocate variants (collapse range,
> insert range, and allocate blocks) are not supported.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
> v2: Incorporate feedback from Christoph & Linus.  Tentatively add
> a requirement that the fallocate arguments be aligned to logical block
> size, and put in a few XXX comments ahead of LSF discussion.
> v3: Forward port to 4.7.
> v4: Forward port to 4.8.
> ---
>  fs/block_dev.c |   78 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  fs/open.c      |    3 +-
>  2 files changed, 80 insertions(+), 1 deletion(-)
> 
Reviewed-by: Hannes Reinecke <hare@xxxxxxxx>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                   zSeries & Storage
hare@xxxxxxx                          +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 NÃrnberg
GF: J. Hawn, J. Guild, F. ImendÃrffer, HRB 16746 (AG NÃrnberg)

<Prev in Thread] Current Thread [Next in Thread>