From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Lukas Herbolt <lukas@herbolt.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
Date: Fri, 3 Oct 2025 21:00:20 -0700 [thread overview]
Message-ID: <20251004040020.GC8096@frogsfrogsfrogs> (raw)
In-Reply-To: <aN-Aac7J7xjMb_9l@infradead.org>
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.
>
next prev parent reply other threads:[~2025-10-04 4:00 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
2025-10-04 4:00 ` Darrick J. Wong [this message]
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=20251004040020.GC8096@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=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).