diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/trace/events/writeback.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 06d302ebcb72..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; |