diff options
author | Tejun Heo <tj@kernel.org> | 2015-05-28 14:50:52 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-06-02 08:40:20 -0600 |
commit | 87e1d789bf55b12fa7c1cdce024499aee3bc0af0 (patch) | |
tree | 39c8f22f5066b8fd0a9326719d6ca4597905a34f /lib/hweight.c | |
parent | 2a81490811d0296d390c571bb64eaa93e5ed7def (diff) | |
download | op-kernel-dev-87e1d789bf55b12fa7c1cdce024499aee3bc0af0.zip op-kernel-dev-87e1d789bf55b12fa7c1cdce024499aee3bc0af0.tar.gz |
writeback: implement [locked_]inode_to_wb_and_lock_list()
cgroup writeback currently assumes that inode to wb association
doesn't change; however, with the planned foreign inode wb switching
mechanism, the association will change dynamically.
When an inode needs to be put on one of the IO lists of its wb, the
current code simply calls inode_to_wb() and locks the returned wb;
however, with the planned wb switching, the association may change
before locking the wb and may even get released.
This patch implements [locked_]inode_to_wb_and_lock_list() which pins
the associated wb while holding i_lock, releases it, acquires
wb->list_lock and verifies that the association hasn't changed
inbetween. As the association will be protected by both locks among
other things, this guarantees that the wb is the inode's associated wb
until the list_lock is released.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jan Kara <jack@suse.cz>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Greg Thelen <gthelen@google.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'lib/hweight.c')
0 files changed, 0 insertions, 0 deletions