Linux-XFS Archive mirror
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: chandan.babu@oracle.com, dchinner@redhat.com, djwong@kernel.org,
	hch@lst.de, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: Fix xfs_flush_unmap_range() range for RT
Date: Fri, 10 May 2024 12:10:25 +0100	[thread overview]
Message-ID: <112d379e-bcdc-478e-bfd1-511d4f4371f1@oracle.com> (raw)
In-Reply-To: <Zj1e66zN0iReurEu@dread.disaster.area>

On 10/05/2024 00:40, Dave Chinner wrote:
>>   
>> -	rounding = max_t(xfs_off_t, mp->m_sb.sb_blocksize, PAGE_SIZE);
>> -	start = round_down(offset, rounding);
>> -	end = round_up(offset + len, rounding) - 1;
>> +	/*
>> +	 * Make sure we extend the flush out to extent alignment
>> +	 * boundaries so any extent range overlapping the start/end
>> +	 * of the modification we are about to do is clean and idle.
>> +	 */
>> +	rounding = max_t(xfs_off_t, xfs_inode_alloc_unitsize(ip), PAGE_SIZE);
>> +	start = rounddown(offset, rounding);
>> +	end = roundup(offset + len, rounding) - 1;

I have to admit that I am not the biggest fan of this rounding API.

So round_{down, up}() happens to handle 64b, but round{down, up} doesn't :(

And that is not to mention the vague naming.

> These are 64 bit values, so roundup_64() and rounddown_64().

yeah, thanks.

I can't help but think such a thing should be part of core kernel API.

Thanks,
John






  reply	other threads:[~2024-05-10 11:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 10:40 [PATCH 0/2] xfs: fallocate RT flush unmap range fixes John Garry
2024-05-09 10:40 ` [PATCH 1/2] xfs: Fix xfs_flush_unmap_range() range for RT John Garry
2024-05-09 22:59   ` kernel test robot
2024-05-09 23:40   ` Dave Chinner
2024-05-10 11:10     ` John Garry [this message]
2024-05-09 10:40 ` [PATCH 2/2] xfs: Fix xfs_prepare_shift() " John Garry
2024-05-10  5:35   ` kernel test robot
2024-05-09 14:35 ` [PATCH 0/2] xfs: fallocate RT flush unmap range fixes Darrick J. Wong

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=112d379e-bcdc-478e-bfd1-511d4f4371f1@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=chandan.babu@oracle.com \
    --cc=david@fromorbit.com \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).