Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Pankaj Raghav <pankaj.raghav@linux.dev>
To: Christoph Hellwig <hch@infradead.org>,
	Pankaj Raghav <p.raghav@samsung.com>
Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com, lukas@herbolt.com,
	"Darrick J . Wong" <djwong@kernel.org>,
	dgc@kernel.org, gost.dev@samsung.com, andres@anarazel.de,
	kundan.kumar@samsung.com, cem@kernel.org
Subject: Re: [PATCH v3 1/3] xfs: add xfs_bmap_alloc_or_convert_range function
Date: Sun, 26 Apr 2026 08:35:12 +0200	[thread overview]
Message-ID: <63f16faa-f1a2-4ba5-a834-72da3584dbae@linux.dev> (raw)
In-Reply-To: <aet1hhhRPGg5eGmK@infradead.org>

On 4/24/26 15:52, Christoph Hellwig wrote:
>> +/*
>> + * This function is used to allocate written extents over holes
>> + * and/or convert unwritten extents to written extents based on the
>> + * @flags passed to it.
> 
> You can and should use up all 80 characters for comments.
> 
>> + */
>> +int
>> +xfs_bmap_alloc_or_convert_range(
>> +	struct xfs_inode	*ip,
>> +	xfs_off_t		offset,
>> +	xfs_off_t		count,
>> +	uint32_t		flags,
>> +	bool			update_isize)
>> +{
> 
> Please keep this function in the same please as the generalized
> version it was base on so that git diff/show shows what changed.
> If you have to move it around for later patches do that in
> an otherwise no-op prep patch.
> 

So IIUC, you are suggesting to add this function in xfs_iomap.c itself and move it to
bmap_util.c in an another prep patch.

>> +		} else {
>> +			/*
>> +			 * We might allocate data blocks (needs resblks + 1 split) or
>> +			 * convert an unwritten extent (needs 0 data blocks + 2 splits).
>> +			 * Ensure we have enough block reservation for the worst case.
>> +			 */
>> +			resblks = XFS_FILBLKS_MIN(count_fsb, XFS_MAX_BMBT_EXTLEN);
> 
> Please avoid the overly long lines.
> 

I will change them all in the next version. Thanks for your comments.

--
Pankaj

  reply	other threads:[~2026-04-26  6:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 10:55 [PATCH v3 0/3] add FALLOC_FL_WRITE_ZEROES support to xfs Pankaj Raghav
2026-04-20 10:55 ` [PATCH v3 1/3] xfs: add xfs_bmap_alloc_or_convert_range function Pankaj Raghav
2026-04-24 13:52   ` Christoph Hellwig
2026-04-26  6:35     ` Pankaj Raghav [this message]
2026-04-20 10:55 ` [PATCH v3 2/3] xfs: add support for FALLOC_FL_WRITE_ZEROES Pankaj Raghav
2026-04-20 10:55 ` [PATCH v3 3/3] xfs: add a sysfs entry to enable write zeroes even if HW does not support it Pankaj Raghav
2026-04-24 13:52   ` Christoph Hellwig
2026-04-26  6:28     ` Pankaj Raghav

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=63f16faa-f1a2-4ba5-a834-72da3584dbae@linux.dev \
    --to=pankaj.raghav@linux.dev \
    --cc=andres@anarazel.de \
    --cc=bfoster@redhat.com \
    --cc=cem@kernel.org \
    --cc=dgc@kernel.org \
    --cc=djwong@kernel.org \
    --cc=gost.dev@samsung.com \
    --cc=hch@infradead.org \
    --cc=kundan.kumar@samsung.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lukas@herbolt.com \
    --cc=p.raghav@samsung.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