public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Kalpak Shah <kalpak@clusterfs.com>
To: linux-ext4 <linux-ext4@vger.kernel.org>
Cc: Mingming Cao <cmm@us.ibm.com>,
	Jean noel Cordenner <jean-noel.cordenner@bull.net>
Subject: [PATCH 3/6] Changes for 64-bit i_version
Date: Thu, 14 Jun 2007 21:26:17 +0530	[thread overview]
Message-ID: <1181836577.7779.45.camel@garfield> (raw)
In-Reply-To: <1181835073.7779.9.camel@garfield>

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

ext4_i_version_hi_2.patch was still using ei->i_fs_version instead of
inode->i_version. I have corrected it.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
---
fs/ext4/inode.c         |   15 ++++++++++++++-
 include/linux/ext4_fs.h |    4 +++-
 2 files changed, 17 insertions(+), 2 deletions(-)



[-- Attachment #2: ext4_i_version_hi_2.patch --]
[-- Type: text/x-patch, Size: 2320 bytes --]

This patch adds 64-bit inode version support to ext4. The lower 32 bits
are stored in the osd1.linux1.l_i_version field while the high 32 bits
are stored in the i_version_hi field newly created in the ext4_inode.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>

Index: linux-2.6.21/fs/ext4/inode.c
===================================================================
--- linux-2.6.21.orig/fs/ext4/inode.c
+++ linux-2.6.21/fs/ext4/inode.c
@@ -2709,6 +2709,13 @@ void ext4_read_inode(struct inode * inod
 	EXT4_INODE_GET_XTIME(i_atime, inode, raw_inode);
 	EXT4_EINODE_GET_XTIME(i_crtime, ei, raw_inode);
 
+	inode->i_version = le32_to_cpu(raw_inode->i_disk_version);
+	if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE) {
+		if (EXT4_FITS_IN_INODE(raw_inode, ei, i_version_hi))
+			inode->i_version |=
+			(__u64)(le32_to_cpu(raw_inode->i_version_hi)) << 32;
+	}
+
 	if (S_ISREG(inode->i_mode)) {
 		inode->i_op = &ext4_file_inode_operations;
 		inode->i_fop = &ext4_file_operations;
@@ -2852,8 +2859,14 @@ static int ext4_do_update_inode(handle_t
 	} else for (block = 0; block < EXT4_N_BLOCKS; block++)
 		raw_inode->i_block[block] = ei->i_data[block];
 
-	if (ei->i_extra_isize)
+	raw_inode->i_disk_version = cpu_to_le32(inode->i_version);
+	if (ei->i_extra_isize) {
+		if (EXT4_FITS_IN_INODE(raw_inode, ei, i_version_hi)) {
+			raw_inode->i_version_hi =
+				cpu_to_le32(inode->i_version >> 32);
+		}
 		raw_inode->i_extra_isize = cpu_to_le16(ei->i_extra_isize);
+	}
 
 	BUFFER_TRACE(bh, "call ext4_journal_dirty_metadata");
 	rc = ext4_journal_dirty_metadata(handle, bh);
Index: linux-2.6.21/include/linux/ext4_fs.h
===================================================================
--- linux-2.6.21.orig/include/linux/ext4_fs.h
+++ linux-2.6.21/include/linux/ext4_fs.h
@@ -297,7 +297,7 @@ struct ext4_inode {
 	__le32	i_flags;	/* File flags */
 	union {
 		struct {
-			__u32  l_i_reserved1;
+			__u32  l_i_version;
 		} linux1;
 		struct {
 			__u32  h_i_translator;
@@ -406,6 +406,8 @@ do {									       \
 				       raw_inode->xtime ## _extra);	       \
 } while (0)
 
+#define i_disk_version osd1.linux1.l_i_version
+
 #if defined(__KERNEL__) || defined(__linux__)
 #define i_reserved1	osd1.linux1.l_i_reserved1
 #define i_frag		osd2.linux2.l_i_frag

  parent reply	other threads:[~2007-06-14 15:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1181835073.7779.9.camel@garfield>
2007-06-14 15:56 ` [PATCH 1/6] Separated 64-bit i_version patch Kalpak Shah
2007-06-14 20:58   ` Mingming Cao
2007-06-14 21:41     ` Andreas Dilger
2007-06-14 15:56 ` [PATCH 2/6] add i_version_hi to ext4_inode Kalpak Shah
2007-06-14 15:56 ` Kalpak Shah [this message]
2007-06-14 15:56 ` [PATCH 4/6] add noversion mount option Kalpak Shah
2007-06-14 20:50   ` Mingming Cao
2007-06-14 21:42     ` Andreas Dilger
2007-06-14 21:52     ` Kalpak Shah
2007-06-14 22:28       ` Mingming Cao
2007-06-14 15:59 ` Kalpak Shah
2007-06-14 15:59 ` [PATCH 5/6] VFS updates to i_version Kalpak Shah
2007-06-14 15:59 ` [PATCH 6/6] Updated series file Kalpak Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1181836577.7779.45.camel@garfield \
    --to=kalpak@clusterfs.com \
    --cc=cmm@us.ibm.com \
    --cc=jean-noel.cordenner@bull.net \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox