Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257394
b: refs/heads/master
c: c334b11
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik authored and Al Viro committed Jul 21, 2011
1 parent b9b489e commit cc98e96
Show file tree
Hide file tree
Showing 2 changed files with 22 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: b26751575a9aa55fd6dbf3febde3ff06dfadc44f
refs/heads/master: c334b1138bd44bea578eab7971c59bd9212a1093
21 changes: 21 additions & 0 deletions trunk/fs/ext4/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,27 @@ loff_t ext4_llseek(struct file *file, loff_t offset, int origin)
}
offset += file->f_pos;
break;
case SEEK_DATA:
/*
* In the generic case the entire file is data, so as long as
* offset isn't at the end of the file then the offset is data.
*/
if (offset >= inode->i_size) {
mutex_unlock(&inode->i_mutex);
return -ENXIO;
}
break;
case SEEK_HOLE:
/*
* There is a virtual hole at the end of the file, so as long as
* offset isn't i_size or larger, return i_size.
*/
if (offset >= inode->i_size) {
mutex_unlock(&inode->i_mutex);
return -ENXIO;
}
offset = inode->i_size;
break;
}

if (offset < 0 || offset > maxbytes) {
Expand Down

0 comments on commit cc98e96

Please sign in to comment.