lkml.org 
[lkml]   [2019]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/filemap.c: Simplify the calculation of ra->prev_pos
Date
The calculation of ra->prev_pos can be simplified.

Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn>
---
mm/filemap.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 9f5e323..7f30844 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2279,9 +2279,7 @@ static ssize_t generic_file_buffered_read(struct kiocb *iocb,
would_block:
error = -EAGAIN;
out:
- ra->prev_pos = prev_index;
- ra->prev_pos <<= PAGE_SHIFT;
- ra->prev_pos |= prev_offset;
+ ra->prev_pos = (prev_index << PAGE_SHIFT) | prev_offset;

*ppos = ((loff_t)index << PAGE_SHIFT) + offset;
file_accessed(filp);
--
1.9.1
\
 
 \ /
  Last update: 2019-01-25 14:36    [W:0.155 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site