Lines Matching refs:p

102 		struct ovl_cache_entry *p = ovl_cache_entry_from_node(node);  in ovl_cache_entry_find()  local
104 cmp = strncmp(name, p->name, len); in ovl_cache_entry_find()
106 node = p->node.rb_right; in ovl_cache_entry_find()
107 else if (cmp < 0 || len < p->len) in ovl_cache_entry_find()
108 node = p->node.rb_left; in ovl_cache_entry_find()
110 return p; in ovl_cache_entry_find()
117 struct ovl_cache_entry *p) in ovl_calc_d_ino() argument
128 if (strcmp(p->name, "..") == 0) in ovl_calc_d_ino()
139 if ((p->name[0] == '.' && p->len == 1) || in ovl_calc_d_ino()
150 struct ovl_cache_entry *p; in ovl_cache_entry_new() local
152 p = kmalloc(struct_size(p, name, len + 1), GFP_KERNEL); in ovl_cache_entry_new()
153 if (!p) in ovl_cache_entry_new()
156 memcpy(p->name, name, len); in ovl_cache_entry_new()
157 p->name[len] = '\0'; in ovl_cache_entry_new()
158 p->len = len; in ovl_cache_entry_new()
159 p->type = d_type; in ovl_cache_entry_new()
160 p->real_ino = ino; in ovl_cache_entry_new()
161 p->ino = ino; in ovl_cache_entry_new()
163 if (ovl_calc_d_ino(rdd, p)) in ovl_cache_entry_new()
164 p->ino = 0; in ovl_cache_entry_new()
165 p->is_upper = rdd->is_upper; in ovl_cache_entry_new()
166 p->is_whiteout = false; in ovl_cache_entry_new()
168 p->check_xwhiteout = rdd->in_xwhiteouts_dir && d_type == DT_REG; in ovl_cache_entry_new()
171 p->next_maybe_whiteout = rdd->first_maybe_whiteout; in ovl_cache_entry_new()
172 rdd->first_maybe_whiteout = p; in ovl_cache_entry_new()
174 return p; in ovl_cache_entry_new()
183 struct ovl_cache_entry *p; in ovl_cache_entry_add_rb() local
188 p = ovl_cache_entry_new(rdd, name, len, ino, d_type); in ovl_cache_entry_add_rb()
189 if (p == NULL) { in ovl_cache_entry_add_rb()
194 list_add_tail(&p->l_node, rdd->list); in ovl_cache_entry_add_rb()
195 rb_link_node(&p->node, parent, newp); in ovl_cache_entry_add_rb()
196 rb_insert_color(&p->node, rdd->root); in ovl_cache_entry_add_rb()
205 struct ovl_cache_entry *p; in ovl_fill_lowest() local
207 p = ovl_cache_entry_find(rdd->root, name, namelen); in ovl_fill_lowest()
208 if (p) { in ovl_fill_lowest()
209 list_move_tail(&p->l_node, &rdd->middle); in ovl_fill_lowest()
211 p = ovl_cache_entry_new(rdd, name, namelen, ino, d_type); in ovl_fill_lowest()
212 if (p == NULL) in ovl_fill_lowest()
215 list_add_tail(&p->l_node, &rdd->middle); in ovl_fill_lowest()
223 struct ovl_cache_entry *p; in ovl_cache_free() local
226 list_for_each_entry_safe(p, n, list, l_node) in ovl_cache_free()
227 kfree(p); in ovl_cache_free()
282 struct ovl_cache_entry *p = in ovl_check_whiteouts() local
284 rdd->first_maybe_whiteout = p->next_maybe_whiteout; in ovl_check_whiteouts()
286 &QSTR_LEN(p->name, p->len), dir); in ovl_check_whiteouts()
288 p->is_whiteout = ovl_is_whiteout(dentry); in ovl_check_whiteouts()
390 struct list_head *p; in ovl_seek_cursor() local
393 list_for_each(p, &od->cache->entries) { in ovl_seek_cursor()
399 od->cursor = p; in ovl_seek_cursor()
471 static int ovl_cache_update(const struct path *path, struct ovl_cache_entry *p, bool update_ino) in ovl_cache_update() argument
478 u64 ino = p->real_ino; in ovl_cache_update()
482 if (!ovl_same_dev(ofs) && !p->check_xwhiteout) in ovl_cache_update()
485 if (p->name[0] == '.') { in ovl_cache_update()
486 if (p->len == 1) { in ovl_cache_update()
490 if (p->len == 2 && p->name[1] == '.') { in ovl_cache_update()
497 this = lookup_one(mnt_idmap(path->mnt), &QSTR_LEN(p->name, p->len), dir); in ovl_cache_update()
500 p->is_whiteout = true; in ovl_cache_update()
534 p->name, p->len, in ovl_cache_update()
539 p->ino = ino; in ovl_cache_update()
545 p->name, err); in ovl_cache_update()
553 struct ovl_cache_entry *p; in ovl_fill_plain() local
558 p = ovl_cache_entry_new(rdd, name, namelen, ino, d_type); in ovl_fill_plain()
559 if (p == NULL) { in ovl_fill_plain()
563 list_add_tail(&p->l_node, rdd->list); in ovl_fill_plain()
573 struct ovl_cache_entry *p, *n; in ovl_dir_read_impure() local
589 list_for_each_entry_safe(p, n, list, l_node) { in ovl_dir_read_impure()
590 if (strcmp(p->name, ".") != 0 && in ovl_dir_read_impure()
591 strcmp(p->name, "..") != 0) { in ovl_dir_read_impure()
592 err = ovl_cache_update(path, p, true); in ovl_dir_read_impure()
596 if (p->ino == p->real_ino) { in ovl_dir_read_impure()
597 list_del(&p->l_node); in ovl_dir_read_impure()
598 kfree(p); in ovl_dir_read_impure()
603 if (WARN_ON(ovl_cache_entry_find_link(p->name, p->len, in ovl_dir_read_impure()
607 rb_link_node(&p->node, parent, newp); in ovl_dir_read_impure()
608 rb_insert_color(&p->node, root); in ovl_dir_read_impure()
683 struct ovl_cache_entry *p; in ovl_fill_real() local
685 p = ovl_cache_entry_find(&rdt->cache->root, name, namelen); in ovl_fill_real()
686 if (p) in ovl_fill_real()
687 ino = p->ino; in ovl_fill_real()
763 struct ovl_cache_entry *p; in ovl_iterate() local
801 p = list_entry(od->cursor, struct ovl_cache_entry, l_node); in ovl_iterate()
802 if (!p->is_whiteout) { in ovl_iterate()
803 if (!p->ino || p->check_xwhiteout) { in ovl_iterate()
804 err = ovl_cache_update(&file->f_path, p, !p->ino); in ovl_iterate()
810 if (!p->is_whiteout) { in ovl_iterate()
811 if (!dir_emit(ctx, p->name, p->len, p->ino, p->type)) in ovl_iterate()
814 od->cursor = p->l_node.next; in ovl_iterate()
992 struct ovl_cache_entry *p, *n; in ovl_check_empty_dir() local
1004 list_for_each_entry_safe(p, n, list, l_node) { in ovl_check_empty_dir()
1009 if (p->is_whiteout) { in ovl_check_empty_dir()
1010 if (p->is_upper) in ovl_check_empty_dir()
1015 if (p->name[0] == '.') { in ovl_check_empty_dir()
1016 if (p->len == 1) in ovl_check_empty_dir()
1018 if (p->len == 2 && p->name[1] == '.') in ovl_check_empty_dir()
1025 list_del(&p->l_node); in ovl_check_empty_dir()
1026 kfree(p); in ovl_check_empty_dir()
1035 struct ovl_cache_entry *p; in ovl_cleanup_whiteouts() local
1037 list_for_each_entry(p, list, l_node) { in ovl_cleanup_whiteouts()
1040 if (WARN_ON(!p->is_whiteout || !p->is_upper)) in ovl_cleanup_whiteouts()
1043 dentry = ovl_lookup_upper_unlocked(ofs, p->name, upper, p->len); in ovl_cleanup_whiteouts()
1046 upper->d_name.name, p->len, p->name, in ovl_cleanup_whiteouts()
1100 struct ovl_cache_entry *p; in ovl_workdir_cleanup_recurse() local
1124 list_for_each_entry(p, &list, l_node) { in ovl_workdir_cleanup_recurse()
1127 if (p->name[0] == '.') { in ovl_workdir_cleanup_recurse()
1128 if (p->len == 1) in ovl_workdir_cleanup_recurse()
1130 if (p->len == 2 && p->name[1] == '.') in ovl_workdir_cleanup_recurse()
1134 p->name); in ovl_workdir_cleanup_recurse()
1138 dentry = ovl_lookup_upper_unlocked(ofs, p->name, path->dentry, p->len); in ovl_workdir_cleanup_recurse()
1184 struct ovl_cache_entry *p; in ovl_indexdir_cleanup() local
1195 list_for_each_entry(p, &list, l_node) { in ovl_indexdir_cleanup()
1196 if (p->name[0] == '.') { in ovl_indexdir_cleanup()
1197 if (p->len == 1) in ovl_indexdir_cleanup()
1199 if (p->len == 2 && p->name[1] == '.') in ovl_indexdir_cleanup()
1202 index = ovl_lookup_upper_unlocked(ofs, p->name, indexdir, p->len); in ovl_indexdir_cleanup()