bdi: Mark congested->bdi as internal
authorJan Kara <jack@suse.cz>
Thu, 23 Mar 2017 00:36:54 +0000 (01:36 +0100)
committerJens Axboe <axboe@fb.com>
Thu, 23 Mar 2017 02:11:24 +0000 (20:11 -0600)
commitb7d680d7bf584bce6023343304b819009a7c3336
tree84c8dddee7f9e910caeff43ef7724a1f22327f0f
parent03e262798884b0a5f948b17433afd80606cb3497
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>
include/linux/backing-dev-defs.h
mm/backing-dev.c