diff options
author | Jeff Mahoney <jeffm@suse.com> | 2009-03-30 14:02:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 12:16:38 -0700 |
commit | a41f1a4715f26f7bc4d047d0bc7710145c8e69c7 (patch) | |
tree | 8b5d94368e774ec490619593300e8b3f4b7c5cb1 /include/linux/reiserfs_fs.h | |
parent | 0ab2621ebd9a28bf7a524ecd50d492a10579dfcc (diff) | |
download | linux-a41f1a4715f26f7bc4d047d0bc7710145c8e69c7.tar.gz linux-a41f1a4715f26f7bc4d047d0bc7710145c8e69c7.tar.bz2 linux-a41f1a4715f26f7bc4d047d0bc7710145c8e69c7.zip |
reiserfs: use generic readdir for operations across all xattrs
The current reiserfs xattr implementation open codes reiserfs_readdir
and frees the path before calling the filldir function. Typically, the
filldir function is something that modifies the file system, such as a
chown or an inode deletion that also require reading of an inode
associated with each direntry. Since the file system is modified, the
path retained becomes invalid for the next run. In addition, it runs
backwards in attempt to minimize activity.
This is clearly suboptimal from a code cleanliness perspective as well
as performance-wise.
This patch implements a generic reiserfs_for_each_xattr that uses the
generic readdir and a specific filldir routine that simply populates an
array of dentries and then performs a specific operation on them. When
all files have been operated on, it then calls the operation on the
directory itself.
The result is a noticable code reduction and better performance.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/reiserfs_fs.h')
-rw-r--r-- | include/linux/reiserfs_fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 67ad310fa88b..c0365e07fce6 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -1984,6 +1984,7 @@ extern const struct inode_operations reiserfs_dir_inode_operations; extern const struct inode_operations reiserfs_symlink_inode_operations; extern const struct inode_operations reiserfs_special_inode_operations; extern const struct file_operations reiserfs_dir_operations; +int reiserfs_readdir_dentry(struct dentry *, void *, filldir_t, loff_t *); /* tail_conversion.c */ int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, |