Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257396
b: refs/heads/master
c: 2273506
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik authored and Al Viro committed Jul 21, 2011
1 parent 8dd15f1 commit 2e0c13f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06222e491e663dac939f04b125c9dc52126a75c4
refs/heads/master: 22735068d53c7115e384bc88dea95b17e76a6839
4 changes: 4 additions & 0 deletions trunk/drivers/char/generic_nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/char/nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
case 2:
offset += NVRAM_BYTES;
break;
default:
return -EINVAL;
}

return (offset >= 0) ? (file->f_pos = offset) : -EINVAL;
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/char/ps3flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ static loff_t ps3flash_llseek(struct file *file, loff_t offset, int origin)

mutex_lock(&file->f_mapping->host->i_mutex);
switch (origin) {
case 0:
break;
case 1:
offset += file->f_pos;
break;
case 2:
offset += dev->regions[dev->region_idx].size*dev->blk_size;
break;
default:
offset = -1;
}
if (offset < 0) {
res = -EINVAL;
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/macintosh/nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2e0c13f

Please sign in to comment.