aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events/writeback.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/events/writeback.h')
-rw-r--r--include/trace/events/writeback.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 8588a8918023..5973410e8f8c 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -47,7 +47,10 @@ DECLARE_EVENT_CLASS(writeback_work_class,
47 __field(int, reason) 47 __field(int, reason)
48 ), 48 ),
49 TP_fast_assign( 49 TP_fast_assign(
50 strncpy(__entry->name, dev_name(bdi->dev), 32); 50 struct device *dev = bdi->dev;
51 if (!dev)
52 dev = default_backing_dev_info.dev;
53 strncpy(__entry->name, dev_name(dev), 32);
51 __entry->nr_pages = work->nr_pages; 54 __entry->nr_pages = work->nr_pages;
52 __entry->sb_dev = work->sb ? work->sb->s_dev : 0; 55 __entry->sb_dev = work->sb ? work->sb->s_dev : 0;
53 __entry->sync_mode = work->sync_mode; 56 __entry->sync_mode = work->sync_mode;
@@ -426,7 +429,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
426 429
427 TP_fast_assign( 430 TP_fast_assign(
428 strncpy(__entry->name, 431 strncpy(__entry->name,
429 dev_name(inode->i_mapping->backing_dev_info->dev), 32); 432 dev_name(inode_to_bdi(inode)->dev), 32);
430 __entry->ino = inode->i_ino; 433 __entry->ino = inode->i_ino;
431 __entry->state = inode->i_state; 434 __entry->state = inode->i_state;
432 __entry->dirtied_when = inode->dirtied_when; 435 __entry->dirtied_when = inode->dirtied_when;