Commit 0116651c authored by Namhyung Kim's avatar Namhyung Kim Committed by Linus Torvalds

mm: remove temporary variable on generic_file_direct_write()

'end' shadows earlier one and is not necessary at all.  Remove it and use
'pos' instead.  This removes following sparse warnings:

 mm/filemap.c:2180:24: warning: symbol 'end' shadows an earlier one
 mm/filemap.c:2132:25: originally declared here
Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 68da336a
...@@ -2193,12 +2193,12 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -2193,12 +2193,12 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
} }
if (written > 0) { if (written > 0) {
loff_t end = pos + written; pos += written;
if (end > i_size_read(inode) && !S_ISBLK(inode->i_mode)) { if (pos > i_size_read(inode) && !S_ISBLK(inode->i_mode)) {
i_size_write(inode, end); i_size_write(inode, pos);
mark_inode_dirty(inode); mark_inode_dirty(inode);
} }
*ppos = end; *ppos = pos;
} }
out: out:
return written; return written;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment