diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-08 16:03:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-08 16:03:35 -0400 |
commit | f8409abdc592e13cefbe4e4a24a84b3d5741e85f (patch) | |
tree | b016b7158eb080d59bf79605958cb746d545f56d /fs/ext4/page-io.c | |
parent | b20dcab9d4589ef9918a13c888c5493945adfc13 (diff) | |
parent | bd9db175dde14b606265e0d37e8319d96fe1a58f (diff) |
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 updates from Ted Ts'o:
"Clean ups and miscellaneous bug fixes, in particular for the new
collapse_range and zero_range fallocate functions. In addition,
improve the scalability of adding and remove inodes from the orphan
list"
* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (25 commits)
ext4: handle symlink properly with inline_data
ext4: fix wrong assert in ext4_mb_normalize_request()
ext4: fix zeroing of page during writeback
ext4: remove unused local variable "stored" from ext4_readdir(...)
ext4: fix ZERO_RANGE test failure in data journalling
ext4: reduce contention on s_orphan_lock
ext4: use sbi in ext4_orphan_{add|del}()
ext4: use EXT_MAX_BLOCKS in ext4_es_can_be_merged()
ext4: add missing BUFFER_TRACE before ext4_journal_get_write_access
ext4: remove unnecessary double parentheses
ext4: do not destroy ext4_groupinfo_caches if ext4_mb_init() fails
ext4: make local functions static
ext4: fix block bitmap validation when bigalloc, ^flex_bg
ext4: fix block bitmap initialization under sparse_super2
ext4: find the group descriptors on a 1k-block bigalloc,meta_bg filesystem
ext4: avoid unneeded lookup when xattr name is invalid
ext4: fix data integrity sync in ordered mode
ext4: remove obsoleted check
ext4: add a new spinlock i_raw_lock to protect the ext4's raw inode
ext4: fix locking for O_APPEND writes
...
Diffstat (limited to 'fs/ext4/page-io.c')
-rw-r--r-- | fs/ext4/page-io.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 1a64e7a52b84..b24a2541a9ba 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c | |||
@@ -401,7 +401,8 @@ submit_and_retry: | |||
401 | int ext4_bio_write_page(struct ext4_io_submit *io, | 401 | int ext4_bio_write_page(struct ext4_io_submit *io, |
402 | struct page *page, | 402 | struct page *page, |
403 | int len, | 403 | int len, |
404 | struct writeback_control *wbc) | 404 | struct writeback_control *wbc, |
405 | bool keep_towrite) | ||
405 | { | 406 | { |
406 | struct inode *inode = page->mapping->host; | 407 | struct inode *inode = page->mapping->host; |
407 | unsigned block_start, blocksize; | 408 | unsigned block_start, blocksize; |
@@ -414,10 +415,24 @@ int ext4_bio_write_page(struct ext4_io_submit *io, | |||
414 | BUG_ON(!PageLocked(page)); | 415 | BUG_ON(!PageLocked(page)); |
415 | BUG_ON(PageWriteback(page)); | 416 | BUG_ON(PageWriteback(page)); |
416 | 417 | ||
417 | set_page_writeback(page); | 418 | if (keep_towrite) |
419 | set_page_writeback_keepwrite(page); | ||
420 | else | ||
421 | set_page_writeback(page); | ||
418 | ClearPageError(page); | 422 | ClearPageError(page); |
419 | 423 | ||
420 | /* | 424 | /* |
425 | * Comments copied from block_write_full_page: | ||
426 | * | ||
427 | * The page straddles i_size. It must be zeroed out on each and every | ||
428 | * writepage invocation because it may be mmapped. "A file is mapped | ||
429 | * in multiples of the page size. For a file that is not a multiple of | ||
430 | * the page size, the remaining memory is zeroed when mapped, and | ||
431 | * writes to that region are not written out to the file." | ||
432 | */ | ||
433 | if (len < PAGE_CACHE_SIZE) | ||
434 | zero_user_segment(page, len, PAGE_CACHE_SIZE); | ||
435 | /* | ||
421 | * In the first loop we prepare and mark buffers to submit. We have to | 436 | * In the first loop we prepare and mark buffers to submit. We have to |
422 | * mark all buffers in the page before submitting so that | 437 | * mark all buffers in the page before submitting so that |
423 | * end_page_writeback() cannot be called from ext4_bio_end_io() when IO | 438 | * end_page_writeback() cannot be called from ext4_bio_end_io() when IO |
@@ -428,19 +443,6 @@ int ext4_bio_write_page(struct ext4_io_submit *io, | |||
428 | do { | 443 | do { |
429 | block_start = bh_offset(bh); | 444 | block_start = bh_offset(bh); |
430 | if (block_start >= len) { | 445 | if (block_start >= len) { |
431 | /* | ||
432 | * Comments copied from block_write_full_page: | ||
433 | * | ||
434 | * The page straddles i_size. It must be zeroed out on | ||
435 | * each and every writepage invocation because it may | ||
436 | * be mmapped. "A file is mapped in multiples of the | ||
437 | * page size. For a file that is not a multiple of | ||
438 | * the page size, the remaining memory is zeroed when | ||
439 | * mapped, and writes to that region are not written | ||
440 | * out to the file." | ||
441 | */ | ||
442 | zero_user_segment(page, block_start, | ||
443 | block_start + blocksize); | ||
444 | clear_buffer_dirty(bh); | 446 | clear_buffer_dirty(bh); |
445 | set_buffer_uptodate(bh); | 447 | set_buffer_uptodate(bh); |
446 | continue; | 448 | continue; |