Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Keith Busch <kbusch@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	Keith Busch <kbusch@meta.com>,
	linux-block@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org,
	axboe@kernel.dk, jack@suse.cz, brauner@kernel.org,
	cem@kernel.org, jaegeuk@kernel.org, aalbersh@kernel.org,
	tytso@mit.edu
Subject: Re: [PATCHv2 3/5] xfs: report direct io attributes through file_getattr
Date: Tue, 14 Jul 2026 21:37:46 -0700	[thread overview]
Message-ID: <alcOmorM0Sa0nHHE@infradead.org> (raw)
In-Reply-To: <alalpRYxjqtdJhVR@kbusch-mbp>

On Tue, Jul 14, 2026 at 03:09:57PM -0600, Keith Busch wrote:
> +void bdev_dio_align(struct block_device *bdev, struct fs_dio_align *align)

Nit: I'd usually pass the filled in structure before the source of the
information.

> +	case FS_IOC_GETDIOALIGN: {
> +		struct fs_dio_align align = {};
> +
> +		bdev_dio_align(bdev, &align);
> +		return copy_to_user(argp, &align, sizeof(align)) ? -EFAULT : 0;
> +	}

... and I'd probably split this into a little helper function as the
ioctl handlers sooner or later become a mess otherwise.

> +	case FS_IOC_GETDIOALIGN: {
> +		struct fs_dio_align	align = {};
> +
> +		if (!S_ISREG(inode->i_mode))
> +			return -ENOTTY;
> +		bdev_dio_align(xfs_inode_buftarg(ip)->bt_bdev, &align);
> +		if (xfs_is_cow_inode(ip))
> +			align.dio_offset_align = xfs_inode_alloc_unitsize(ip);
> +		if (copy_to_user(arg, &align, sizeof(align)))
> +			return -EFAULT;

Same here.

Otherwise this looks good to me.

      reply	other threads:[~2026-07-15  4:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260710210646.3576365-1-kbusch@meta.com>
2026-07-10 21:53 ` [f2fs-dev] [PATCHv2 0/5] direct-io file extended attributes Eric Biggers
2026-07-10 22:58   ` Keith Busch
2026-07-11  0:24     ` Eric Biggers
2026-07-11  1:06       ` Keith Busch
     [not found] ` <20260710210646.3576365-2-kbusch@meta.com>
2026-07-13 10:14   ` [PATCHv2 1/5] fs: add direct io attributes to file_getattr Christoph Hellwig
     [not found] ` <20260710210646.3576365-3-kbusch@meta.com>
2026-07-13 11:57   ` [PATCHv2 2/5] block: report direct io attributes through file_getattr Christoph Hellwig
     [not found] ` <20260710210646.3576365-4-kbusch@meta.com>
2026-07-13 12:00   ` [PATCHv2 3/5] xfs: " Christoph Hellwig
2026-07-14 21:09     ` Keith Busch
2026-07-15  4:37       ` Christoph Hellwig [this message]

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=alcOmorM0Sa0nHHE@infradead.org \
    --to=hch@infradead.org \
    --cc=aalbersh@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=jack@suse.cz \
    --cc=jaegeuk@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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