mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
bdi: Add bdi->id
There currently is no way to universally identify and lookup a bdi without holding a reference and pointer to it. This patch adds an non-recycling bdi->id and implements bdi_get_by_id() which looks up bdis by their ids. This will be used by memcg foreign inode flushing. I left bdi_list alone for simplicity and because while rb_tree does support rcu assignment it doesn't seem to guarantee lossless walk when walk is racing aginst tree rebalance operations. Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
5b9cce4c7e
commit
34f8fe501f
3 changed files with 66 additions and 2 deletions
|
@ -24,6 +24,7 @@ static inline struct backing_dev_info *bdi_get(struct backing_dev_info *bdi)
|
|||
return bdi;
|
||||
}
|
||||
|
||||
struct backing_dev_info *bdi_get_by_id(u64 id);
|
||||
void bdi_put(struct backing_dev_info *bdi);
|
||||
|
||||
__printf(2, 3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue