[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070220.j9k.46008500@egw.corp.redhat.com>
Date: Tue, 20 Feb 2007 17:01:51 -0500
From: "Chris Snook" <csnook@...hat.com>
To: "Chris Snook" <csnook@...hat.com>, linux-kernel@...r.kernel.org
Cc: akpm@...l.org, dhowells@...hat.com, jeffpc@...efsipek.net,
csnook@...hat.com
Subject: [PATCH 1/2] use symbolic constants in generic lseek code
From: Chris Snook <csnook@...hat.com>
Convert magic numbers to SEEK_* values from fs.h
Signed-off-by: Chris Snook <csnook@...hat.com>
--
--- a/fs/read_write.c 2007-02-20 14:49:45.000000000 -0500
+++ b/fs/read_write.c 2007-02-20 16:48:39.000000000 -0500
@@ -37,10 +37,10 @@ loff_t generic_file_llseek(struct file *
mutex_lock(&inode->i_mutex);
switch (origin) {
- case 2:
+ case SEEK_END:
offset += inode->i_size;
break;
- case 1:
+ case SEEK_CUR:
offset += file->f_pos;
}
retval = -EINVAL;
@@ -63,10 +63,10 @@ loff_t remote_llseek(struct file *file,
lock_kernel();
switch (origin) {
- case 2:
+ case SEEK_END:
offset += i_size_read(file->f_path.dentry->d_inode);
break;
- case 1:
+ case SEEK_CUR:
offset += file->f_pos;
}
retval = -EINVAL;
@@ -94,10 +94,10 @@ loff_t default_llseek(struct file *file,
lock_kernel();
switch (origin) {
- case 2:
+ case SEEK_END:
offset += i_size_read(file->f_path.dentry->d_inode);
break;
- case 1:
+ case SEEK_CUR:
offset += file->f_pos;
}
retval = -EINVAL;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists