linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
@ 2025-10-02 12:28 Lukas Herbolt
  2025-10-03  7:51 ` Christoph Hellwig
  2025-10-15  6:30 ` Nirjhar Roy (IBM)
  0 siblings, 2 replies; 7+ messages in thread
From: Lukas Herbolt @ 2025-10-02 12:28 UTC (permalink / raw)
  To: linux-xfs; +Cc: Lukas Herbolt

Add support for FALLOC_FL_WRITE_ZEROES if the underlying device enable
the unmap write zeroes operation.

Inspired by the Ext4 implementation of the FALLOC_FL_WRITE_ZEROES. It
can speed up some patterns on specific hardware.

time ( ./fallocate -l 360M /mnt/test.file; dd if=/dev/zero of=/mnt/test.file \
bs=1M count=360 conv=notrunc,nocreat oflag=direct,dsync)

360+0 records in
360+0 records out
377487360 bytes (377 MB, 360 MiB) copied, 22.0027 s, 17.2 MB/s

real	0m22.114s
user	0m0.006s
sys		0m3.085s

time (./fallocate -wl 360M /mnt/test.file; dd if=/dev/zero of=/mnt/test.file \
bs=1M count=360 conv=notrunc,nocreat oflag=direct,dsync );
360+0 records in
360+0 records out
377487360 bytes (377 MB, 360 MiB) copied, 2.02512 s, 186 MB/s

real	0m6.384s
user	0m0.002s
sys		0m5.823s



Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
---
 fs/xfs/xfs_bmap_util.c |  5 +++--
 fs/xfs/xfs_bmap_util.h |  4 ++--
 fs/xfs/xfs_file.c      | 23 ++++++++++++++++++-----
 3 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 06ca11731e430..a91596a280ba5 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -645,6 +645,7 @@ xfs_free_eofblocks(
 int
 xfs_alloc_file_space(
 	struct xfs_inode	*ip,
+    uint32_t        flags,      /* XFS_BMAPI_... */
 	xfs_off_t		offset,
 	xfs_off_t		len)
 {
@@ -748,8 +749,8 @@ xfs_alloc_file_space(
 		 * will eventually reach the requested range.
 		 */
 		error = xfs_bmapi_write(tp, ip, startoffset_fsb,
-				allocatesize_fsb, XFS_BMAPI_PREALLOC, 0, imapp,
-				&nimaps);
+				allocatesize_fsb, flags, 0, imapp, &nimaps);
+
 		if (error) {
 			if (error != -ENOSR)
 				goto error;
diff --git a/fs/xfs/xfs_bmap_util.h b/fs/xfs/xfs_bmap_util.h
index c477b33616304..67770830eb245 100644
--- a/fs/xfs/xfs_bmap_util.h
+++ b/fs/xfs/xfs_bmap_util.h
@@ -55,8 +55,8 @@ int	xfs_bmap_last_extent(struct xfs_trans *tp, struct xfs_inode *ip,
 			     int *is_empty);
 
 /* preallocation and hole punch interface */
-int	xfs_alloc_file_space(struct xfs_inode *ip, xfs_off_t offset,
-		xfs_off_t len);
+int	xfs_alloc_file_space(struct xfs_inode *ip, uint32_t flags,
+		xfs_off_t offset, xfs_off_t len);
 int	xfs_free_file_space(struct xfs_inode *ip, xfs_off_t offset,
 		xfs_off_t len, struct xfs_zone_alloc_ctx *ac);
 int	xfs_collapse_file_space(struct xfs_inode *, xfs_off_t offset,
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index f96fbf5c54c99..48559a011e9b4 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -1255,7 +1255,7 @@ xfs_falloc_insert_range(
 static int
 xfs_falloc_zero_range(
 	struct file		*file,
-	int			mode,
+	int				mode,
 	loff_t			offset,
 	loff_t			len,
 	struct xfs_zone_alloc_ctx *ac)
@@ -1277,7 +1277,16 @@ xfs_falloc_zero_range(
 
 	len = round_up(offset + len, blksize) - round_down(offset, blksize);
 	offset = round_down(offset, blksize);
-	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
+	if (mode & FALLOC_FL_WRITE_ZEROES) {
+		if (!bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))
+	        return -EOPNOTSUPP;
+		error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_ZERO,
+				offset, len);
+	}
+	else
+		error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_PREALLOC,
+				offset, len);
+
 	if (error)
 		return error;
 	return xfs_falloc_setsize(file, new_size);
@@ -1302,7 +1311,8 @@ xfs_falloc_unshare_range(
 	if (error)
 		return error;
 
-	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
+	error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_PREALLOC,
+			offset, len);
 	if (error)
 		return error;
 	return xfs_falloc_setsize(file, new_size);
@@ -1330,7 +1340,9 @@ xfs_falloc_allocate_range(
 	if (error)
 		return error;
 
-	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
+	error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_PREALLOC,
+			offset, len);
+
 	if (error)
 		return error;
 	return xfs_falloc_setsize(file, new_size);
@@ -1340,7 +1352,7 @@ xfs_falloc_allocate_range(
 		(FALLOC_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |	\
 		 FALLOC_FL_PUNCH_HOLE |	FALLOC_FL_COLLAPSE_RANGE |	\
 		 FALLOC_FL_ZERO_RANGE |	FALLOC_FL_INSERT_RANGE |	\
-		 FALLOC_FL_UNSHARE_RANGE)
+		 FALLOC_FL_UNSHARE_RANGE | FALLOC_FL_WRITE_ZEROES )
 
 STATIC long
 __xfs_file_fallocate(
@@ -1383,6 +1395,7 @@ __xfs_file_fallocate(
 	case FALLOC_FL_INSERT_RANGE:
 		error = xfs_falloc_insert_range(file, offset, len);
 		break;
+	case FALLOC_FL_WRITE_ZEROES:
 	case FALLOC_FL_ZERO_RANGE:
 		error = xfs_falloc_zero_range(file, mode, offset, len, ac);
 		break;
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
  2025-10-02 12:28 [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base Lukas Herbolt
@ 2025-10-03  7:51 ` Christoph Hellwig
  2025-10-04  4:00   ` Darrick J. Wong
  2025-10-15  6:30 ` Nirjhar Roy (IBM)
  1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2025-10-03  7:51 UTC (permalink / raw)
  To: Lukas Herbolt; +Cc: linux-xfs

On Thu, Oct 02, 2025 at 02:28:24PM +0200, Lukas Herbolt wrote:
>  int
>  xfs_alloc_file_space(
>  	struct xfs_inode	*ip,
> +    uint32_t        flags,      /* XFS_BMAPI_... */

This seems to mix tabs and spaces.

>  static int
>  xfs_falloc_zero_range(
>  	struct file		*file,
> -	int			mode,
> +	int				mode,

More whitespace damage here.

>  	loff_t			offset,
>  	loff_t			len,
>  	struct xfs_zone_alloc_ctx *ac)
> @@ -1277,7 +1277,16 @@ xfs_falloc_zero_range(
>  
>  	len = round_up(offset + len, blksize) - round_down(offset, blksize);
>  	offset = round_down(offset, blksize);
> -	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
> +	if (mode & FALLOC_FL_WRITE_ZEROES) {
> +		if (!bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))
> +	        return -EOPNOTSUPP;
> +		error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_ZERO,
> +				offset, len);
> +	}
> +	else

The closing brace goes onto the same line as the else, and we usually
add the brace in all branches.

Otherwise this looks fine.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
  2025-10-03  7:51 ` Christoph Hellwig
@ 2025-10-04  4:00   ` Darrick J. Wong
  2025-10-04  4:16     ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2025-10-04  4:00 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Lukas Herbolt, linux-xfs

On Fri, Oct 03, 2025 at 12:51:05AM -0700, Christoph Hellwig wrote:
> On Thu, Oct 02, 2025 at 02:28:24PM +0200, Lukas Herbolt wrote:
> >  int
> >  xfs_alloc_file_space(
> >  	struct xfs_inode	*ip,
> > +    uint32_t        flags,      /* XFS_BMAPI_... */
> 
> This seems to mix tabs and spaces.
> 
> >  static int
> >  xfs_falloc_zero_range(
> >  	struct file		*file,
> > -	int			mode,
> > +	int				mode,
> 
> More whitespace damage here.
> 
> >  	loff_t			offset,
> >  	loff_t			len,
> >  	struct xfs_zone_alloc_ctx *ac)
> > @@ -1277,7 +1277,16 @@ xfs_falloc_zero_range(
> >  
> >  	len = round_up(offset + len, blksize) - round_down(offset, blksize);
> >  	offset = round_down(offset, blksize);
> > -	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
> > +	if (mode & FALLOC_FL_WRITE_ZEROES) {
> > +		if (!bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))

     		                         not correct ^^^^^^^^^^^^^^^^^^^

You need to find the block device associated with the file because XFS
is a multi-device filesystem.

--D

> > +	        return -EOPNOTSUPP;
> > +		error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_ZERO,
> > +				offset, len);
> > +	}
> > +	else
> 
> The closing brace goes onto the same line as the else, and we usually
> add the brace in all branches.
> 
> Otherwise this looks fine.
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
  2025-10-04  4:00   ` Darrick J. Wong
@ 2025-10-04  4:16     ` Christoph Hellwig
  2025-10-14  8:10       ` lukas
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2025-10-04  4:16 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, Lukas Herbolt, linux-xfs

On Fri, Oct 03, 2025 at 09:00:20PM -0700, Darrick J. Wong wrote:
> > > -	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
> > > +	if (mode & FALLOC_FL_WRITE_ZEROES) {
> > > +		if (!bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))
> 
>      		                         not correct ^^^^^^^^^^^^^^^^^^^
> 
> You need to find the block device associated with the file because XFS
> is a multi-device filesystem.

Indeed. xfs_inode_buftarg will do the work, but we'll need to ensure
the RT bit doesn't get flipped, i.e. it needs to hold a lock between
that check and allocation the blocks if there were none yet.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
  2025-10-04  4:16     ` Christoph Hellwig
@ 2025-10-14  8:10       ` lukas
  2025-10-14 21:15         ` Darrick J. Wong
  0 siblings, 1 reply; 7+ messages in thread
From: lukas @ 2025-10-14  8:10 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-xfs

On 2025-10-04 06:16, Christoph Hellwig wrote:
> On Fri, Oct 03, 2025 at 09:00:20PM -0700, Darrick J. Wong wrote:
>> > > -	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
>> > > +	if (mode & FALLOC_FL_WRITE_ZEROES) {
>> > > +		if (!bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))
>> 
>>      		                         not correct ^^^^^^^^^^^^^^^^^^^
>> 
>> You need to find the block device associated with the file because XFS
>> is a multi-device filesystem.
> 
> Indeed. xfs_inode_buftarg will do the work, but we'll need to ensure

Thanks for xfs_inode_buftarg pointer.

> the RT bit doesn't get flipped, i.e. it needs to hold a lock between
> that check and allocation the blocks if there were none yet.

I am having bit of trouble with that. If I get it right we should hold
the XFS_ILOCK_EXCL but this lock is then grabbed in the 
xfs_trans_alloc_inode.

So I would need to release before and there would be again a small 
window
where the RT flag can be flipped.

Looking at the xfs_alloc_file_space, there is also check for the RT bit 
without
lock, so this also need an attention.
     rt = XFS_IS_REALTIME_INODE(ip);
     extsz = xfs_get_extsz_hint(ip);

Or the xfs_trans_alloc_inode would need to check if we are a;ready 
holding the
lock Is there a way how to check the current thread is the owner of the
xfs_ilock rw_sem?

Something like?
---
static inline bool is_current_writer(struct rw_semaphore *sem)
{
     /* The rwsem_owner() helper can be used to get the owner */
     return sem->owner == current;
}
---

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
  2025-10-14  8:10       ` lukas
@ 2025-10-14 21:15         ` Darrick J. Wong
  0 siblings, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2025-10-14 21:15 UTC (permalink / raw)
  To: lukas; +Cc: Christoph Hellwig, linux-xfs

On Tue, Oct 14, 2025 at 10:10:51AM +0200, lukas@herbolt.com wrote:
> On 2025-10-04 06:16, Christoph Hellwig wrote:
> > On Fri, Oct 03, 2025 at 09:00:20PM -0700, Darrick J. Wong wrote:
> > > > > -	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
> > > > > +	if (mode & FALLOC_FL_WRITE_ZEROES) {
> > > > > +		if (!bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))
> > > 
> > >      		                         not correct ^^^^^^^^^^^^^^^^^^^
> > > 
> > > You need to find the block device associated with the file because XFS
> > > is a multi-device filesystem.
> > 
> > Indeed. xfs_inode_buftarg will do the work, but we'll need to ensure
> 
> Thanks for xfs_inode_buftarg pointer.
> 
> > the RT bit doesn't get flipped, i.e. it needs to hold a lock between
> > that check and allocation the blocks if there were none yet.
> 
> I am having bit of trouble with that. If I get it right we should hold
> the XFS_ILOCK_EXCL but this lock is then grabbed in the
> xfs_trans_alloc_inode.
> 
> So I would need to release before and there would be again a small window
> where the RT flag can be flipped.
> 
> Looking at the xfs_alloc_file_space, there is also check for the RT bit
> without
> lock, so this also need an attention.
>     rt = XFS_IS_REALTIME_INODE(ip);
>     extsz = xfs_get_extsz_hint(ip);
> 
> Or the xfs_trans_alloc_inode would need to check if we are a;ready holding
> the
> lock Is there a way how to check the current thread is the owner of the
> xfs_ilock rw_sem?

Hm?  The VFS takes inode_lock in vfs_fileattr_set prior to changing the
rt status bit, and and __xfs_file_fallocate takes the same lock (aka the
IOLOCK) before calling xfs_falloc_*.

IOWs, a call to xfs_inode_buftarg would see a stable realtime flag and
return the correct results.

--D

> 
> Something like?
> ---
> static inline bool is_current_writer(struct rw_semaphore *sem)
> {
>     /* The rwsem_owner() helper can be used to get the owner */
>     return sem->owner == current;
> }
> ---
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
  2025-10-02 12:28 [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base Lukas Herbolt
  2025-10-03  7:51 ` Christoph Hellwig
@ 2025-10-15  6:30 ` Nirjhar Roy (IBM)
  1 sibling, 0 replies; 7+ messages in thread
From: Nirjhar Roy (IBM) @ 2025-10-15  6:30 UTC (permalink / raw)
  To: Lukas Herbolt, linux-xfs

On Thu, 2025-10-02 at 14:28 +0200, Lukas Herbolt wrote:
> Add support for FALLOC_FL_WRITE_ZEROES if the underlying device enable
> the unmap write zeroes operation.
> 
> Inspired by the Ext4 implementation of the FALLOC_FL_WRITE_ZEROES. It
> can speed up some patterns on specific hardware.
> 
> time ( ./fallocate -l 360M /mnt/test.file; dd if=/dev/zero of=/mnt/test.file \
> bs=1M count=360 conv=notrunc,nocreat oflag=direct,dsync)
> 
> 360+0 records in
> 360+0 records out
> 377487360 bytes (377 MB, 360 MiB) copied, 22.0027 s, 17.2 MB/s
> 
> real	0m22.114s
> user	0m0.006s
> sys		0m3.085s
> 
> time (./fallocate -wl 360M /mnt/test.file; dd if=/dev/zero of=/mnt/test.file \
> bs=1M count=360 conv=notrunc,nocreat oflag=direct,dsync );
> 360+0 records in
> 360+0 records out
> 377487360 bytes (377 MB, 360 MiB) copied, 2.02512 s, 186 MB/s
> 
> real	0m6.384s
> user	0m0.002s
> sys		0m5.823s
> 
> 
> 
> Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
> ---
>  fs/xfs/xfs_bmap_util.c |  5 +++--
>  fs/xfs/xfs_bmap_util.h |  4 ++--
>  fs/xfs/xfs_file.c      | 23 ++++++++++++++++++-----
>  3 files changed, 23 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index 06ca11731e430..a91596a280ba5 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -645,6 +645,7 @@ xfs_free_eofblocks(
>  int
>  xfs_alloc_file_space(
>  	struct xfs_inode	*ip,
> +    uint32_t        flags,      /* XFS_BMAPI_... */
Spacing issue
>  	xfs_off_t		offset,
>  	xfs_off_t		len)
>  {
> @@ -748,8 +749,8 @@ xfs_alloc_file_space(
>  		 * will eventually reach the requested range.
>  		 */
>  		error = xfs_bmapi_write(tp, ip, startoffset_fsb,
> -				allocatesize_fsb, XFS_BMAPI_PREALLOC, 0, imapp,
> -				&nimaps);
> +				allocatesize_fsb, flags, 0, imapp, &nimaps);
> +
>  		if (error) {
>  			if (error != -ENOSR)
>  				goto error;
> diff --git a/fs/xfs/xfs_bmap_util.h b/fs/xfs/xfs_bmap_util.h
> index c477b33616304..67770830eb245 100644
> --- a/fs/xfs/xfs_bmap_util.h
> +++ b/fs/xfs/xfs_bmap_util.h
> @@ -55,8 +55,8 @@ int	xfs_bmap_last_extent(struct xfs_trans *tp, struct xfs_inode *ip,
>  			     int *is_empty);
>  
>  /* preallocation and hole punch interface */
> -int	xfs_alloc_file_space(struct xfs_inode *ip, xfs_off_t offset,
> -		xfs_off_t len);
> +int	xfs_alloc_file_space(struct xfs_inode *ip, uint32_t flags,
> +		xfs_off_t offset, xfs_off_t len);
>  int	xfs_free_file_space(struct xfs_inode *ip, xfs_off_t offset,
>  		xfs_off_t len, struct xfs_zone_alloc_ctx *ac);
>  int	xfs_collapse_file_space(struct xfs_inode *, xfs_off_t offset,
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index f96fbf5c54c99..48559a011e9b4 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -1255,7 +1255,7 @@ xfs_falloc_insert_range(
>  static int
>  xfs_falloc_zero_range(
>  	struct file		*file,
> -	int			mode,
> +	int				mode,
>  	loff_t			offset,
>  	loff_t			len,
>  	struct xfs_zone_alloc_ctx *ac)
> @@ -1277,7 +1277,16 @@ xfs_falloc_zero_range(
>  
>  	len = round_up(offset + len, blksize) - round_down(offset, blksize);
>  	offset = round_down(offset, blksize);
> -	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
> +	if (mode & FALLOC_FL_WRITE_ZEROES) {
> +		if (!bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))
> +	        return -EOPNOTSUPP;
indentation issue above.
You can use ./scripts/checkpatch.pl --max-line-length=80 <path to patch files>. This should catch
most of the common styling issues. Yes, there are XFS specific styles which the above script will
not be able to catch. 
--NR
> +		error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_ZERO,
> +				offset, len);
> +	}
> +	else
> +		error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_PREALLOC,
> +				offset, len);
> +
>  	if (error)
>  		return error;
>  	return xfs_falloc_setsize(file, new_size);
> @@ -1302,7 +1311,8 @@ xfs_falloc_unshare_range(
>  	if (error)
>  		return error;
>  
> -	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
> +	error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_PREALLOC,
> +			offset, len);
>  	if (error)
>  		return error;
>  	return xfs_falloc_setsize(file, new_size);
> @@ -1330,7 +1340,9 @@ xfs_falloc_allocate_range(
>  	if (error)
>  		return error;
>  
> -	error = xfs_alloc_file_space(XFS_I(inode), offset, len);
> +	error = xfs_alloc_file_space(XFS_I(inode), XFS_BMAPI_PREALLOC,
> +			offset, len);
> +
>  	if (error)
>  		return error;
>  	return xfs_falloc_setsize(file, new_size);
> @@ -1340,7 +1352,7 @@ xfs_falloc_allocate_range(
>  		(FALLOC_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |	\
>  		 FALLOC_FL_PUNCH_HOLE |	FALLOC_FL_COLLAPSE_RANGE |	\
>  		 FALLOC_FL_ZERO_RANGE |	FALLOC_FL_INSERT_RANGE |	\
> -		 FALLOC_FL_UNSHARE_RANGE)
> +		 FALLOC_FL_UNSHARE_RANGE | FALLOC_FL_WRITE_ZEROES )
>  
>  STATIC long
>  __xfs_file_fallocate(
> @@ -1383,6 +1395,7 @@ __xfs_file_fallocate(
>  	case FALLOC_FL_INSERT_RANGE:
>  		error = xfs_falloc_insert_range(file, offset, len);
>  		break;
> +	case FALLOC_FL_WRITE_ZEROES:
>  	case FALLOC_FL_ZERO_RANGE:
>  		error = xfs_falloc_zero_range(file, mode, offset, len, ac);
>  		break;


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-10-15  6:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02 12:28 [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base Lukas Herbolt
2025-10-03  7:51 ` Christoph Hellwig
2025-10-04  4:00   ` Darrick J. Wong
2025-10-04  4:16     ` Christoph Hellwig
2025-10-14  8:10       ` lukas
2025-10-14 21:15         ` Darrick J. Wong
2025-10-15  6:30 ` Nirjhar Roy (IBM)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).