add patch fix-quota-charging-for-shared-xattr-blocks
[ext4-patch-queue.git] / remove-unused-d_name-argument-from-ext4_search_dir
blob1f617cbdc43859ccd226222ef5a3164bde42179d
1 ext4: remove unused d_name argument from ext4_search_dir() et al.
3 From: Eric Biggers <ebiggers@google.com>
5 Now that we are passing a struct ext4_filename, we do not need to pass
6 around the original struct qstr too.
8 Signed-off-by: Eric Biggers <ebiggers@google.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 Reviewed-by: Jan Kara <jack@suse.cz>
11 ---
12  fs/ext4/ext4.h   |  2 --
13  fs/ext4/inline.c |  5 ++---
14  fs/ext4/namei.c  | 13 +++++--------
15  3 files changed, 7 insertions(+), 13 deletions(-)
17 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
18 index 8e8046104f4d..32191548abed 100644
19 --- a/fs/ext4/ext4.h
20 +++ b/fs/ext4/ext4.h
21 @@ -2523,7 +2523,6 @@ extern int ext4_search_dir(struct buffer_head *bh,
22                            int buf_size,
23                            struct inode *dir,
24                            struct ext4_filename *fname,
25 -                          const struct qstr *d_name,
26                            unsigned int offset,
27                            struct ext4_dir_entry_2 **res_dir);
28  extern int ext4_generic_delete_entry(handle_t *handle,
29 @@ -3007,7 +3006,6 @@ extern int htree_inlinedir_to_tree(struct file *dir_file,
30                                    int *has_inline_data);
31  extern struct buffer_head *ext4_find_inline_entry(struct inode *dir,
32                                         struct ext4_filename *fname,
33 -                                       const struct qstr *d_name,
34                                         struct ext4_dir_entry_2 **res_dir,
35                                         int *has_inline_data);
36  extern int ext4_delete_inline_entry(handle_t *handle,
37 diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
38 index d5dea4c293ef..8d141c0c8ff9 100644
39 --- a/fs/ext4/inline.c
40 +++ b/fs/ext4/inline.c
41 @@ -1627,7 +1627,6 @@ int ext4_try_create_inline_dir(handle_t *handle, struct inode *parent,
43  struct buffer_head *ext4_find_inline_entry(struct inode *dir,
44                                         struct ext4_filename *fname,
45 -                                       const struct qstr *d_name,
46                                         struct ext4_dir_entry_2 **res_dir,
47                                         int *has_inline_data)
48  {
49 @@ -1649,7 +1648,7 @@ struct buffer_head *ext4_find_inline_entry(struct inode *dir,
50                                                 EXT4_INLINE_DOTDOT_SIZE;
51         inline_size = EXT4_MIN_INLINE_DATA_SIZE - EXT4_INLINE_DOTDOT_SIZE;
52         ret = ext4_search_dir(iloc.bh, inline_start, inline_size,
53 -                             dir, fname, d_name, 0, res_dir);
54 +                             dir, fname, 0, res_dir);
55         if (ret == 1)
56                 goto out_find;
57         if (ret < 0)
58 @@ -1662,7 +1661,7 @@ struct buffer_head *ext4_find_inline_entry(struct inode *dir,
59         inline_size = ext4_get_inline_size(dir) - EXT4_MIN_INLINE_DATA_SIZE;
61         ret = ext4_search_dir(iloc.bh, inline_start, inline_size,
62 -                             dir, fname, d_name, 0, res_dir);
63 +                             dir, fname, 0, res_dir);
64         if (ret == 1)
65                 goto out_find;
67 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
68 index b81f7d46f344..404256caf9cf 100644
69 --- a/fs/ext4/namei.c
70 +++ b/fs/ext4/namei.c
71 @@ -1155,12 +1155,11 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
72  static inline int search_dirblock(struct buffer_head *bh,
73                                   struct inode *dir,
74                                   struct ext4_filename *fname,
75 -                                 const struct qstr *d_name,
76                                   unsigned int offset,
77                                   struct ext4_dir_entry_2 **res_dir)
78  {
79         return ext4_search_dir(bh, bh->b_data, dir->i_sb->s_blocksize, dir,
80 -                              fname, d_name, offset, res_dir);
81 +                              fname, offset, res_dir);
82  }
84  /*
85 @@ -1262,7 +1261,6 @@ static inline bool ext4_match(const struct ext4_filename *fname,
86   */
87  int ext4_search_dir(struct buffer_head *bh, char *search_buf, int buf_size,
88                     struct inode *dir, struct ext4_filename *fname,
89 -                   const struct qstr *d_name,
90                     unsigned int offset, struct ext4_dir_entry_2 **res_dir)
91  {
92         struct ext4_dir_entry_2 * de;
93 @@ -1355,7 +1353,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
95         if (ext4_has_inline_data(dir)) {
96                 int has_inline_data = 1;
97 -               ret = ext4_find_inline_entry(dir, &fname, d_name, res_dir,
98 +               ret = ext4_find_inline_entry(dir, &fname, res_dir,
99                                              &has_inline_data);
100                 if (has_inline_data) {
101                         if (inlined)
102 @@ -1447,7 +1445,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
103                         goto next;
104                 }
105                 set_buffer_verified(bh);
106 -               i = search_dirblock(bh, dir, &fname, d_name,
107 +               i = search_dirblock(bh, dir, &fname,
108                             block << EXT4_BLOCK_SIZE_BITS(sb), res_dir);
109                 if (i == 1) {
110                         EXT4_I(dir)->i_dir_start_lookup = block;
111 @@ -1488,7 +1486,6 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir,
113         struct super_block * sb = dir->i_sb;
114         struct dx_frame frames[2], *frame;
115 -       const struct qstr *d_name = fname->usr_fname;
116         struct buffer_head *bh;
117         ext4_lblk_t block;
118         int retval;
119 @@ -1505,7 +1502,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir,
120                 if (IS_ERR(bh))
121                         goto errout;
123 -               retval = search_dirblock(bh, dir, fname, d_name,
124 +               retval = search_dirblock(bh, dir, fname,
125                                          block << EXT4_BLOCK_SIZE_BITS(sb),
126                                          res_dir);
127                 if (retval == 1)
128 @@ -1530,7 +1527,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir,
130         bh = NULL;
131  errout:
132 -       dxtrace(printk(KERN_DEBUG "%s not found\n", d_name->name));
133 +       dxtrace(printk(KERN_DEBUG "%s not found\n", fname->usr_fname->name));
134  success:
135         dx_release(frames);
136         return bh;
137 -- 
138 2.13.0.219.gdb65acc882-goog