ext4: pair trace_ext4_writepages & trace_ext4_writepages_result

Pair the two trace events to make troubeshooting writepages
easier, and it should be more convinient to write a simple script
to parse the traces.

Cc: linux-ext4@vger.kernel.org
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
Ming Lei 2013-10-30 07:27:16 -04:00 committed by Theodore Ts'o
parent efbed4dc58
commit bbf023c74d
1 changed files with 6 additions and 5 deletions

View File

@ -2423,16 +2423,15 @@ static int ext4_writepages(struct address_space *mapping,
* because that could violate lock ordering on umount * because that could violate lock ordering on umount
*/ */
if (!mapping->nrpages || !mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) if (!mapping->nrpages || !mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
return 0; goto out_writepages;
if (ext4_should_journal_data(inode)) { if (ext4_should_journal_data(inode)) {
struct blk_plug plug; struct blk_plug plug;
int ret;
blk_start_plug(&plug); blk_start_plug(&plug);
ret = write_cache_pages(mapping, wbc, __writepage, mapping); ret = write_cache_pages(mapping, wbc, __writepage, mapping);
blk_finish_plug(&plug); blk_finish_plug(&plug);
return ret; goto out_writepages;
} }
/* /*
@ -2445,8 +2444,10 @@ static int ext4_writepages(struct address_space *mapping,
* *never* be called, so if that ever happens, we would want * *never* be called, so if that ever happens, we would want
* the stack trace. * the stack trace.
*/ */
if (unlikely(sbi->s_mount_flags & EXT4_MF_FS_ABORTED)) if (unlikely(sbi->s_mount_flags & EXT4_MF_FS_ABORTED)) {
return -EROFS; ret = -EROFS;
goto out_writepages;
}
if (ext4_should_dioread_nolock(inode)) { if (ext4_should_dioread_nolock(inode)) {
/* /*