diff options
author | Josef Bacik <josef@redhat.com> | 2011-07-18 19:21:39 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-21 02:47:58 +0200 |
commit | 22735068d53c7115e384bc88dea95b17e76a6839 (patch) | |
tree | c531b0ca2ccf472c8abfede626535fcf07357624 /drivers/char/generic_nvram.c | |
parent | fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek (diff) | |
download | linux-22735068d53c7115e384bc88dea95b17e76a6839.tar.xz linux-22735068d53c7115e384bc88dea95b17e76a6839.zip |
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/generic_nvram.c')
-rw-r--r-- | drivers/char/generic_nvram.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c index 0e941b57482e..6c4f4b5a9dd3 100644 --- a/drivers/char/generic_nvram.c +++ b/drivers/char/generic_nvram.c @@ -34,12 +34,16 @@ static ssize_t nvram_len; static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) { switch (origin) { + case 0: + break; case 1: offset += file->f_pos; break; case 2: offset += nvram_len; break; + default: + offset = -1; } if (offset < 0) return -EINVAL; |