[PATCH 02/12] flash_read should update ppos instead of file->f_pos

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jan Blunck
Date: Friday, April 9, 2010 - 7:00 am

flash_read() updates file->f_pos directly instead of the ppos given. The
VFS later updates the file->f_pos and overwrites it with the unchanged
value of ppos.

Signed-off-by: Jan Blunck <jblunck@suse.de>
---
 drivers/sbus/char/flash.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 4108347..12cd438 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -106,9 +106,9 @@ static ssize_t
 flash_read(struct file * file, char __user * buf,
 	   size_t count, loff_t *ppos)
 {
-	unsigned long p = file->f_pos;
+	loff_t p = *ppos;
 	int i;
-	
+
 	if (count > flash.read_size - p)
 		count = flash.read_size - p;
 
@@ -119,7 +119,7 @@ flash_read(struct file * file, char __user * buf,
 		buf++;
 	}
 
-	file->f_pos += count;
+	*ppos += count;
 	return count;
 }
 
-- 
1.6.4.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 02/12] flash_read should update ppos instead of fil ..., Jan Blunck, (Fri Apr 9, 7:00 am)
[PATCH 06/12] zcrypt: Use nonseekable_open(), Jan Blunck, (Fri Apr 9, 7:00 am)
[PATCH 07/12] rtc-m41t80: Use nonseekable_open(), Jan Blunck, (Fri Apr 9, 7:00 am)
[PATCH 08/12] Introduce noop_llseek(), Jan Blunck, (Fri Apr 9, 7:00 am)