Track metadata bhs for an inode in fs-private part of the inode. Signed-off-by: Jan Kara --- fs/affs/affs.h | 2 ++ fs/affs/dir.c | 1 + fs/affs/file.c | 1 + fs/affs/super.c | 6 ++++++ fs/affs/symlink.c | 1 + 5 files changed, 11 insertions(+) diff --git a/fs/affs/affs.h b/fs/affs/affs.h index ac4e9a02910b..a1eb400e1018 100644 --- a/fs/affs/affs.h +++ b/fs/affs/affs.h @@ -44,6 +44,7 @@ struct affs_inode_info { struct mutex i_link_lock; /* Protects internal inode access. */ struct mutex i_ext_lock; /* Protects internal inode access. */ #define i_hash_lock i_ext_lock + struct mapping_metadata_bhs i_metadata_bhs; u32 i_blkcnt; /* block count */ u32 i_extcnt; /* extended block count */ u32 *i_lc; /* linear cache of extended blocks */ @@ -151,6 +152,7 @@ extern bool affs_nofilenametruncate(const struct dentry *dentry); extern int affs_check_name(const unsigned char *name, int len, bool notruncate); extern int affs_copy_name(unsigned char *bstr, struct dentry *dentry); +struct mapping_metadata_bhs *affs_get_metadata_bhs(struct inode *inode); /* bitmap. c */ diff --git a/fs/affs/dir.c b/fs/affs/dir.c index 5c8d83387a39..6b0314c84972 100644 --- a/fs/affs/dir.c +++ b/fs/affs/dir.c @@ -72,6 +72,7 @@ const struct inode_operations affs_dir_inode_operations = { .rmdir = affs_rmdir, .rename = affs_rename2, .setattr = affs_notify_change, + .get_metadata_bhs = affs_get_metadata_bhs, }; static int diff --git a/fs/affs/file.c b/fs/affs/file.c index 6c9258359ddb..4dbd9351eea0 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -1014,4 +1014,5 @@ const struct file_operations affs_file_operations = { const struct inode_operations affs_file_inode_operations = { .setattr = affs_notify_change, + .get_metadata_bhs = affs_get_metadata_bhs, }; diff --git a/fs/affs/super.c b/fs/affs/super.c index 8451647f3fea..dff272df0636 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -108,6 +108,7 @@ static struct inode *affs_alloc_inode(struct super_block *sb) i->i_lc = NULL; i->i_ext_bh = NULL; i->i_pa_cnt = 0; + mmb_init(&i->i_metadata_bhs); return &i->vfs_inode; } @@ -147,6 +148,11 @@ static void destroy_inodecache(void) kmem_cache_destroy(affs_inode_cachep); } +struct mapping_metadata_bhs *affs_get_metadata_bhs(struct inode *inode) +{ + return &AFFS_I(inode)->i_metadata_bhs; +} + static const struct super_operations affs_sops = { .alloc_inode = affs_alloc_inode, .free_inode = affs_free_inode, diff --git a/fs/affs/symlink.c b/fs/affs/symlink.c index 094aec8d17b8..68fa091bd377 100644 --- a/fs/affs/symlink.c +++ b/fs/affs/symlink.c @@ -72,4 +72,5 @@ const struct address_space_operations affs_symlink_aops = { const struct inode_operations affs_symlink_inode_operations = { .get_link = page_get_link, .setattr = affs_notify_change, + .get_metadata_bhs = affs_get_metadata_bhs, }; -- 2.51.0