aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Snook <csnook@redhat.com>2007-05-08 03:24:13 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:14:59 -0400
commit7b8e89249ba54fb6e12358bbed7e3070fa1d1e6a (patch)
tree64ddcadb875a092d1ee38dc96cf95cef9fd7241d /fs
parent5b7952021289b6d04d8c62c0f13acce570730dcd (diff)
use symbolic constants in generic lseek code
Convert magic numbers to SEEK_* values from fs.h Signed-off-by: Chris Snook <csnook@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/read_write.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 1f8dc373ede7..0642a1691d15 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -37,10 +37,10 @@ loff_t generic_file_llseek(struct file *file, loff_t offset, int origin)
37 37
38 mutex_lock(&inode->i_mutex); 38 mutex_lock(&inode->i_mutex);
39 switch (origin) { 39 switch (origin) {
40 case 2: 40 case SEEK_END:
41 offset += inode->i_size; 41 offset += inode->i_size;
42 break; 42 break;
43 case 1: 43 case SEEK_CUR:
44 offset += file->f_pos; 44 offset += file->f_pos;
45 } 45 }
46 retval = -EINVAL; 46 retval = -EINVAL;
@@ -63,10 +63,10 @@ loff_t remote_llseek(struct file *file, loff_t offset, int origin)
63 63
64 lock_kernel(); 64 lock_kernel();
65 switch (origin) { 65 switch (origin) {
66 case 2: 66 case SEEK_END:
67 offset += i_size_read(file->f_path.dentry->d_inode); 67 offset += i_size_read(file->f_path.dentry->d_inode);
68 break; 68 break;
69 case 1: 69 case SEEK_CUR:
70 offset += file->f_pos; 70 offset += file->f_pos;
71 } 71 }
72 retval = -EINVAL; 72 retval = -EINVAL;
@@ -94,10 +94,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
94 94
95 lock_kernel(); 95 lock_kernel();
96 switch (origin) { 96 switch (origin) {
97 case 2: 97 case SEEK_END:
98 offset += i_size_read(file->f_path.dentry->d_inode); 98 offset += i_size_read(file->f_path.dentry->d_inode);
99 break; 99 break;
100 case 1: 100 case SEEK_CUR:
101 offset += file->f_pos; 101 offset += file->f_pos;
102 } 102 }
103 retval = -EINVAL; 103 retval = -EINVAL;