aboutsummaryrefslogtreecommitdiffstats
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-10-23 23:00:53 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-10-24 20:25:23 -0400
commit49be4fb9cc3431fc4ebc71c764db848483b2a16c (patch)
tree9bc695c26f96df3b19372fffaf01fe9011af50ac /fs/overlayfs
parent68bf8611076a8e4bee8bc8d03ff28bd1e9a9c631 (diff)
overlayfs: embed root into overlay_readdir_data
no sense having it a pointer - all instances have it pointing to local variable in the same stack frame Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r--fs/overlayfs/readdir.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 9c9872be2c72..a9ee2c1176fe 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -36,7 +36,7 @@ struct ovl_dir_cache {
36struct ovl_readdir_data { 36struct ovl_readdir_data {
37 struct dir_context ctx; 37 struct dir_context ctx;
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;
@@ -101,7 +101,7 @@ static int ovl_cache_entry_add_rb(struct ovl_readdir_data *rdd,
101 const char *name, int len, u64 ino, 101 const char *name, int len, u64 ino,
102 unsigned int d_type) 102 unsigned int d_type)
103{ 103{
104 struct rb_node **newp = &rdd->root->rb_node; 104 struct rb_node **newp = &rdd->root.rb_node;
105 struct rb_node *parent = NULL; 105 struct rb_node *parent = NULL;
106 struct ovl_cache_entry *p; 106 struct ovl_cache_entry *p;
107 107
@@ -126,7 +126,7 @@ static int ovl_cache_entry_add_rb(struct ovl_readdir_data *rdd,
126 126
127 list_add_tail(&p->l_node, rdd->list); 127 list_add_tail(&p->l_node, rdd->list);
128 rb_link_node(&p->node, parent, newp); 128 rb_link_node(&p->node, parent, newp);
129 rb_insert_color(&p->node, rdd->root); 129 rb_insert_color(&p->node, &rdd->root);
130 130
131 return 0; 131 return 0;
132} 132}
@@ -137,7 +137,7 @@ static int ovl_fill_lower(struct ovl_readdir_data *rdd,
137{ 137{
138 struct ovl_cache_entry *p; 138 struct ovl_cache_entry *p;
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 {
@@ -277,12 +277,11 @@ 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 rb_root root = RB_ROOT;
281 struct list_head middle; 280 struct list_head middle;
282 struct ovl_readdir_data rdd = { 281 struct ovl_readdir_data rdd = {
283 .ctx.actor = ovl_fill_merge, 282 .ctx.actor = ovl_fill_merge,
284 .list = list, 283 .list = list,
285 .root = &root, 284 .root = RB_ROOT,
286 .is_merge = false, 285 .is_merge = false,
287 }; 286 };
288 287