diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-06-08 15:45:45 +0100 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-06-08 15:45:45 +0100 |
commit | 364f6c717deef4a3ac4982e670fa9846b43cd060 (patch) | |
tree | 47e3967d6e2220130f2c070e300c97709143b28f /mm/filemap.c | |
parent | 4ff4258a3e558814a3d48c50a59cd22f56bbea2f (diff) | |
parent | 1d6757fbff5bc86e94e59ab0d7bdd7e71351d839 (diff) | |
download | kernel_samsung_tuna-364f6c717deef4a3ac4982e670fa9846b43cd060.zip kernel_samsung_tuna-364f6c717deef4a3ac4982e670fa9846b43cd060.tar.gz kernel_samsung_tuna-364f6c717deef4a3ac4982e670fa9846b43cd060.tar.bz2 |
Automatic merge with /usr/src/ntfs-2.6.git
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 1d33fec..4a2fee2 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1968,6 +1968,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov, do { unsigned long index; unsigned long offset; + unsigned long maxlen; size_t copied; offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */ @@ -1982,7 +1983,10 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov, * same page as we're writing to, without it being marked * up-to-date. */ - fault_in_pages_readable(buf, bytes); + maxlen = cur_iov->iov_len - iov_base; + if (maxlen > bytes) + maxlen = bytes; + fault_in_pages_readable(buf, maxlen); page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec); if (!page) { @@ -2024,6 +2028,8 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov, filemap_set_next_iovec(&cur_iov, &iov_base, status); buf = cur_iov->iov_base + iov_base; + } else { + iov_base += status; } } } |