Lines Matching full:layer
44 * Before encoding a non-upper directory file handle from real layer N, we need
47 * "layer N connected" ancestor and verifying that all parents along the way are
48 * "layer N connectable". If an ancestor that is NOT "layer N connectable" is
49 * found, we need to copy up an ancestor, which is "layer N connectable", thus
50 * making that ancestor "layer N connected". For example:
52 * layer 1: /a
53 * layer 2: /a/b/c
55 * The overlay dentry /a is NOT "layer 2 connectable", because if dir /a is
57 * layer 1. The dir /a from layer 2 will never be indexed, so the algorithm (*)
62 * /a/b/c, which is "layer 2 connectable", on encode time. That ancestor is
63 * /a/b. After copy up (and index) of /a/b, it will become "layer 2 connected"
69 * entry /a in the lower layers above layer N and find the indexed dir /a from
70 * layer 1. If that improvement is made, then the check for "layer N connected"
72 * example above, /a will be "layer 2 connectable". However, if layer 2 dir /a
73 * is a target of a layer 1 redirect, then /a will NOT be "layer 2 connectable":
75 * layer 1: /A (redirect = /a)
76 * layer 2: /a/b/c
79 /* Return the lowest layer for encoding a connectable file handle */
84 /* We can get overlay root from root of any layer */ in ovl_connectable_layer()
90 * lower layer in ovl_connectable_layer()
97 return oe->lowerstack[0].layer->idx; in ovl_connectable_layer()
102 * have the same uppermost lower layer as the origin's layer. We may need to
106 * Return the connected origin layer or < 0 on error.
118 origin_layer = OVL_E(dentry)->lowerstack[0].layer->idx; in ovl_connect_layer()
122 /* Find the topmost origin layer connectable ancestor of @dentry */ in ovl_connect_layer()
132 * If @parent is not origin layer connectable, then copy up in ovl_connect_layer()
133 * @next which is origin layer connectable and we are done. in ovl_connect_layer()
197 * Root is never indexed, so if there's an upper layer, encode upper for in ovl_check_encode_origin()
207 * ovl_connect_layer() will try to make origin's layer "connected" by in ovl_check_encode_origin()
333 oe->lowerstack->layer = lowerpath->layer; in ovl_obtain_alias()
348 /* Get the upper or lower dentry in stach whose on layer @idx */
358 if (oe->lowerstack[i].layer->idx == idx) in ovl_dentry_real_at()
367 * dentry is @real. If @real is on upper layer, we lookup a child overlay
373 struct ovl_layer *layer) in ovl_lookup_real_one() argument
390 if (ovl_dentry_real_at(connected, layer->idx) != parent) in ovl_lookup_real_one()
395 * from racing with underlying layer rename. In this case, we don't in ovl_lookup_real_one()
408 } else if (ovl_dentry_real_at(this, layer->idx) != real) { in ovl_lookup_real_one()
421 …pr_warn_ratelimited("overlayfs: failed to lookup one by real (%pd2, layer=%d, connected=%pd2, err=… in ovl_lookup_real_one()
422 real, layer->idx, connected, err); in ovl_lookup_real_one()
429 struct ovl_layer *layer);
436 struct ovl_layer *layer) in ovl_lookup_real_inode() argument
448 inode = ovl_lookup_inode(sb, real, !layer->idx); in ovl_lookup_real_inode()
460 if (!this && layer->idx && ofs->indexdir && !WARN_ON(!d_is_dir(real))) { in ovl_lookup_real_inode()
475 * ovl_lookup_real() in lower layer may call recursively once to in ovl_lookup_real_inode()
476 * ovl_lookup_real() in upper layer. The first level call walks in ovl_lookup_real_inode()
488 if (ovl_dentry_real_at(this, layer->idx) != real) { in ovl_lookup_real_inode()
502 struct ovl_layer *layer) in ovl_lookup_real_ancestor() argument
507 if (real == layer->mnt->mnt_root) in ovl_lookup_real_ancestor()
519 ancestor = ovl_lookup_real_inode(sb, next, layer); in ovl_lookup_real_ancestor()
523 if (parent == layer->mnt->mnt_root) { in ovl_lookup_real_ancestor()
529 * If @real has been moved out of the layer root directory, in ovl_lookup_real_ancestor()
550 * If @real is on upper layer, we lookup a child overlay dentry with the same
555 struct ovl_layer *layer) in ovl_lookup_real() argument
560 connected = ovl_lookup_real_ancestor(sb, real, layer); in ovl_lookup_real()
568 layer->idx); in ovl_lookup_real()
583 * we will not find 'real_connected' and hit the layer in ovl_lookup_real()
589 if (parent == layer->mnt->mnt_root) { in ovl_lookup_real()
596 * If real file has been moved out of the layer root in ovl_lookup_real()
611 this = ovl_lookup_real_one(connected, next, layer); in ovl_lookup_real()
627 layer); in ovl_lookup_real()
646 …pr_warn_ratelimited("overlayfs: failed to lookup by real (%pd2, layer=%d, connected=%pd2, err=%i)\… in ovl_lookup_real()
647 real, layer->idx, connected, err); in ovl_lookup_real()
662 struct ovl_layer *layer = upper ? &upper_layer : lowerpath->layer; in ovl_get_dentry() local
680 return ovl_lookup_real(sb, real, layer); in ovl_get_dentry()
756 /* Find origin.dentry again with ovl_acceptable() layer check */ in ovl_lower_fh_to_d()