diff options
Diffstat (limited to 'fs/overlayfs/util.c')
-rw-r--r-- | fs/overlayfs/util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 32ff67fa0bfb..7c7b95d5da1f 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c | |||
@@ -207,6 +207,19 @@ struct ovl_layer *ovl_layer_lower(struct dentry *dentry) | |||
207 | return oe->numlower ? oe->lowerstack[0].layer : NULL; | 207 | return oe->numlower ? oe->lowerstack[0].layer : NULL; |
208 | } | 208 | } |
209 | 209 | ||
210 | /* | ||
211 | * ovl_dentry_lower() could return either a data dentry or metacopy dentry | ||
212 | * dependig on what is stored in lowerstack[0]. At times we need to find | ||
213 | * lower dentry which has data (and not metacopy dentry). This helper | ||
214 | * returns the lower data dentry. | ||
215 | */ | ||
216 | struct dentry *ovl_dentry_lowerdata(struct dentry *dentry) | ||
217 | { | ||
218 | struct ovl_entry *oe = dentry->d_fsdata; | ||
219 | |||
220 | return oe->numlower ? oe->lowerstack[oe->numlower - 1].dentry : NULL; | ||
221 | } | ||
222 | |||
210 | struct dentry *ovl_dentry_real(struct dentry *dentry) | 223 | struct dentry *ovl_dentry_real(struct dentry *dentry) |
211 | { | 224 | { |
212 | return ovl_dentry_upper(dentry) ?: ovl_dentry_lower(dentry); | 225 | return ovl_dentry_upper(dentry) ?: ovl_dentry_lower(dentry); |