mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
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>
This commit is contained in:
parent
0ab2621ebd
commit
a41f1a4715
3 changed files with 144 additions and 313 deletions
|
@ -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 *,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue