linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ocfs2: remove trivial nowait check for buffered read/write
@ 2020-02-01  7:12 qiwuchen55
  2020-02-02  9:01 ` Joseph Qi
  0 siblings, 1 reply; 2+ messages in thread
From: qiwuchen55 @ 2020-02-01  7:12 UTC (permalink / raw)
  To: mark, jlbec, joseph.qi, trivial; +Cc: ocfs2-devel, linux-kernel, chenqiwu

From: chenqiwu <chenqiwu@xiaomi.com>

Remove trivial nowait check for buffered read/write, since
buffered read is checked in generic_file_read_iter()->
generic_file_buffered_read(), buffered write is checked in
generic_write_checks().

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 fs/ocfs2/file.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 9876db5..6a5e3b0 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2298,9 +2298,6 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb,
 		file->f_path.dentry->d_name.name,
 		(unsigned int)from->nr_segs);	/* GRRRRR */
 
-	if (!direct_io && nowait)
-		return -EOPNOTSUPP;
-
 	if (count == 0)
 		return 0;
 
@@ -2453,9 +2450,6 @@ static ssize_t ocfs2_file_read_iter(struct kiocb *iocb,
 		goto bail;
 	}
 
-	if (!direct_io && nowait)
-		return -EOPNOTSUPP;
-
 	/*
 	 * buffered reads protect themselves in ->readpage().  O_DIRECT reads
 	 * need locks to protect pending reads from racing with truncate.
-- 
1.9.1


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

* Re: [PATCH] ocfs2: remove trivial nowait check for buffered read/write
  2020-02-01  7:12 [PATCH] ocfs2: remove trivial nowait check for buffered read/write qiwuchen55
@ 2020-02-02  9:01 ` Joseph Qi
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Qi @ 2020-02-02  9:01 UTC (permalink / raw)
  To: qiwuchen55, mark, jlbec, trivial; +Cc: ocfs2-devel, linux-kernel, chenqiwu



On 20/2/1 15:12, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> Remove trivial nowait check for buffered read/write, since
> buffered read is checked in generic_file_read_iter()->
> generic_file_buffered_read(), buffered write is checked in
> generic_write_checks().
> 
You are right, but check it at the beginning of
ocfs2_file_[read|write]_iter() will save much effort for lock ops, so
I'd like to leave them there.

Thanks,
Joseph

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

end of thread, other threads:[~2020-02-02  9:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-01  7:12 [PATCH] ocfs2: remove trivial nowait check for buffered read/write qiwuchen55
2020-02-02  9:01 ` Joseph Qi

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).