• Jingbo Xu's avatar
    erofs: unify anonymous inodes for blob · 61fef989
    Jingbo Xu authored
    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: default avatarJingbo Xu <jefflexu@linux.alibaba.com>
    Reviewed-by: default avatarJia Zhu <zhujia.zj@bytedance.com>
    Link: https://lore.kernel.org/r/20230209063913.46341-5-jefflexu@linux.alibaba.comSigned-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
    61fef989
super.c 26.8 KB