diff options
author | Ritesh Harjani <riteshh@linux.ibm.com> | 2020-05-20 09:40:35 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-06-04 06:16:53 +0300 |
commit | 8ef123fe02ca0923b01b57bdf639800a23a2faa8 (patch) | |
tree | aecee027b64ccdff52a782397ff6e8cea495f808 /.clang-format | |
parent | 07b5b8e1ac4004b7db1065a301df65cd434c31c9 (diff) | |
download | linux-8ef123fe02ca0923b01b57bdf639800a23a2faa8.tar.xz |
ext4: mballoc: refactor ext4_mb_good_group()
ext4_mb_good_group() definition was changed some time back
and now it even initializes the buddy cache (via ext4_mb_init_group()),
if in case the EXT4_MB_GRP_NEED_INIT() is true for a group.
Note that ext4_mb_init_group() could sleep and so should not be called
under a spinlock held.
This is fine as of now because ext4_mb_good_group() is called before
loading the buddy bitmap without ext4_lock_group() held
and again called after loading the bitmap, only this time with
ext4_lock_group() held.
But still this whole thing is confusing.
So this patch refactors out ext4_mb_good_group_nolock() which should be
called when without holding ext4_lock_group().
Also in further patches we hold the spinlock (ext4_lock_group()) while
doing any calculations which involves grp->bb_free or grp->bb_fragments.
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/d9f7d031a5fbe1c943fae6bf1ff5cdf0604ae722.1589955723.git.riteshh@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to '.clang-format')
0 files changed, 0 insertions, 0 deletions