ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cifs: switch to noop_direct_IO
@ 2021-09-23 11:59 Jeff Layton
  2021-09-23 13:01 ` Jeff Layton
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2021-09-23 11:59 UTC (permalink / raw)
  To: ceph-devel; +Cc: idryomov, Matthew Wilcox

The cifs one is identical to the noop one. Just use it instead.

Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/cifs/file.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index d0216472f1c6..2406b9ddd623 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -4890,25 +4890,6 @@ void cifs_oplock_break(struct work_struct *work)
 	cifs_done_oplock_break(cinode);
 }
 
-/*
- * The presence of cifs_direct_io() in the address space ops vector
- * allowes open() O_DIRECT flags which would have failed otherwise.
- *
- * In the non-cached mode (mount with cache=none), we shunt off direct read and write requests
- * so this method should never be called.
- *
- * Direct IO is not yet supported in the cached mode. 
- */
-static ssize_t
-cifs_direct_io(struct kiocb *iocb, struct iov_iter *iter)
-{
-        /*
-         * FIXME
-         * Eventually need to support direct IO for non forcedirectio mounts
-         */
-        return -EINVAL;
-}
-
 static int cifs_swap_activate(struct swap_info_struct *sis,
 			      struct file *swap_file, sector_t *span)
 {
@@ -4973,7 +4954,7 @@ const struct address_space_operations cifs_addr_ops = {
 	.write_end = cifs_write_end,
 	.set_page_dirty = __set_page_dirty_nobuffers,
 	.releasepage = cifs_release_page,
-	.direct_IO = cifs_direct_io,
+	.direct_IO = noop_direct_io,
 	.invalidatepage = cifs_invalidate_page,
 	.launder_page = cifs_launder_page,
 	/*
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cifs: switch to noop_direct_IO
  2021-09-23 11:59 [PATCH] cifs: switch to noop_direct_IO Jeff Layton
@ 2021-09-23 13:01 ` Jeff Layton
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2021-09-23 13:01 UTC (permalink / raw)
  To: ceph-devel; +Cc: idryomov, Matthew Wilcox

On Thu, 2021-09-23 at 07:59 -0400, Jeff Layton wrote:
> The cifs one is identical to the noop one. Just use it instead.
> 
> Cc: Matthew Wilcox <willy@infradead.org>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/cifs/file.c | 21 +--------------------
>  1 file changed, 1 insertion(+), 20 deletions(-)
> 
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index d0216472f1c6..2406b9ddd623 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -4890,25 +4890,6 @@ void cifs_oplock_break(struct work_struct *work)
>  	cifs_done_oplock_break(cinode);
>  }
>  
> -/*
> - * The presence of cifs_direct_io() in the address space ops vector
> - * allowes open() O_DIRECT flags which would have failed otherwise.
> - *
> - * In the non-cached mode (mount with cache=none), we shunt off direct read and write requests
> - * so this method should never be called.
> - *
> - * Direct IO is not yet supported in the cached mode. 
> - */
> -static ssize_t
> -cifs_direct_io(struct kiocb *iocb, struct iov_iter *iter)
> -{
> -        /*
> -         * FIXME
> -         * Eventually need to support direct IO for non forcedirectio mounts
> -         */
> -        return -EINVAL;
> -}
> -
>  static int cifs_swap_activate(struct swap_info_struct *sis,
>  			      struct file *swap_file, sector_t *span)
>  {
> @@ -4973,7 +4954,7 @@ const struct address_space_operations cifs_addr_ops = {
>  	.write_end = cifs_write_end,
>  	.set_page_dirty = __set_page_dirty_nobuffers,
>  	.releasepage = cifs_release_page,
> -	.direct_IO = cifs_direct_io,
> +	.direct_IO = noop_direct_io,
>  	.invalidatepage = cifs_invalidate_page,
>  	.launder_page = cifs_launder_page,
>  	/*

Disregard this patch. Sent to the wrong recipients and it has a bug to
boot.
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-23 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 11:59 [PATCH] cifs: switch to noop_direct_IO Jeff Layton
2021-09-23 13:01 ` Jeff Layton

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 NNTP newsgroup(s).