From: David Howells <dhowells@redhat.com>
To: viro@ZenIV.linux.org.uk, smfrench@gmail.com, jlayton@redhat.com,
mcao@us.ibm.com, aneesh.kumar@linux.vnet.ibm.com
Cc: dhowells@redhat.com, linux-cifs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
samba-technical@lists.samba.org, sjayaraman@suse.de,
linux-ext4@vger.kernel.org
Subject: [PATCH 2/3] AFS: Use i_generation not i_version for the vnode uniquifier
Date: Tue, 29 Jun 2010 21:03:10 +0100 [thread overview]
Message-ID: <20100629200310.23196.32472.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20100629200259.23196.81509.stgit@warthog.procyon.org.uk>
Store the AFS vnode uniquifier in the i_generation field, not the i_version
field of the inode struct. i_version can then be given the AFS data version
number.
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/afs/dir.c | 8 ++++----
fs/afs/fsclient.c | 3 ++-
fs/afs/inode.c | 10 +++++-----
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index b42d5cc..afb9ff8 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -542,11 +542,11 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
dentry->d_op = &afs_fs_dentry_operations;
d_add(dentry, inode);
- _leave(" = 0 { vn=%u u=%u } -> { ino=%lu v=%llu }",
+ _leave(" = 0 { vn=%u u=%u } -> { ino=%lu v=%u }",
fid.vnode,
fid.unique,
dentry->d_inode->i_ino,
- (unsigned long long)dentry->d_inode->i_version);
+ dentry->d_inode->i_generation);
return NULL;
}
@@ -626,10 +626,10 @@ static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
* been deleted and replaced, and the original vnode ID has
* been reused */
if (fid.unique != vnode->fid.unique) {
- _debug("%s: file deleted (uq %u -> %u I:%llu)",
+ _debug("%s: file deleted (uq %u -> %u I:%u)",
dentry->d_name.name, fid.unique,
vnode->fid.unique,
- (unsigned long long)dentry->d_inode->i_version);
+ dentry->d_inode->i_generation);
spin_lock(&vnode->lock);
set_bit(AFS_VNODE_DELETED, &vnode->flags);
spin_unlock(&vnode->lock);
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index 4bd0218..346e328 100644
--- a/fs/afs/fsclient.c
+++ b/fs/afs/fsclient.c
@@ -89,7 +89,7 @@ static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
i_size_write(&vnode->vfs_inode, size);
vnode->vfs_inode.i_uid = status->owner;
vnode->vfs_inode.i_gid = status->group;
- vnode->vfs_inode.i_version = vnode->fid.unique;
+ vnode->vfs_inode.i_generation = vnode->fid.unique;
vnode->vfs_inode.i_nlink = status->nlink;
mode = vnode->vfs_inode.i_mode;
@@ -102,6 +102,7 @@ static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
vnode->vfs_inode.i_ctime.tv_sec = status->mtime_server;
vnode->vfs_inode.i_mtime = vnode->vfs_inode.i_ctime;
vnode->vfs_inode.i_atime = vnode->vfs_inode.i_ctime;
+ vnode->vfs_inode.i_version = data_version;
}
expected_version = status->data_version;
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index d00b312..ee3190a 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -73,7 +73,8 @@ static int afs_inode_map_status(struct afs_vnode *vnode, struct key *key)
inode->i_ctime.tv_nsec = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime;
inode->i_blocks = 0;
- inode->i_version = vnode->fid.unique;
+ inode->i_generation = vnode->fid.unique;
+ inode->i_version = vnode->status.data_version;
inode->i_mapping->a_ops = &afs_fs_aops;
/* check to see whether a symbolic link is really a mountpoint */
@@ -98,7 +99,7 @@ static int afs_iget5_test(struct inode *inode, void *opaque)
struct afs_iget_data *data = opaque;
return inode->i_ino == data->fid.vnode &&
- inode->i_version == data->fid.unique;
+ inode->i_generation == data->fid.unique;
}
/*
@@ -110,7 +111,7 @@ static int afs_iget5_set(struct inode *inode, void *opaque)
struct afs_vnode *vnode = AFS_FS_I(inode);
inode->i_ino = data->fid.vnode;
- inode->i_version = data->fid.unique;
+ inode->i_generation = data->fid.unique;
vnode->fid = data->fid;
vnode->volume = data->volume;
@@ -306,8 +307,7 @@ int afs_getattr(struct vfsmount *mnt, struct dentry *dentry,
inode = dentry->d_inode;
- _enter("{ ino=%lu v=%llu }", inode->i_ino,
- (unsigned long long)inode->i_version);
+ _enter("{ ino=%lu v=%u }", inode->i_ino, inode->i_generation);
generic_fillattr(inode, stat);
return 0;
next prev parent reply other threads:[~2010-06-29 20:03 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-29 20:02 [PATCH 0/3] Extended file stat functions David Howells
2010-06-29 20:03 ` [PATCH 1/3] Mark arguments to certain syscalls as being const David Howells
2010-06-29 20:03 ` David Howells [this message]
[not found] ` <20100629200259.23196.81509.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2010-06-29 20:03 ` [PATCH 3/3] Add a pair of system calls to make extended file stats available David Howells
[not found] ` <20100629200315.23196.68742.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2010-06-29 22:13 ` Ulrich Drepper
[not found] ` <AANLkTimSU_pCXW5zR8__Q3-fzgxwEUX8rPqLeZtPD_hX-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-29 22:33 ` Steve French
2010-06-30 8:20 ` Arnd Bergmann
2010-06-29 22:36 ` David Howells
[not found] ` <26026.1277851016-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-06-29 22:48 ` Joel Becker
2010-06-29 22:48 ` Sage Weil
[not found] ` <20100629224844.GF4150-0Ol/1UON5C7fiIqoQl7HmA@public.gmane.org>
2010-06-29 23:29 ` David Howells
[not found] ` <32322.1277854192-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-07-01 1:12 ` Joel Becker
2010-06-30 8:59 ` David Howells
2010-06-29 20:28 ` [PATCH 0/3] Extended file stat functions Trond Myklebust
2010-06-29 20:23 ` Steve French
[not found] ` <AANLkTimIh9ZAasPnN5xxGxbupwkct7UihHcMe26r-MD7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-29 20:41 ` David Howells
2010-06-29 20:50 ` David Howells
2010-06-29 21:07 ` Bernd Schubert
[not found] ` <201006292307.42440.bernd.schubert-97jfqw80gc6171pxa8y+qA@public.gmane.org>
2010-06-29 21:11 ` David Howells
[not found] ` <24517.1277845879-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-06-29 21:24 ` Bernd Schubert
2010-06-29 21:28 ` David Howells
2010-06-29 21:53 ` Bernd Schubert
2010-06-29 22:59 ` Maciej W. Rozycki
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=20100629200310.23196.32472.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=jlayton@redhat.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcao@us.ibm.com \
--cc=samba-technical@lists.samba.org \
--cc=sjayaraman@suse.de \
--cc=smfrench@gmail.com \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).