diff options
Diffstat (limited to 'fs/libfs.c')
-rw-r--r-- | fs/libfs.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/libfs.c b/fs/libfs.c index 6e68b700958d..5523bde96387 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
@@ -341,13 +341,10 @@ int simple_prepare_write(struct file *file, struct page *page, | |||
341 | unsigned from, unsigned to) | 341 | unsigned from, unsigned to) |
342 | { | 342 | { |
343 | if (!PageUptodate(page)) { | 343 | if (!PageUptodate(page)) { |
344 | if (to - from != PAGE_CACHE_SIZE) { | 344 | if (to - from != PAGE_CACHE_SIZE) |
345 | void *kaddr = kmap_atomic(page, KM_USER0); | 345 | zero_user_segments(page, |
346 | memset(kaddr, 0, from); | 346 | 0, from, |
347 | memset(kaddr + to, 0, PAGE_CACHE_SIZE - to); | 347 | to, PAGE_CACHE_SIZE); |
348 | flush_dcache_page(page); | ||
349 | kunmap_atomic(kaddr, KM_USER0); | ||
350 | } | ||
351 | } | 348 | } |
352 | return 0; | 349 | return 0; |
353 | } | 350 | } |