linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Lukas Herbolt <lukas@herbolt.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
Date: Fri, 3 Oct 2025 00:51:05 -0700	[thread overview]
Message-ID: <aN-Aac7J7xjMb_9l@infradead.org> (raw)
In-Reply-To: <20251002122823.1875398-2-lukas@herbolt.com>

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.

  reply	other threads:[~2025-10-03  7:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aN-Aac7J7xjMb_9l@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lukas@herbolt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).