From: Jan Kara Subject: [PATCH 12/17] bfs: Use own optional list for metadata bhs Date: Fri, 2 May 2014 15:20:03 +0200 Message-ID: <1399036808-24521-13-git-send-email-jack@suse.cz> References: <1399036808-24521-1-git-send-email-jack@suse.cz> Cc: Al Viro , Jan Kara To: linux-fsdevel@vger.kernel.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:53373 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752480AbaEBNUP (ORCPT ); Fri, 2 May 2014 09:20:15 -0400 In-Reply-To: <1399036808-24521-1-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Signed-off-by: Jan Kara --- fs/bfs/bfs.h | 2 ++ fs/bfs/inode.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/fs/bfs/bfs.h b/fs/bfs/bfs.h index f7f87e233dd9..f86ee8e43705 100644 --- a/fs/bfs/bfs.h +++ b/fs/bfs/bfs.h @@ -27,6 +27,8 @@ struct bfs_inode_info { unsigned long i_dsk_ino; /* inode number from the disk, can be 0 */ unsigned long i_sblock; unsigned long i_eblock; + struct inode_meta_bhs i_mbh; /* list of metadata buffers associated + with the inode */ struct inode vfs_inode; }; diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 8defc6b3f9a2..2b3283668bd7 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -30,6 +30,12 @@ MODULE_LICENSE("GPL"); #define dprintf(x...) #endif +static int bfs_inode_fields[IF_FIELDS_NR] = { + [IF_META_BHS] = (int)offsetof(struct bfs_inode_info, i_mbh) - + (int)offsetof(struct bfs_inode_info, vfs_inode), +}; + + void dump_imap(const char *prefix, struct super_block *s); struct inode *bfs_iget(struct super_block *sb, unsigned long ino) @@ -263,6 +269,7 @@ static void init_once(void *foo) { struct bfs_inode_info *bi = foo; + inode_mbhs_init_once(&bi->i_mbh); inode_init_once(&bi->vfs_inode); } @@ -333,6 +340,7 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent) return -ENOMEM; mutex_init(&info->bfs_lock); s->s_fs_info = info; + sb_init_inode_fields(sb, bfs_inode_fields); sb_set_blocksize(s, BFS_BSIZE); -- 1.8.1.4