diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-23 23:03:03 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-24 20:25:23 -0400 |
commit | db6ec212b53abc29a5bb6ac8c810010fc28d5191 (patch) | |
tree | 4cfa4055b85eb718524e426890057f5bcf172c66 | |
parent | 49be4fb9cc3431fc4ebc71c764db848483b2a16c (diff) |
overlayfs: embed middle into overlay_readdir_data
same story...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/overlayfs/readdir.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index a9ee2c1176fe..910553f37aca 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c | |||
@@ -38,7 +38,7 @@ struct ovl_readdir_data { | |||
38 | bool is_merge; | 38 | bool is_merge; |
39 | struct rb_root root; | 39 | struct rb_root root; |
40 | struct list_head *list; | 40 | struct list_head *list; |
41 | struct list_head *middle; | 41 | struct list_head middle; |
42 | int count; | 42 | int count; |
43 | int err; | 43 | int err; |
44 | }; | 44 | }; |
@@ -139,13 +139,13 @@ static int ovl_fill_lower(struct ovl_readdir_data *rdd, | |||
139 | 139 | ||
140 | p = ovl_cache_entry_find(&rdd->root, name, namelen); | 140 | p = ovl_cache_entry_find(&rdd->root, name, namelen); |
141 | if (p) { | 141 | if (p) { |
142 | list_move_tail(&p->l_node, rdd->middle); | 142 | list_move_tail(&p->l_node, &rdd->middle); |
143 | } else { | 143 | } else { |
144 | p = ovl_cache_entry_new(name, namelen, ino, d_type); | 144 | p = ovl_cache_entry_new(name, namelen, ino, d_type); |
145 | if (p == NULL) | 145 | if (p == NULL) |
146 | rdd->err = -ENOMEM; | 146 | rdd->err = -ENOMEM; |
147 | else | 147 | else |
148 | list_add_tail(&p->l_node, rdd->middle); | 148 | list_add_tail(&p->l_node, &rdd->middle); |
149 | } | 149 | } |
150 | 150 | ||
151 | return rdd->err; | 151 | return rdd->err; |
@@ -277,7 +277,6 @@ static inline int ovl_dir_read_merged(struct path *upperpath, | |||
277 | struct list_head *list) | 277 | struct list_head *list) |
278 | { | 278 | { |
279 | int err; | 279 | int err; |
280 | struct list_head middle; | ||
281 | struct ovl_readdir_data rdd = { | 280 | struct ovl_readdir_data rdd = { |
282 | .ctx.actor = ovl_fill_merge, | 281 | .ctx.actor = ovl_fill_merge, |
283 | .list = list, | 282 | .list = list, |
@@ -301,11 +300,10 @@ static inline int ovl_dir_read_merged(struct path *upperpath, | |||
301 | * Insert lowerpath entries before upperpath ones, this allows | 300 | * Insert lowerpath entries before upperpath ones, this allows |
302 | * offsets to be reasonably constant | 301 | * offsets to be reasonably constant |
303 | */ | 302 | */ |
304 | list_add(&middle, rdd.list); | 303 | list_add(&rdd.middle, rdd.list); |
305 | rdd.middle = &middle; | ||
306 | rdd.is_merge = true; | 304 | rdd.is_merge = true; |
307 | err = ovl_dir_read(lowerpath, &rdd); | 305 | err = ovl_dir_read(lowerpath, &rdd); |
308 | list_del(&middle); | 306 | list_del(&rdd.middle); |
309 | } | 307 | } |
310 | out: | 308 | out: |
311 | return err; | 309 | return err; |