aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@redhat.com>2008-10-03 17:32:43 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-10-03 17:32:43 -0400
commit68c9d702bb72f367f3b148963ec6cf5e07ff7f65 (patch)
tree16fc61a1bd973c14a7858ab1fbcb306d3ae75184 /include
parent00dc417fa3e763345b34ccb6034d72de76eea0a1 (diff)
generic block based fiemap implementation
Any block based fs (this patch includes ext3) just has to declare its own fiemap() function and then call this generic function with its own get_block_t. This works well for block based filesystems that will map multiple contiguous blocks at one time, but will work for filesystems that only map one block at a time, you will just end up with an "extent" for each block. One gotcha is this will not play nicely where there is hole+data after the EOF. This function will assume its hit the end of the data as soon as it hits a hole after the EOF, so if there is any data past that it will not pick that up. AFAIK no block based fs does this anyway, but its in the comments of the function anyway just in case. Signed-off-by: Josef Bacik <jbacik@redhat.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: linux-fsdevel@vger.kernel.org
Diffstat (limited to 'include')
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fs.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 80171ee89a22..8120fa1bc235 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -837,6 +837,8 @@ extern void ext3_truncate (struct inode *);
837extern void ext3_set_inode_flags(struct inode *); 837extern void ext3_set_inode_flags(struct inode *);
838extern void ext3_get_inode_flags(struct ext3_inode_info *); 838extern void ext3_get_inode_flags(struct ext3_inode_info *);
839extern void ext3_set_aops(struct inode *inode); 839extern void ext3_set_aops(struct inode *inode);
840extern int ext3_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
841 u64 start, u64 len);
840 842
841/* ioctl.c */ 843/* ioctl.c */
842extern int ext3_ioctl (struct inode *, struct file *, unsigned int, 844extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 194fb237a307..385c9a197df1 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1998,6 +1998,9 @@ extern int vfs_fstat(unsigned int, struct kstat *);
1998 1998
1999extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, 1999extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
2000 unsigned long arg); 2000 unsigned long arg);
2001extern int generic_block_fiemap(struct inode *inode,
2002 struct fiemap_extent_info *fieinfo, u64 start,
2003 u64 len, get_block_t *get_block);
2001 2004
2002extern void get_filesystem(struct file_system_type *fs); 2005extern void get_filesystem(struct file_system_type *fs);
2003extern void put_filesystem(struct file_system_type *fs); 2006extern void put_filesystem(struct file_system_type *fs);