|
@@ -207,6 +207,19 @@ struct ovl_layer *ovl_layer_lower(struct dentry *dentry)
|
|
|
return oe->numlower ? oe->lowerstack[0].layer : NULL;
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * ovl_dentry_lower() could return either a data dentry or metacopy dentry
|
|
|
+ * dependig on what is stored in lowerstack[0]. At times we need to find
|
|
|
+ * lower dentry which has data (and not metacopy dentry). This helper
|
|
|
+ * returns the lower data dentry.
|
|
|
+ */
|
|
|
+struct dentry *ovl_dentry_lowerdata(struct dentry *dentry)
|
|
|
+{
|
|
|
+ struct ovl_entry *oe = dentry->d_fsdata;
|
|
|
+
|
|
|
+ return oe->numlower ? oe->lowerstack[oe->numlower - 1].dentry : NULL;
|
|
|
+}
|
|
|
+
|
|
|
struct dentry *ovl_dentry_real(struct dentry *dentry)
|
|
|
{
|
|
|
return ovl_dentry_upper(dentry) ?: ovl_dentry_lower(dentry);
|