Lines Matching refs:rdd

116 static bool ovl_calc_d_ino(struct ovl_readdir_data *rdd,  in ovl_calc_d_ino()  argument
120 if (!rdd->dentry) in ovl_calc_d_ino()
124 if (ovl_xino_bits(rdd->dentry->d_sb)) in ovl_calc_d_ino()
132 if (!rdd->is_upper) in ovl_calc_d_ino()
140 ovl_test_flag(OVL_IMPURE, d_inode(rdd->dentry))) in ovl_calc_d_ino()
146 static struct ovl_cache_entry *ovl_cache_entry_new(struct ovl_readdir_data *rdd, in ovl_cache_entry_new() argument
164 if (ovl_calc_d_ino(rdd, p)) in ovl_cache_entry_new()
166 p->is_upper = rdd->is_upper; in ovl_cache_entry_new()
170 p->next_maybe_whiteout = rdd->first_maybe_whiteout; in ovl_cache_entry_new()
171 rdd->first_maybe_whiteout = p; in ovl_cache_entry_new()
176 static int ovl_cache_entry_add_rb(struct ovl_readdir_data *rdd, in ovl_cache_entry_add_rb() argument
180 struct rb_node **newp = &rdd->root->rb_node; in ovl_cache_entry_add_rb()
187 p = ovl_cache_entry_new(rdd, name, len, ino, d_type); in ovl_cache_entry_add_rb()
189 rdd->err = -ENOMEM; in ovl_cache_entry_add_rb()
193 list_add_tail(&p->l_node, rdd->list); in ovl_cache_entry_add_rb()
195 rb_insert_color(&p->node, rdd->root); in ovl_cache_entry_add_rb()
200 static int ovl_fill_lowest(struct ovl_readdir_data *rdd, in ovl_fill_lowest() argument
206 p = ovl_cache_entry_find(rdd->root, name, namelen); in ovl_fill_lowest()
208 list_move_tail(&p->l_node, &rdd->middle); in ovl_fill_lowest()
210 p = ovl_cache_entry_new(rdd, name, namelen, ino, d_type); in ovl_fill_lowest()
212 rdd->err = -ENOMEM; in ovl_fill_lowest()
214 list_add_tail(&p->l_node, &rdd->middle); in ovl_fill_lowest()
217 return rdd->err; in ovl_fill_lowest()
260 struct ovl_readdir_data *rdd = in ovl_fill_merge() local
263 rdd->count++; in ovl_fill_merge()
264 if (!rdd->is_lowest) in ovl_fill_merge()
265 return ovl_cache_entry_add_rb(rdd, name, namelen, ino, d_type); in ovl_fill_merge()
267 return ovl_fill_lowest(rdd, name, namelen, offset, ino, d_type); in ovl_fill_merge()
270 static int ovl_check_whiteouts(struct dentry *dir, struct ovl_readdir_data *rdd) in ovl_check_whiteouts() argument
277 old_cred = ovl_override_creds(rdd->dentry->d_sb); in ovl_check_whiteouts()
281 while (rdd->first_maybe_whiteout) { in ovl_check_whiteouts()
282 p = rdd->first_maybe_whiteout; in ovl_check_whiteouts()
283 rdd->first_maybe_whiteout = p->next_maybe_whiteout; in ovl_check_whiteouts()
298 struct ovl_readdir_data *rdd) in ovl_dir_read() argument
307 rdd->first_maybe_whiteout = NULL; in ovl_dir_read()
308 rdd->ctx.pos = 0; in ovl_dir_read()
310 rdd->count = 0; in ovl_dir_read()
311 rdd->err = 0; in ovl_dir_read()
312 err = iterate_dir(realfile, &rdd->ctx); in ovl_dir_read()
314 err = rdd->err; in ovl_dir_read()
315 } while (!err && rdd->count); in ovl_dir_read()
317 if (!err && rdd->first_maybe_whiteout && rdd->dentry) in ovl_dir_read()
318 err = ovl_check_whiteouts(realpath->dentry, rdd); in ovl_dir_read()
363 struct ovl_readdir_data rdd = { in ovl_dir_read_merged() local
374 rdd.is_upper = ovl_dentry_upper(dentry) == realpath.dentry; in ovl_dir_read_merged()
377 err = ovl_dir_read(&realpath, &rdd); in ovl_dir_read_merged()
385 list_add(&rdd.middle, rdd.list); in ovl_dir_read_merged()
386 rdd.is_lowest = true; in ovl_dir_read_merged()
387 err = ovl_dir_read(&realpath, &rdd); in ovl_dir_read_merged()
388 list_del(&rdd.middle); in ovl_dir_read_merged()
540 struct ovl_readdir_data *rdd = in ovl_fill_plain() local
543 rdd->count++; in ovl_fill_plain()
544 p = ovl_cache_entry_new(rdd, name, namelen, ino, d_type); in ovl_fill_plain()
546 rdd->err = -ENOMEM; in ovl_fill_plain()
549 list_add_tail(&p->l_node, rdd->list); in ovl_fill_plain()
560 struct ovl_readdir_data rdd = { in ovl_dir_read_impure() local
570 err = ovl_dir_read(&realpath, &rdd); in ovl_dir_read_impure()
993 struct ovl_readdir_data *rdd = in ovl_check_d_type() local
1001 rdd->d_type_supported = true; in ovl_check_d_type()
1013 struct ovl_readdir_data rdd = { in ovl_check_d_type_supported() local
1018 err = ovl_dir_read(realpath, &rdd); in ovl_check_d_type_supported()
1022 return rdd.d_type_supported; in ovl_check_d_type_supported()
1032 struct ovl_readdir_data rdd = { in ovl_workdir_cleanup_recurse() local
1040 err = ovl_dir_read(path, &rdd); in ovl_workdir_cleanup_recurse()
1097 struct ovl_readdir_data rdd = { in ovl_indexdir_cleanup() local
1105 err = ovl_dir_read(&path, &rdd); in ovl_indexdir_cleanup()