[PATCH 16/17] ext4: Use own optional list for metadata bhs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jan Kara <jack@xxxxxxx>
---
 fs/ext4/ext4.h  | 2 ++
 fs/ext4/inode.c | 2 +-
 fs/ext4/super.c | 7 +++++++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index d3a534fdc5ff..9382bf0d5345 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -872,6 +872,8 @@ struct ext4_inode_info {
 	struct rw_semaphore i_data_sem;
 	struct inode vfs_inode;
 	struct jbd2_inode *jinode;
+	struct inode_meta_bhs i_mbh;	/* list of metadata buffers associated
+					   with the inode */
 
 	/*
 	 * File creation time. Its function is same as that of
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 6e39895a91b8..78785617736c 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1040,7 +1040,7 @@ static int write_end_fn(handle_t *handle, struct buffer_head *bh)
  * We need to pick up the new inode size which generic_commit_write gave us
  * `file' can be NULL - eg, when called from page_symlink().
  *
- * ext4 never places buffers on inode->i_mapping->private_list.  metadata
+ * ext4 never places buffers on inode->i_mbh.list when journalling.  Metadata
  * buffers are managed internally.
  */
 static int ext4_write_end(struct file *file,
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 710fed2377d4..d50348a8280d 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -115,6 +115,11 @@ MODULE_ALIAS("ext3");
 #define IS_EXT3_SB(sb) (0)
 #endif
 
+static int ext4_inode_fields[IF_FIELD_NR] = {
+	[IF_META_BHS] = (int)offsetof(struct ext4_inode_info, i_mbh) -
+			(int)offsetof(struct ext4_inode_info, vfs_inode),
+};
+
 static int ext4_verify_csum_type(struct super_block *sb,
 				 struct ext4_super_block *es)
 {
@@ -937,6 +942,7 @@ static void init_once(void *foo)
 	INIT_LIST_HEAD(&ei->i_orphan);
 	init_rwsem(&ei->xattr_sem);
 	init_rwsem(&ei->i_data_sem);
+	inode_mbhs_init_once(&ei->i_mbh);
 	inode_init_once(&ei->vfs_inode);
 }
 
@@ -3394,6 +3400,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 		goto out_free_orig;
 	}
 	sb->s_fs_info = sbi;
+	sb_init_inode_fields(sb, ext4_inode_fields);
 	sbi->s_sb = sb;
 	sbi->s_inode_readahead_blks = EXT4_DEF_INODE_READAHEAD_BLKS;
 	sbi->s_sb_block = sb_block;
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux