CEPH filesystem development
 help / color / mirror / Atom feed
From: Xiubo Li <xiubli@redhat.com>
To: Christoph Hellwig <hch@lst.de>,
	idryomov@gmail.com, jlayton@kernel.org,
	ceph-devel@vger.kernel.org
Subject: Re: [PATCH] ceph: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
Date: Tue, 13 Jun 2023 08:57:42 +0800	[thread overview]
Message-ID: <099cc669-11b9-e5f1-e370-599679e87806@redhat.com> (raw)
In-Reply-To: <20230612053537.585525-1-hch@lst.de>


On 6/12/23 13:35, Christoph Hellwig wrote:
> Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file
> systems can just set the FMODE_CAN_ODIRECT flag at open time instead of
> wiring up a dummy direct_IO method to indicate support for direct I/O.
> Do that for ceph so that noop_direct_IO can eventually be removed.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   fs/ceph/addr.c | 1 -
>   fs/ceph/file.c | 2 ++
>   2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index 6bb251a4d613eb..19c0f42540b600 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -1401,7 +1401,6 @@ const struct address_space_operations ceph_aops = {
>   	.dirty_folio = ceph_dirty_folio,
>   	.invalidate_folio = ceph_invalidate_folio,
>   	.release_folio = ceph_release_folio,
> -	.direct_IO = noop_direct_IO,
>   };
>   
>   static void ceph_block_sigs(sigset_t *oldset)
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index f4d8bf7dec88a8..314c5d5971bf4a 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -368,6 +368,8 @@ int ceph_open(struct inode *inode, struct file *file)
>   	flags = file->f_flags & ~(O_CREAT|O_EXCL);
>   	if (S_ISDIR(inode->i_mode))
>   		flags = O_DIRECTORY;  /* mds likes to know */
> +	if (S_ISREG(inode->i_mode))
> +		file->f_mode |= FMODE_CAN_ODIRECT;
>   

Shouldn't we do the same in 'ceph_atomic_open()' too ?

Thanks

- Xiubo


>   	dout("open inode %p ino %llx.%llx file %p flags %d (%d)\n", inode,
>   	     ceph_vinop(inode), file, flags, file->f_flags);


  reply	other threads:[~2023-06-13  0:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12  5:35 [PATCH] ceph: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Christoph Hellwig
2023-06-13  0:57 ` Xiubo Li [this message]
2023-06-13  6:01   ` Christoph Hellwig
2023-06-13  1:06 ` Xiubo Li

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=099cc669-11b9-e5f1-e370-599679e87806@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=idryomov@gmail.com \
    --cc=jlayton@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