Lines Matching refs:dentry

19 static int ovl_encode_maybe_copy_up(struct dentry *dentry)  in ovl_encode_maybe_copy_up()  argument
23 if (ovl_dentry_upper(dentry)) in ovl_encode_maybe_copy_up()
26 err = ovl_copy_up(dentry); in ovl_encode_maybe_copy_up()
29 dentry, err); in ovl_encode_maybe_copy_up()
72 static int ovl_connectable_layer(struct dentry *dentry) in ovl_connectable_layer() argument
74 struct ovl_entry *oe = OVL_E(dentry); in ovl_connectable_layer()
77 if (dentry == dentry->d_sb->s_root) in ovl_connectable_layer()
84 if (ovl_dentry_upper(dentry) && in ovl_connectable_layer()
85 !ovl_test_flag(OVL_INDEX, d_inode(dentry))) in ovl_connectable_layer()
100 static int ovl_connect_layer(struct dentry *dentry) in ovl_connect_layer() argument
102 struct dentry *next, *parent = NULL; in ovl_connect_layer()
103 struct ovl_entry *oe = OVL_E(dentry); in ovl_connect_layer()
107 if (WARN_ON(dentry == dentry->d_sb->s_root) || in ovl_connect_layer()
108 WARN_ON(!ovl_dentry_lower(dentry))) in ovl_connect_layer()
112 if (ovl_dentry_test_flag(OVL_E_CONNECTED, dentry)) in ovl_connect_layer()
116 next = dget(dentry); in ovl_connect_layer()
146 ovl_dentry_set_flag(OVL_E_CONNECTED, dentry); in ovl_connect_layer()
183 struct dentry *dentry; in ovl_check_encode_origin() local
221 dentry = d_find_any_alias(inode); in ovl_check_encode_origin()
222 if (!dentry) in ovl_check_encode_origin()
225 err = ovl_connect_layer(dentry); in ovl_check_encode_origin()
226 dput(dentry); in ovl_check_encode_origin()
294 static struct dentry *ovl_obtain_alias(struct super_block *sb, in ovl_obtain_alias()
295 struct dentry *upper_alias, in ovl_obtain_alias()
297 struct dentry *index) in ovl_obtain_alias()
299 struct dentry *lower = lowerpath ? lowerpath->dentry : NULL; in ovl_obtain_alias()
300 struct dentry *upper = upper_alias ?: index; in ovl_obtain_alias()
317 ovl_lowerstack(oe)->dentry = dget(lower); in ovl_obtain_alias()
335 static struct dentry *ovl_dentry_real_at(struct dentry *dentry, int idx) in ovl_dentry_real_at() argument
337 struct ovl_entry *oe = OVL_E(dentry); in ovl_dentry_real_at()
342 return ovl_dentry_upper(dentry); in ovl_dentry_real_at()
346 return lowerstack[i].dentry; in ovl_dentry_real_at()
358 static struct dentry *ovl_lookup_real_one(struct dentry *connected, in ovl_lookup_real_one()
359 struct dentry *real, in ovl_lookup_real_one()
363 struct dentry *this, *parent = NULL; in ovl_lookup_real_one()
417 static struct dentry *ovl_lookup_real(struct super_block *sb,
418 struct dentry *real,
424 static struct dentry *ovl_lookup_real_inode(struct super_block *sb, in ovl_lookup_real_inode()
425 struct dentry *real, in ovl_lookup_real_inode()
429 struct dentry *index = NULL; in ovl_lookup_real_inode()
430 struct dentry *this = NULL; in ovl_lookup_real_inode()
457 struct dentry *upper = ovl_index_upper(ofs, index, true); in ovl_lookup_real_inode()
489 static struct dentry *ovl_lookup_real_ancestor(struct super_block *sb, in ovl_lookup_real_ancestor()
490 struct dentry *real, in ovl_lookup_real_ancestor()
493 struct dentry *next, *parent = NULL; in ovl_lookup_real_ancestor()
494 struct dentry *ancestor = ERR_PTR(-EIO); in ovl_lookup_real_ancestor()
542 static struct dentry *ovl_lookup_real(struct super_block *sb, in ovl_lookup_real()
543 struct dentry *real, in ovl_lookup_real()
546 struct dentry *connected; in ovl_lookup_real()
554 struct dentry *next, *this; in ovl_lookup_real()
555 struct dentry *parent = NULL; in ovl_lookup_real()
556 struct dentry *real_connected = ovl_dentry_real_at(connected, in ovl_lookup_real()
644 static struct dentry *ovl_get_dentry(struct super_block *sb, in ovl_get_dentry()
645 struct dentry *upper, in ovl_get_dentry()
647 struct dentry *index) in ovl_get_dentry()
651 struct dentry *real = upper ?: (index ?: lowerpath->dentry); in ovl_get_dentry()
671 static struct dentry *ovl_upper_fh_to_d(struct super_block *sb, in ovl_upper_fh_to_d()
675 struct dentry *dentry; in ovl_upper_fh_to_d() local
676 struct dentry *upper; in ovl_upper_fh_to_d()
685 dentry = ovl_get_dentry(sb, upper, NULL, NULL); in ovl_upper_fh_to_d()
688 return dentry; in ovl_upper_fh_to_d()
691 static struct dentry *ovl_lower_fh_to_d(struct super_block *sb, in ovl_lower_fh_to_d()
697 struct dentry *dentry = NULL; in ovl_lower_fh_to_d() local
698 struct dentry *index = NULL; in ovl_lower_fh_to_d()
707 if (!d_is_dir(origin.dentry) || in ovl_lower_fh_to_d()
708 !(origin.dentry->d_flags & DCACHE_DISCONNECTED)) { in ovl_lower_fh_to_d()
709 inode = ovl_lookup_inode(sb, origin.dentry, false); in ovl_lower_fh_to_d()
714 dentry = d_find_any_alias(inode); in ovl_lower_fh_to_d()
716 if (dentry) in ovl_lower_fh_to_d()
733 struct dentry *upper = ovl_index_upper(ofs, index, true); in ovl_lower_fh_to_d()
739 dentry = ovl_get_dentry(sb, upper, NULL, NULL); in ovl_lower_fh_to_d()
745 if (d_is_dir(origin.dentry)) { in ovl_lower_fh_to_d()
746 dput(origin.dentry); in ovl_lower_fh_to_d()
747 origin.dentry = NULL; in ovl_lower_fh_to_d()
753 err = ovl_verify_origin(ofs, index, origin.dentry, false); in ovl_lower_fh_to_d()
759 dentry = ovl_get_dentry(sb, NULL, &origin, index); in ovl_lower_fh_to_d()
762 dput(origin.dentry); in ovl_lower_fh_to_d()
764 return dentry; in ovl_lower_fh_to_d()
767 dentry = ERR_PTR(err); in ovl_lower_fh_to_d()
794 static struct dentry *ovl_fh_to_dentry(struct super_block *sb, struct fid *fid, in ovl_fh_to_dentry()
797 struct dentry *dentry = NULL; in ovl_fh_to_dentry() local
813 dentry = (flags & OVL_FH_FLAG_PATH_UPPER) ? in ovl_fh_to_dentry()
816 err = PTR_ERR(dentry); in ovl_fh_to_dentry()
817 if (IS_ERR(dentry) && err != -ESTALE) in ovl_fh_to_dentry()
825 return dentry; in ovl_fh_to_dentry()
830 dentry = ERR_PTR(err); in ovl_fh_to_dentry()
834 static struct dentry *ovl_fh_to_parent(struct super_block *sb, struct fid *fid, in ovl_fh_to_parent()
841 static int ovl_get_name(struct dentry *parent, char *name, in ovl_get_name()
842 struct dentry *child) in ovl_get_name()
852 static struct dentry *ovl_get_parent(struct dentry *dentry) in ovl_get_parent() argument