Lines Matching refs:dentry
17 int ovl_setattr(struct dentry *dentry, struct iattr *attr) in ovl_setattr() argument
21 struct dentry *upperdentry; in ovl_setattr()
24 err = setattr_prepare(dentry, attr); in ovl_setattr()
28 err = ovl_want_write(dentry); in ovl_setattr()
33 struct inode *realinode = d_inode(ovl_dentry_real(dentry)); in ovl_setattr()
44 err = ovl_copy_up(dentry); in ovl_setattr()
46 err = ovl_copy_up_with_data(dentry); in ovl_setattr()
50 upperdentry = ovl_dentry_upper(dentry); in ovl_setattr()
81 old_cred = ovl_override_creds(dentry->d_sb); in ovl_setattr()
83 ovl_revert_creds(dentry->d_sb, old_cred); in ovl_setattr()
85 ovl_copyattr(upperdentry->d_inode, dentry->d_inode); in ovl_setattr()
92 ovl_drop_write(dentry); in ovl_setattr()
97 static int ovl_map_dev_ino(struct dentry *dentry, struct kstat *stat, int fsid) in ovl_map_dev_ino() argument
99 bool samefs = ovl_same_fs(dentry->d_sb); in ovl_map_dev_ino()
100 unsigned int xinobits = ovl_xino_bits(dentry->d_sb); in ovl_map_dev_ino()
109 stat->dev = dentry->d_sb->s_dev; in ovl_map_dev_ino()
123 stat->dev = dentry->d_sb->s_dev; in ovl_map_dev_ino()
125 } else if (ovl_xino_warn(dentry->d_sb)) { in ovl_map_dev_ino()
127 dentry, stat->ino, xinobits); in ovl_map_dev_ino()
132 if (S_ISDIR(dentry->d_inode->i_mode)) { in ovl_map_dev_ino()
142 stat->dev = dentry->d_sb->s_dev; in ovl_map_dev_ino()
143 stat->ino = dentry->d_inode->i_ino; in ovl_map_dev_ino()
151 stat->dev = OVL_FS(dentry->d_sb)->fs[fsid].pseudo_dev; in ovl_map_dev_ino()
160 struct dentry *dentry = path->dentry; in ovl_getattr() local
164 bool is_dir = S_ISDIR(dentry->d_inode->i_mode); in ovl_getattr()
169 metacopy_blocks = ovl_is_metacopy_dentry(dentry); in ovl_getattr()
171 type = ovl_path_real(dentry, &realpath); in ovl_getattr()
172 old_cred = ovl_override_creds(dentry->d_sb); in ovl_getattr()
186 if (!is_dir || ovl_same_dev(dentry->d_sb)) { in ovl_getattr()
188 fsid = ovl_layer_lower(dentry)->fsid; in ovl_getattr()
194 ovl_path_lower(dentry, &realpath); in ovl_getattr()
215 if (ovl_test_flag(OVL_INDEX, d_inode(dentry)) || in ovl_getattr()
216 (!ovl_verify_lower(dentry->d_sb) && in ovl_getattr()
218 fsid = ovl_layer_lower(dentry)->fsid; in ovl_getattr()
230 realpath.dentry == ovl_dentry_lowerdata(dentry)) { in ovl_getattr()
244 ovl_path_lowerdata(dentry, &realpath); in ovl_getattr()
253 err = ovl_map_dev_ino(dentry, stat, fsid); in ovl_getattr()
271 if (!is_dir && ovl_test_flag(OVL_INDEX, d_inode(dentry))) in ovl_getattr()
272 stat->nlink = dentry->d_inode->i_nlink; in ovl_getattr()
275 ovl_revert_creds(dentry->d_sb, old_cred); in ovl_getattr()
314 static const char *ovl_get_link(struct dentry *dentry, in ovl_get_link() argument
321 if (!dentry) in ovl_get_link()
324 old_cred = ovl_override_creds(dentry->d_sb); in ovl_get_link()
325 p = vfs_get_link(ovl_dentry_real(dentry), done); in ovl_get_link()
326 ovl_revert_creds(dentry->d_sb, old_cred); in ovl_get_link()
336 int ovl_xattr_set(struct dentry *dentry, struct inode *inode, const char *name, in ovl_xattr_set() argument
340 struct dentry *upperdentry = ovl_i_dentry_upper(inode); in ovl_xattr_set()
341 struct dentry *realdentry = upperdentry ?: ovl_dentry_lower(dentry); in ovl_xattr_set()
344 err = ovl_want_write(dentry); in ovl_xattr_set()
349 old_cred = ovl_override_creds(dentry->d_sb); in ovl_xattr_set()
357 err = ovl_copy_up(dentry); in ovl_xattr_set()
361 realdentry = ovl_dentry_upper(dentry); in ovl_xattr_set()
364 old_cred = ovl_override_creds(dentry->d_sb); in ovl_xattr_set()
371 ovl_revert_creds(dentry->d_sb, old_cred); in ovl_xattr_set()
377 ovl_drop_write(dentry); in ovl_xattr_set()
382 int ovl_xattr_get(struct dentry *dentry, struct inode *inode, const char *name, in ovl_xattr_get() argument
387 struct dentry *realdentry = in ovl_xattr_get()
388 ovl_i_dentry_upper(inode) ?: ovl_dentry_lower(dentry); in ovl_xattr_get()
390 old_cred = ovl_override_creds(dentry->d_sb); in ovl_xattr_get()
393 ovl_revert_creds(dentry->d_sb, old_cred); in ovl_xattr_get()
411 ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size) in ovl_listxattr() argument
413 struct dentry *realdentry = ovl_dentry_real(dentry); in ovl_listxattr()
419 old_cred = ovl_override_creds(dentry->d_sb); in ovl_listxattr()
421 ovl_revert_creds(dentry->d_sb, old_cred); in ovl_listxattr()
434 if (!ovl_can_list(dentry->d_sb, s)) { in ovl_listxattr()
467 .dentry = ovl_upperdentry_dereference(OVL_I(inode)), in ovl_update_time()
470 if (upperpath.dentry) { in ovl_update_time()
472 inode->i_atime = d_inode(upperpath.dentry)->i_atime; in ovl_update_time()
640 if (oip->lowerpath && oip->lowerpath->dentry) in ovl_inode_init()
641 OVL_I(inode)->lower = igrab(d_inode(oip->lowerpath->dentry)); in ovl_inode_init()
717 static int ovl_set_nlink_common(struct dentry *dentry, in ovl_set_nlink_common() argument
718 struct dentry *realdentry, const char *format) in ovl_set_nlink_common()
720 struct inode *inode = d_inode(dentry); in ovl_set_nlink_common()
731 return ovl_do_setxattr(OVL_FS(inode->i_sb), ovl_dentry_upper(dentry), in ovl_set_nlink_common()
735 int ovl_set_nlink_upper(struct dentry *dentry) in ovl_set_nlink_upper() argument
737 return ovl_set_nlink_common(dentry, ovl_dentry_upper(dentry), "U%+i"); in ovl_set_nlink_upper()
740 int ovl_set_nlink_lower(struct dentry *dentry) in ovl_set_nlink_lower() argument
742 return ovl_set_nlink_common(dentry, ovl_dentry_lower(dentry), "L%+i"); in ovl_set_nlink_lower()
745 unsigned int ovl_get_nlink(struct ovl_fs *ofs, struct dentry *lowerdentry, in ovl_get_nlink()
746 struct dentry *upperdentry, in ovl_get_nlink()
807 static bool ovl_verify_inode(struct inode *inode, struct dentry *lowerdentry, in ovl_verify_inode()
808 struct dentry *upperdentry, bool strict) in ovl_verify_inode()
845 struct inode *ovl_lookup_inode(struct super_block *sb, struct dentry *real, in ovl_lookup_inode()
863 bool ovl_lookup_trap_inode(struct super_block *sb, struct dentry *dir) in ovl_lookup_trap_inode()
885 struct inode *ovl_get_trap_inode(struct super_block *sb, struct dentry *dir) in ovl_get_trap_inode()
914 static bool ovl_hash_bylower(struct super_block *sb, struct dentry *upper, in ovl_hash_bylower()
915 struct dentry *lower, bool index) in ovl_hash_bylower()
957 struct dentry *upperdentry = oip->upperdentry; in ovl_get_inode()
961 struct dentry *lowerdentry = lowerpath ? lowerpath->dentry : NULL; in ovl_get_inode()