erofs: unify anonymous inodes for blob
authorJingbo Xu <jefflexu@linux.alibaba.com>
Thu, 9 Feb 2023 06:39:13 +0000 (14:39 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 15 Feb 2023 00:11:28 +0000 (08:11 +0800)
commit61fef98945d0b2fea522ef958f57a783e2a072a9
tree9cdbea2b35225a4a0ee1a91f52707f3e8c56de20
parent7032809a44d752b9e2275833787e0aa88a7540af
erofs: unify anonymous inodes for blob

Currently there're two anonymous inodes (inode and anon_inode in struct
erofs_fscache) for each blob.  The former was introduced as the
address_space of page cache for bootstrap.

The latter was initially introduced as both the address_space of page
cache and also a sentinel in the shared domain.  Since now the management
of cookies in share domain has been decoupled with the anonymous inode,
there's no need to maintain an extra anonymous inode.  Let's unify these
two anonymous inodes.

Besides, in non-share-domain mode only bootstrap will allocate anonymous
inode.  To simplify the implementation, always allocate anonymous inode
for both bootstrap and data blobs.  Similarly release anonymous inodes
for data blobs when .put_super() is called, or we'll get "VFS: Busy
inodes after unmount." warning.

Also remove the redundant set_nlink() when initializing the anonymous
inode, since i_nlink has already been initialized to 1 when the inode
gets allocated.

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-5-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/fscache.c
fs/erofs/internal.h
fs/erofs/super.c