erofs: maintain cookies of share domain in self-contained list
authorJingbo Xu <jefflexu@linux.alibaba.com>
Thu, 9 Feb 2023 06:39:11 +0000 (14:39 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 15 Feb 2023 00:11:27 +0000 (08:11 +0800)
commit2dfb8c3b122fad4504a92c34ba68f2fe4444b3f6
treee0c8fc9a81db921fcdbaa2445546ae786c92ccc7
parentbdfa90142eb1f1272d2efc00dda6c0f35814e36a
erofs: maintain cookies of share domain in self-contained list

We'd better not touch sb->s_inodes list and inode->i_count directly.
Let's maintain cookies of share domain in a self-contained list in erofs.

Besides, relinquish cookie with the mutex held.  Otherwise if a cookie
is registered when the old cookie with the same name in the same domain
has been removed from the list but not relinquished yet, fscache may
complain "Duplicate cookie detected".

Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Jia Zhu <zhujia.zj@bytedance.com>
Link: https://lore.kernel.org/r/20230209063913.46341-3-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/fscache.c
fs/erofs/internal.h