History

block: discard bdi_unregister() in favour of bdi_destroy()

bdi_unregister() now contains very little functionality. It contains a "WARN_ON" if bdi->dev is NULL. This warning is of no real consequence as bdi->dev isn't needed by anything else in the function, and it triggers if blk_cleanup_queue() -> bdi_destroy() is called before bdi_unregister, which happens since Commit: 6cd18e711dd8 ("block: destroy bdi before blockdev is unregistered.") So this isn't wanted. It also calls bdi_set_min_ratio(). This needs to be called after writes through the bdi have all been flushed, and before the bdi is destroyed. Calling it early is better than calling it late as it frees up a global resource. Calling it immediately after bdi_wb_shutdown() in bdi_destroy() perfectly fits these requirements. So bdi_unregister() can be discarded with the important content moved to bdi_destroy(), as can the writeback_bdi_unregister event which is already not used.

NeilBrown committed 11 years ago

Commit aad653a1 parent a8b253b4 files · +1 −20Browse files

Showing the changes to include (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/backing-dev.h +0 −1
  2. include/trace/events/writeback.h +0 −1
include/linux/backing-dev.h+0−1
@@ -116,7 +116,6 @@ __printf(3, 4) · 115 unmodified lines
116int bdi_register(struct backing_dev_info *bdi, struct device *parent,116int bdi_register(struct backing_dev_info *bdi, struct device *parent,
117 const char *fmt, ...);117 const char *fmt, ...);
118int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);118int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
119void bdi_unregister(struct backing_dev_info *bdi);
120int __must_check bdi_setup_and_register(struct backing_dev_info *, char *);119int __must_check bdi_setup_and_register(struct backing_dev_info *, char *);
121void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages,120void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages,
122 enum wb_reason reason);121 enum wb_reason reason);
include/trace/events/writeback.h+0−1
@@ -250,7 +250,6 @@ DEFINE_EVENT(writeback_class, name, \ · 249 unmodified lines
250DEFINE_WRITEBACK_EVENT(writeback_nowork);250DEFINE_WRITEBACK_EVENT(writeback_nowork);
251DEFINE_WRITEBACK_EVENT(writeback_wake_background);251DEFINE_WRITEBACK_EVENT(writeback_wake_background);
252DEFINE_WRITEBACK_EVENT(writeback_bdi_register);252DEFINE_WRITEBACK_EVENT(writeback_bdi_register);
253DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister);
254 253
255DECLARE_EVENT_CLASS(wbc_class,254DECLARE_EVENT_CLASS(wbc_class,
256 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi),255 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t