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>
此提交包含在:
Josef Bacik
2011-07-18 13:21:39 -04:00
提交者 Al Viro
父節點 06222e491e
當前提交 22735068d5
共有 4 個檔案被更改,包括 14 行新增0 行删除

查看文件

@@ -21,12 +21,16 @@
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_SIZE;
break;
default:
offset = -1;
}
if (offset < 0)
return -EINVAL;