All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: John Garry <john.g.garry@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>, Carlos Maiolino <cem@kernel.org>,
	"Darrick J. Wong" <djwong@kernel.org>,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/7] xfs: refactor xfs_calc_atomic_write_unit_max
Date: Wed, 18 Jun 2025 07:08:21 +0200	[thread overview]
Message-ID: <20250618050821.GC28260@lst.de> (raw)
In-Reply-To: <e8cf8a81-56c5-4279-8e19-d758543a4517@oracle.com>

On Tue, Jun 17, 2025 at 12:44:57PM +0100, John Garry wrote:
>> -	struct xfs_groups	*rgs = &mp->m_groups[XG_TYPE_RTG];
>> +	struct xfs_groups	*g = &mp->m_groups[type];
>> +	struct xfs_buftarg	*btp = type == XG_TYPE_RTG ?
>> +			mp->m_rtdev_targp : mp->m_ddev_targp;
>
> Could this be made a bit more readable?

Suggestions welcome.

>
>>   -	if (rgs->blocks == 0)
>> +	if (g->blocks == 0)
>>   		return 0;
>> -	if (mp->m_rtdev_targp && mp->m_rtdev_targp->bt_bdev_awu_min > 0)
>> -		return max_pow_of_two_factor(rgs->blocks);
>> -	return rounddown_pow_of_two(rgs->blocks);
>> +	if (btp && btp->bt_bdev_awu_min > 0)
>
> Is it actually logically possible that g->blocks != 0 and btp == NULL? 
> That's really a comment on the current rt handling.

No.  For the data device btp is never NULL, and for the RT device we
reject the mount early on in this case, see xfs_rtmount_readsb and
xfs_rtmount_init.


  reply	other threads:[~2025-06-18  5:08 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 10:51 misc cleanups Christoph Hellwig
2025-06-17 10:51 ` [PATCH 1/7] xfs: clean up the initial read logic in xfs_readsb Christoph Hellwig
2025-07-01 14:55   ` Darrick J. Wong
2025-06-17 10:52 ` [PATCH 2/7] xfs: remove the call to sync_blockdev in xfs_configure_buftarg Christoph Hellwig
2025-06-17 12:09   ` John Garry
2025-06-24 14:07     ` Christoph Hellwig
2025-06-24 14:46       ` John Garry
2025-06-17 10:52 ` [PATCH 3/7] xfs: remove the call to bdev_validate_blocksize " Christoph Hellwig
2025-06-17 23:40   ` Dave Chinner
2025-06-18  5:05     ` Christoph Hellwig
2025-06-17 10:52 ` [PATCH 4/7] xfs: refactor xfs_calc_atomic_write_unit_max Christoph Hellwig
2025-06-17 11:44   ` John Garry
2025-06-18  5:08     ` Christoph Hellwig [this message]
2025-06-18  6:28       ` John Garry
2025-06-24 14:09         ` Christoph Hellwig
2025-06-24 15:03           ` John Garry
2025-06-17 10:52 ` [PATCH 5/7] xfs: rename the bt_bdev_* buftarg fields Christoph Hellwig
2025-06-17 12:02   ` John Garry
2025-06-18  5:10     ` Christoph Hellwig
2025-06-18  6:23       ` John Garry
2025-06-17 10:52 ` [PATCH 6/7] xfs: remove the bt_bdev_file buftarg field Christoph Hellwig
2025-06-17 10:52 ` [PATCH 7/7] xfs: remove the bt_meta_sectorsize field in struct buftarg Christoph Hellwig
2025-06-17 12:15   ` John Garry
2025-06-17 12:21     ` John Garry
2025-06-18  5:11       ` Christoph Hellwig
2025-06-17 23:51   ` Dave Chinner
2025-06-18  5:15     ` Christoph Hellwig
2025-06-19  2:42       ` Dave Chinner
2025-06-24 14:11         ` Christoph Hellwig
2025-06-24 23:55           ` Dave Chinner
2025-06-25  6:23             ` Christoph Hellwig
2025-06-18  8:09   ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2025-07-01 10:40 misc cleanups v2 Christoph Hellwig
2025-07-01 10:40 ` [PATCH 4/7] xfs: refactor xfs_calc_atomic_write_unit_max Christoph Hellwig
2025-07-01 16:53   ` 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=20250618050821.GC28260@lst.de \
    --to=hch@lst.de \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=john.g.garry@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.