summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2012-04-30 20:11:29 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-22 22:00:15 +0200
commite8b96eb5034a0ccebf36760f88e31ea3e3cdf1e4 (patch)
tree3ea1b85311b3d059f2bbf38e484aa2ce06bab017 /include
parentvfs: Avoid unnecessary WB_SYNC_NONE writeback during sys_sync and reorder syn... (diff)
downloadlinux-e8b96eb5034a0ccebf36760f88e31ea3e3cdf1e4.tar.xz
linux-e8b96eb5034a0ccebf36760f88e31ea3e3cdf1e4.zip
vfs: allow custom EOF in generic_file_llseek code
For ext3/4 htree directories, using the vfs llseek function with SEEK_END goes to i_size like for any other file, but in reality we want the maximum possible hash value. Recent changes in ext4 have cut & pasted generic_file_llseek() back into fs/ext4/dir.c, but replicating this core code seems like a bad idea, especially since the copy has already diverged from the vfs. This patch updates generic_file_llseek_size to accept both a custom maximum offset, and a custom EOF position. With this in place, ext4_dir_llseek can pass in the appropriate maximum hash position for both maxsize and eof, and get what it wants. As far as I know, this does not fix any bugs - nfs in the kernel doesn't use SEEK_END, and I don't know of any user who does. But some ext4 folks seem keen on doing the right thing here, and I can't really argue. (Patch also fixes up some comments slightly) Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6a6ca85bee23..34acf51273dd 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2454,7 +2454,7 @@ extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
- int origin, loff_t maxsize);
+ int origin, loff_t maxsize, loff_t eof);
extern int generic_file_open(struct inode * inode, struct file * filp);
extern int nonseekable_open(struct inode * inode, struct file * filp);