]> git.baikalelectronics.ru Git - kernel.git/commit
erofs: convert workstn to XArray
authorGao Xiang <gaoxiang25@huawei.com>
Thu, 20 Feb 2020 02:46:42 +0000 (10:46 +0800)
committerGao Xiang <gaoxiang25@huawei.com>
Tue, 3 Mar 2020 15:27:25 +0000 (23:27 +0800)
commitebb4ad4d5d2654561b966fa1912b603ee34ffc03
treee39ebae96a3290a69216c187d4298c7da8bdc3a8
parent5ffd64ecc0987e6f01533e7cc8fa89b7b34f793f
erofs: convert workstn to XArray

XArray has friendly APIs and it will replace the old radix
tree in the near future.

This convert makes use of __xa_cmpxchg when inserting on
a just inserted item by other thread. In detail, instead
of totally looking up again as what we did for the old
radix tree, it will try to legitimize the current in-tree
item in the XArray therefore more effective.

In addition, naming is rather a challenge for non-English
speaker like me. The basic idea of workstn is to provide
a runtime sparse array with items arranged in the physical
block number order. Such items (was called workgroup) can be
used to record compress clusters or for later new features.

However, both workgroup and workstn seem not good names from
whatever point of view, so I'd like to rename them as pslot
and managed_pslots to stand for physical slots. This patch
handles the second as a part of the radix tree convert.

Cc: Matthew Wilcox <willy@infradead.org>
Link: https://lore.kernel.org/r/20200220024642.91529-1-gaoxiang25@huawei.com
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
fs/erofs/internal.h
fs/erofs/super.c
fs/erofs/utils.c
fs/erofs/zdata.c