diff options
author | Josef Bacik <josef@redhat.com> | 2011-07-18 13:21:39 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 20:47:58 -0400 |
commit | 22735068d53c7115e384bc88dea95b17e76a6839 (patch) | |
tree | c531b0ca2ccf472c8abfede626535fcf07357624 /drivers/char/ps3flash.c | |
parent | 06222e491e663dac939f04b125c9dc52126a75c4 (diff) |
drivers: fix up various ->llseek() implementations
Fix up a few ->llseek() implementations that won't deal with SEEK_HOLE/SEEK_DATA
properly. Make them future proof so that if we ever add new options they will
return -EINVAL. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/char/ps3flash.c')
-rw-r--r-- | drivers/char/ps3flash.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c index 85c004a518ee..5a06787e5be3 100644 --- a/drivers/char/ps3flash.c +++ b/drivers/char/ps3flash.c | |||
@@ -101,12 +101,16 @@ static loff_t ps3flash_llseek(struct file *file, loff_t offset, int origin) | |||
101 | 101 | ||
102 | mutex_lock(&file->f_mapping->host->i_mutex); | 102 | mutex_lock(&file->f_mapping->host->i_mutex); |
103 | switch (origin) { | 103 | switch (origin) { |
104 | case 0: | ||
105 | break; | ||
104 | case 1: | 106 | case 1: |
105 | offset += file->f_pos; | 107 | offset += file->f_pos; |
106 | break; | 108 | break; |
107 | case 2: | 109 | case 2: |
108 | offset += dev->regions[dev->region_idx].size*dev->blk_size; | 110 | offset += dev->regions[dev->region_idx].size*dev->blk_size; |
109 | break; | 111 | break; |
112 | default: | ||
113 | offset = -1; | ||
110 | } | 114 | } |
111 | if (offset < 0) { | 115 | if (offset < 0) { |
112 | res = -EINVAL; | 116 | res = -EINVAL; |