diff options
author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2007-10-17 02:27:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:53 -0400 |
commit | 2b47c3611de05c585e2d81204f6c7e3e255a3461 (patch) | |
tree | 24a14614fb9bf507b4b6ad3fa6a7cfa5a92318fb /fs/proc | |
parent | 41d10da3717409de33d5441f2f6d8f072ab3fbb6 (diff) |
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 <mathieu.desnoyers@polymtl.ca>
Cc: Martin Bligh <mbligh@google.com>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Cc: Al Viro <viro@ftp.linux.org.uk>
Cc: <linux-ext4@vger.kernel.org>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 78fdfea1a7f8..ea115d4c9f59 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2586,7 +2586,7 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi | |||
2586 | /* f_version caches the tgid value that the last readdir call couldn't | 2586 | /* f_version caches the tgid value that the last readdir call couldn't |
2587 | * return. lseek aka telldir automagically resets f_version to 0. | 2587 | * return. lseek aka telldir automagically resets f_version to 0. |
2588 | */ | 2588 | */ |
2589 | tid = filp->f_version; | 2589 | tid = (int)filp->f_version; |
2590 | filp->f_version = 0; | 2590 | filp->f_version = 0; |
2591 | for (task = first_tid(leader, tid, pos - 2); | 2591 | for (task = first_tid(leader, tid, pos - 2); |
2592 | task; | 2592 | task; |
@@ -2595,7 +2595,7 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi | |||
2595 | if (proc_task_fill_cache(filp, dirent, filldir, task, tid) < 0) { | 2595 | if (proc_task_fill_cache(filp, dirent, filldir, task, tid) < 0) { |
2596 | /* returning this tgid failed, save it as the first | 2596 | /* returning this tgid failed, save it as the first |
2597 | * pid for the next readir call */ | 2597 | * pid for the next readir call */ |
2598 | filp->f_version = tid; | 2598 | filp->f_version = (u64)tid; |
2599 | put_task_struct(task); | 2599 | put_task_struct(task); |
2600 | break; | 2600 | break; |
2601 | } | 2601 | } |