aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/backing-dev-defs.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-03-23 01:36:54 +0100
committerJens Axboe <axboe@fb.com>2017-03-22 20:11:24 -0600
commitb7d680d7bf584bce6023343304b819009a7c3336 (patch)
tree84c8dddee7f9e910caeff43ef7724a1f22327f0f /include/linux/backing-dev-defs.h
parentblock: Fix bdi assignment to bdev inode when racing with disk delete (diff)
downloadlinux-dev-b7d680d7bf584bce6023343304b819009a7c3336.tar.xz
linux-dev-b7d680d7bf584bce6023343304b819009a7c3336.zip
bdi: Mark congested->bdi as internal
congested->bdi pointer is used only to be able to remove congested structure from bdi->cgwb_congested_tree on structure release. Moreover the pointer can become NULL when we unregister the bdi. Rename the field to __bdi and add a comment to make it more explicit this is internal stuff of memcg writeback code and people should not use the field as such use will be likely race prone. We do not bother with converting congested->bdi to a proper refcounted reference. It will be slightly ugly to special-case bdi->wb.congested to avoid effectively a cyclic reference of bdi to itself and the reference gets cleared from bdi_unregister() making it impossible to reference a freed bdi. Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/backing-dev-defs.h')
-rw-r--r--include/linux/backing-dev-defs.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index ad955817916d..8fb3dcdebc80 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -54,7 +54,9 @@ struct bdi_writeback_congested {
atomic_t refcnt; /* nr of attached wb's and blkg */
#ifdef CONFIG_CGROUP_WRITEBACK
- struct backing_dev_info *bdi; /* the associated bdi */
+ struct backing_dev_info *__bdi; /* the associated bdi, set to NULL
+ * on bdi unregistration. For memcg-wb
+ * internal use only! */
int blkcg_id; /* ID of the associated blkcg */
struct rb_node rb_node; /* on bdi->cgwb_congestion_tree */
#endif