* + mm-filemap-simplify-generic_file_read_iter.patch added to -mm tree
@ 2021-01-24 1:49 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-01-24 1:49 UTC (permalink / raw)
To: hch, kent.overstreet, linmiaohe, mm-commits, willy
The patch titled
Subject: mm/filemap: simplify generic_file_read_iter
has been added to the -mm tree. Its filename is
mm-filemap-simplify-generic_file_read_iter.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-filemap-simplify-generic_file_read_iter.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-filemap-simplify-generic_file_read_iter.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Christoph Hellwig <hch@lst.de>
Subject: mm/filemap: simplify generic_file_read_iter
Avoid the pointless goto out just for returning retval.
Link: https://lkml.kernel.org/r/20210122160140.223228-19-willy@infradead.org
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/filemap.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
--- a/mm/filemap.c~mm-filemap-simplify-generic_file_read_iter
+++ a/mm/filemap.c
@@ -2536,7 +2536,7 @@ generic_file_read_iter(struct kiocb *ioc
ssize_t retval = 0;
if (!count)
- goto out; /* skip atime */
+ return 0; /* skip atime */
if (iocb->ki_flags & IOCB_DIRECT) {
struct file *file = iocb->ki_filp;
@@ -2554,7 +2554,7 @@ generic_file_read_iter(struct kiocb *ioc
iocb->ki_pos,
iocb->ki_pos + count - 1);
if (retval < 0)
- goto out;
+ return retval;
}
file_accessed(file);
@@ -2578,12 +2578,10 @@ generic_file_read_iter(struct kiocb *ioc
*/
if (retval < 0 || !count || iocb->ki_pos >= size ||
IS_DAX(inode))
- goto out;
+ return retval;
}
- retval = filemap_read(iocb, iter, retval);
-out:
- return retval;
+ return filemap_read(iocb, iter, retval);
}
EXPORT_SYMBOL(generic_file_read_iter);
_
Patches currently in -mm which might be from hch@lst.de are
mm-filemap-rename-generic_file_buffered_read-to-filemap_read.patch
mm-filemap-simplify-generic_file_read_iter.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-24 1:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24 1:49 + mm-filemap-simplify-generic_file_read_iter.patch added to -mm tree akpm
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.