From 2b47c3611de05c585e2d81204f6c7e3e255a3461 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 16 Oct 2007 23:27:21 -0700 Subject: Fix f_version type: should be u64 instead of unsigned long Fix f_version type: should be u64 instead of long There is a type inconsistency between struct inode i_version and struct file f_version. fs.h: struct inode u64 i_version; and struct file unsigned long f_version; Users do: fs/ext3/dir.c: if (filp->f_version != inode->i_version) { So why isn't f_version a u64 ? It becomes a problem if versions gets higher than 2^32 and we are on an architecture where longs are 32 bits. This patch changes the f_version type to u64, and updates the users accordingly. It applies to 2.6.23-rc2-mm2. Signed-off-by: Mathieu Desnoyers Cc: Martin Bligh Cc: "Randy.Dunlap" Cc: Al Viro Cc: Cc: Mark Fasheh Cc: Christoph Hellwig Cc: "J. Bruce Fields" Cc: Trond Myklebust Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/ocfs2/dir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fs/ocfs2') diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 7453b70c1a1..6a2f143e269 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -586,7 +586,7 @@ bail: } static int ocfs2_dir_foreach_blk_id(struct inode *inode, - unsigned long *f_version, + u64 *f_version, loff_t *f_pos, void *priv, filldir_t filldir, int *filldir_err) { @@ -648,7 +648,7 @@ revalidate: * not the directory has been modified * during the copy operation. */ - unsigned long version = *f_version; + u64 version = *f_version; unsigned char d_type = DT_UNKNOWN; if (de->file_type < OCFS2_FT_MAX) @@ -677,7 +677,7 @@ out: } static int ocfs2_dir_foreach_blk_el(struct inode *inode, - unsigned long *f_version, + u64 *f_version, loff_t *f_pos, void *priv, filldir_t filldir, int *filldir_err) { @@ -798,7 +798,7 @@ out: return stored; } -static int ocfs2_dir_foreach_blk(struct inode *inode, unsigned long *f_version, +static int ocfs2_dir_foreach_blk(struct inode *inode, u64 *f_version, loff_t *f_pos, void *priv, filldir_t filldir, int *filldir_err) { @@ -818,7 +818,7 @@ int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv, filldir_t filldir) { int ret = 0, filldir_err = 0; - unsigned long version = inode->i_version; + u64 version = inode->i_version; while (*f_pos < i_size_read(inode)) { ret = ocfs2_dir_foreach_blk(inode, &version, f_pos, priv, -- cgit v1.2.3-18-g5258