[dm-devel] [PATCH 3/3] block: implement (some of) fallocate for block devices

2016-09-29 Thread Darrick J. Wong
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

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

2016-09-28 Thread Darrick J. Wong
On Wed, Sep 28, 2016 at 06:42:14PM -0700, Bart Van Assche wrote: > On 09/28/16 17:39, Darrick J. Wong wrote: > >+if (end > isize) { > >+if (mode & FALLOC_FL_KEEP_SIZE) { > >+len = isize - start; > >+end = start + len - 1; > >+}

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

2016-09-28 Thread Bart Van Assche
On 09/28/16 17:39, Darrick J. Wong wrote: + if (end > isize) { + if (mode & FALLOC_FL_KEEP_SIZE) { + len = isize - start; + end = start + len - 1; + } else + return -EINVAL; + } If

[dm-devel] [PATCH 3/3] block: implement (some of) fallocate for block devices

2016-09-28 Thread Darrick J. Wong
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

[dm-devel] [PATCH 3/3] block: implement (some of) fallocate for block devices

2016-04-12 Thread Darrick J. Wong
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