From: Kalpak Shah <kalpak@clusterfs.com>
To: linux-ext4 <linux-ext4@vger.kernel.org>
Cc: Mingming Cao <cmm@us.ibm.com>,
Andreas Dilger <adilger@clusterfs.com>,
Jean noel Cordenner <jean-noel.cordenner@bull.net>
Subject: [PATCH 5/6] VFS updates to i_version
Date: Thu, 14 Jun 2007 21:29:24 +0530 [thread overview]
Message-ID: <1181836764.15456.1.camel@garfield> (raw)
In-Reply-To: <1181835073.7779.9.camel@garfield>
[-- Attachment #1: Type: text/plain, Size: 323 bytes --]
The VFS-level updates of the inode version. These may not be necessary
since the i_version is being updated in ext4_mark_iloc_dirty().
Signed-off-by: Jean Noel Cordenner <jean-noel.cordenner@bull.net>
---
binfmt_misc.c | 1 +
libfs.c | 9 +++++++++
pipe.c | 1 +
3 files changed, 11 insertions(+)
[-- Attachment #2: i_version_update_vfs.patch --]
[-- Type: text/x-patch, Size: 3790 bytes --]
The patch modifies the i_version field of the inode on the VFS layer.
The i_version field become a 64bit counter that is set on inode creation and
that is incremented every time the inode data is modified (similarly to the
"ctime" time-stamp).
The aim is to fulfill a NFSv4 requirement for rfc3530:
"5.5. Mandatory Attributes - Definitions
Name # DataType Access Description
___________________________________________________________________
change 3 uint64 READ A value created by the
server that the client can use to determine if file
data, directory contents or attributes of the object
have been modified. The servermay return the object's
time_metadata attribute for this attribute's value but
only if the filesystem object can not be updated more
frequently than the resolution of time_metadata."
Signed-off-by: Jean Noel Cordenner <jean-noel.cordenner@bull.net>
Index: linux-2.6.22-rc4/fs/binfmt_misc.c
===================================================================
--- linux-2.6.22-rc4.orig/fs/binfmt_misc.c 2007-06-04 17:57:25.000000000 -0700
+++ linux-2.6.22-rc4/fs/binfmt_misc.c 2007-06-13 17:24:57.000000000 -0700
@@ -508,6 +508,7 @@ static struct inode *bm_get_inode(struct
inode->i_blocks = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime =
current_fs_time(inode->i_sb);
+ inode->i_version = 1;
}
return inode;
}
Index: linux-2.6.22-rc4/fs/libfs.c
===================================================================
--- linux-2.6.22-rc4.orig/fs/libfs.c 2007-06-04 17:57:25.000000000 -0700
+++ linux-2.6.22-rc4/fs/libfs.c 2007-06-13 17:24:57.000000000 -0700
@@ -232,6 +232,7 @@ int get_sb_pseudo(struct file_system_typ
root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR;
root->i_uid = root->i_gid = 0;
root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME;
+ root->i_version = 1;
dentry = d_alloc(NULL, &d_name);
if (!dentry) {
iput(root);
@@ -255,6 +256,8 @@ int simple_link(struct dentry *old_dentr
struct inode *inode = old_dentry->d_inode;
inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
+ inode->i_version++;
+ dir->i_version++;
inc_nlink(inode);
atomic_inc(&inode->i_count);
dget(dentry);
@@ -287,6 +290,8 @@ int simple_unlink(struct inode *dir, str
struct inode *inode = dentry->d_inode;
inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
+ inode->i_version++;
+ dir->i_version++;
drop_nlink(inode);
dput(dentry);
return 0;
@@ -323,6 +328,8 @@ int simple_rename(struct inode *old_dir,
old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime =
new_dir->i_mtime = inode->i_ctime = CURRENT_TIME;
+ old_dir->i_version++;
+ new_dir->i_version++;
return 0;
}
@@ -399,6 +406,7 @@ int simple_fill_super(struct super_block
inode->i_uid = inode->i_gid = 0;
inode->i_blocks = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ inode->i_version = 1;
inode->i_op = &simple_dir_inode_operations;
inode->i_fop = &simple_dir_operations;
inode->i_nlink = 2;
@@ -427,6 +435,7 @@ int simple_fill_super(struct super_block
inode->i_uid = inode->i_gid = 0;
inode->i_blocks = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ inode->i_version = 1;
inode->i_fop = files->ops;
inode->i_ino = i;
d_add(dentry, inode);
Index: linux-2.6.22-rc4/fs/pipe.c
===================================================================
--- linux-2.6.22-rc4.orig/fs/pipe.c 2007-06-04 17:57:25.000000000 -0700
+++ linux-2.6.22-rc4/fs/pipe.c 2007-06-13 17:24:57.000000000 -0700
@@ -882,6 +882,7 @@ static struct inode * get_pipe_inode(voi
inode->i_uid = current->fsuid;
inode->i_gid = current->fsgid;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ inode->i_version = 1;
return inode;
next prev parent reply other threads:[~2007-06-14 15:59 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 ` [PATCH 3/6] Changes for 64-bit i_version Kalpak Shah
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 ` Kalpak Shah [this message]
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=1181836764.15456.1.camel@garfield \
--to=kalpak@clusterfs.com \
--cc=adilger@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