diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-05-15 13:52:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:46:46 -0400 |
commit | 5c0ba4e0762e6dabd14a5c276652e2defec38de7 (patch) | |
tree | cc2c94d81a631b0656782e1f8299da3267871964 /include | |
parent | 83a8761142cb38536e9e88dfc2432d331ea4e257 (diff) |
[readdir] introduce iterate_dir() and dir_context
iterate_dir(): new helper, replacing vfs_readdir().
struct dir_context: contains the readdir callback (and will get more stuff
in it), embedded into whatever data that callback wants to deal with;
eventually, we'll be passing it to ->readdir() replacement instead of
(data,filldir) pair.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 65c2be22b601..643e5b6cbaf5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1506,6 +1506,9 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | |||
1506 | * to have different dirent layouts depending on the binary type. | 1506 | * to have different dirent layouts depending on the binary type. |
1507 | */ | 1507 | */ |
1508 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); | 1508 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); |
1509 | struct dir_context { | ||
1510 | filldir_t actor; | ||
1511 | }; | ||
1509 | struct block_device_operations; | 1512 | struct block_device_operations; |
1510 | 1513 | ||
1511 | /* These macros are for out of kernel modules to test that | 1514 | /* These macros are for out of kernel modules to test that |
@@ -2494,6 +2497,7 @@ loff_t inode_get_bytes(struct inode *inode); | |||
2494 | void inode_set_bytes(struct inode *inode, loff_t bytes); | 2497 | void inode_set_bytes(struct inode *inode, loff_t bytes); |
2495 | 2498 | ||
2496 | extern int vfs_readdir(struct file *, filldir_t, void *); | 2499 | extern int vfs_readdir(struct file *, filldir_t, void *); |
2500 | extern int iterate_dir(struct file *, struct dir_context *); | ||
2497 | 2501 | ||
2498 | extern int vfs_stat(const char __user *, struct kstat *); | 2502 | extern int vfs_stat(const char __user *, struct kstat *); |
2499 | extern int vfs_lstat(const char __user *, struct kstat *); | 2503 | extern int vfs_lstat(const char __user *, struct kstat *); |