diff options
Diffstat (limited to 'include/trace/events/writeback.h')
-rw-r--r-- | include/trace/events/writeback.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 8588a8918023..7b81887b023f 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
@@ -5,7 +5,6 @@ | |||
5 | #define _TRACE_WRITEBACK_H | 5 | #define _TRACE_WRITEBACK_H |
6 | 6 | ||
7 | #include <linux/backing-dev.h> | 7 | #include <linux/backing-dev.h> |
8 | #include <linux/device.h> | ||
9 | #include <linux/writeback.h> | 8 | #include <linux/writeback.h> |
10 | 9 | ||
11 | #define show_inode_state(state) \ | 10 | #define show_inode_state(state) \ |
@@ -47,7 +46,10 @@ DECLARE_EVENT_CLASS(writeback_work_class, | |||
47 | __field(int, reason) | 46 | __field(int, reason) |
48 | ), | 47 | ), |
49 | TP_fast_assign( | 48 | TP_fast_assign( |
50 | strncpy(__entry->name, dev_name(bdi->dev), 32); | 49 | struct device *dev = bdi->dev; |
50 | if (!dev) | ||
51 | dev = default_backing_dev_info.dev; | ||
52 | strncpy(__entry->name, dev_name(dev), 32); | ||
51 | __entry->nr_pages = work->nr_pages; | 53 | __entry->nr_pages = work->nr_pages; |
52 | __entry->sb_dev = work->sb ? work->sb->s_dev : 0; | 54 | __entry->sb_dev = work->sb ? work->sb->s_dev : 0; |
53 | __entry->sync_mode = work->sync_mode; | 55 | __entry->sync_mode = work->sync_mode; |
@@ -426,7 +428,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, | |||
426 | 428 | ||
427 | TP_fast_assign( | 429 | TP_fast_assign( |
428 | strncpy(__entry->name, | 430 | strncpy(__entry->name, |
429 | dev_name(inode->i_mapping->backing_dev_info->dev), 32); | 431 | dev_name(inode_to_bdi(inode)->dev), 32); |
430 | __entry->ino = inode->i_ino; | 432 | __entry->ino = inode->i_ino; |
431 | __entry->state = inode->i_state; | 433 | __entry->state = inode->i_state; |
432 | __entry->dirtied_when = inode->dirtied_when; | 434 | __entry->dirtied_when = inode->dirtied_when; |