From: Chris Snook Date: Tue, 8 May 2007 07:24:13 +0000 (-0700) Subject: use symbolic constants in generic lseek code X-Git-Tag: v2.6.22-rc1~790 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=7b8e89249ba54fb6e12358bbed7e3070fa1d1e6a;p=powerpc.git use symbolic constants in generic lseek code Convert magic numbers to SEEK_* values from fs.h Signed-off-by: Chris Snook Acked-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/read_write.c b/fs/read_write.c index 1f8dc373ed..0642a1691d 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) 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, loff_t offset, int origin) 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, loff_t offset, int origin) 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;