Lines Matching refs:dentry
24 static struct dentry *lock_parent(struct dentry *dentry) in lock_parent() argument
26 struct dentry *dir; in lock_parent()
28 dir = dget_parent(dentry); in lock_parent()
33 static void unlock_dir(struct dentry *dir) in unlock_dir()
115 static int ecryptfs_interpose(struct dentry *lower_dentry, in ecryptfs_interpose()
116 struct dentry *dentry, struct super_block *sb) in ecryptfs_interpose() argument
122 d_instantiate(dentry, inode); in ecryptfs_interpose()
127 static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry, in ecryptfs_do_unlink() argument
130 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_do_unlink()
131 struct dentry *lower_dir_dentry; in ecryptfs_do_unlink()
135 lower_dir_dentry = ecryptfs_dentry_to_lower(dentry->d_parent); in ecryptfs_do_unlink()
156 d_drop(dentry); in ecryptfs_do_unlink()
174 struct dentry *ecryptfs_dentry, umode_t mode) in ecryptfs_do_create()
177 struct dentry *lower_dentry; in ecryptfs_do_create()
178 struct dentry *lower_dir_dentry; in ecryptfs_do_create()
211 int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry, in ecryptfs_initialize_file()
257 ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry, in ecryptfs_create()
285 static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode) in ecryptfs_i_size_read() argument
290 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_i_size_read()
295 dentry, rc); in ecryptfs_i_size_read()
307 rc = ecryptfs_read_and_validate_xattr_region(dentry, inode); in ecryptfs_i_size_read()
319 static struct dentry *ecryptfs_lookup_interpose(struct dentry *dentry, in ecryptfs_lookup_interpose() argument
320 struct dentry *lower_dentry) in ecryptfs_lookup_interpose()
322 struct path *path = ecryptfs_dentry_to_lower_path(dentry->d_parent); in ecryptfs_lookup_interpose()
333 fsstack_copy_attr_atime(d_inode(dentry->d_parent), in ecryptfs_lookup_interpose()
334 d_inode(path->dentry)); in ecryptfs_lookup_interpose()
337 ecryptfs_set_dentry_private(dentry, dentry_info); in ecryptfs_lookup_interpose()
339 dentry_info->lower_path.dentry = lower_dentry; in ecryptfs_lookup_interpose()
351 d_add(dentry, NULL); in ecryptfs_lookup_interpose()
354 inode = __ecryptfs_get_inode(lower_inode, dentry->d_sb); in ecryptfs_lookup_interpose()
361 rc = ecryptfs_i_size_read(dentry, inode); in ecryptfs_lookup_interpose()
370 return d_splice_alias(inode, dentry); in ecryptfs_lookup_interpose()
382 static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, in ecryptfs_lookup()
383 struct dentry *ecryptfs_dentry, in ecryptfs_lookup()
388 struct dentry *lower_dir_dentry, *lower_dentry; in ecryptfs_lookup()
391 struct dentry *res; in ecryptfs_lookup()
424 static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir, in ecryptfs_link()
425 struct dentry *new_dentry) in ecryptfs_link()
427 struct dentry *lower_old_dentry; in ecryptfs_link()
428 struct dentry *lower_new_dentry; in ecryptfs_link()
429 struct dentry *lower_dir_dentry; in ecryptfs_link()
458 static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) in ecryptfs_unlink() argument
460 return ecryptfs_do_unlink(dir, dentry, d_inode(dentry)); in ecryptfs_unlink()
463 static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry, in ecryptfs_symlink() argument
467 struct dentry *lower_dentry; in ecryptfs_symlink()
468 struct dentry *lower_dir_dentry; in ecryptfs_symlink()
473 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_symlink()
489 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_symlink()
497 if (d_really_is_negative(dentry)) in ecryptfs_symlink()
498 d_drop(dentry); in ecryptfs_symlink()
502 static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in ecryptfs_mkdir() argument
505 struct dentry *lower_dentry; in ecryptfs_mkdir()
506 struct dentry *lower_dir_dentry; in ecryptfs_mkdir()
508 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mkdir()
513 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mkdir()
521 if (d_really_is_negative(dentry)) in ecryptfs_mkdir()
522 d_drop(dentry); in ecryptfs_mkdir()
526 static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) in ecryptfs_rmdir() argument
528 struct dentry *lower_dentry; in ecryptfs_rmdir()
529 struct dentry *lower_dir_dentry; in ecryptfs_rmdir()
533 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_rmdir()
534 lower_dir_dentry = ecryptfs_dentry_to_lower(dentry->d_parent); in ecryptfs_rmdir()
546 clear_nlink(d_inode(dentry)); in ecryptfs_rmdir()
553 d_drop(dentry); in ecryptfs_rmdir()
558 ecryptfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) in ecryptfs_mknod() argument
561 struct dentry *lower_dentry; in ecryptfs_mknod()
562 struct dentry *lower_dir_dentry; in ecryptfs_mknod()
564 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mknod()
569 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mknod()
576 if (d_really_is_negative(dentry)) in ecryptfs_mknod()
577 d_drop(dentry); in ecryptfs_mknod()
582 ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry, in ecryptfs_rename()
583 struct inode *new_dir, struct dentry *new_dentry, in ecryptfs_rename()
587 struct dentry *lower_old_dentry; in ecryptfs_rename()
588 struct dentry *lower_new_dentry; in ecryptfs_rename()
589 struct dentry *lower_old_dir_dentry; in ecryptfs_rename()
590 struct dentry *lower_new_dir_dentry; in ecryptfs_rename()
591 struct dentry *trap; in ecryptfs_rename()
639 static char *ecryptfs_readlink_lower(struct dentry *dentry, size_t *bufsiz) in ecryptfs_readlink_lower() argument
642 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_readlink_lower()
651 rc = ecryptfs_decode_and_decrypt_filename(&buf, bufsiz, dentry->d_sb, in ecryptfs_readlink_lower()
660 static const char *ecryptfs_get_link(struct dentry *dentry, in ecryptfs_get_link() argument
667 if (!dentry) in ecryptfs_get_link()
670 buf = ecryptfs_readlink_lower(dentry, &len); in ecryptfs_get_link()
673 fsstack_copy_attr_atime(d_inode(dentry), in ecryptfs_get_link()
674 d_inode(ecryptfs_dentry_to_lower(dentry))); in ecryptfs_get_link()
725 static int truncate_upper(struct dentry *dentry, struct iattr *ia, in truncate_upper() argument
729 struct inode *inode = d_inode(dentry); in truncate_upper()
739 rc = ecryptfs_get_lower_file(dentry, inode); in truncate_upper()
742 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in truncate_upper()
843 int ecryptfs_truncate(struct dentry *dentry, loff_t new_length) in ecryptfs_truncate() argument
849 rc = ecryptfs_inode_newsize_ok(d_inode(dentry), new_length); in ecryptfs_truncate()
853 rc = truncate_upper(dentry, &ia, &lower_ia); in ecryptfs_truncate()
855 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_truncate()
882 static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) in ecryptfs_setattr() argument
885 struct dentry *lower_dentry; in ecryptfs_setattr()
891 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in ecryptfs_setattr()
897 inode = d_inode(dentry); in ecryptfs_setattr()
899 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setattr()
901 if (d_is_dir(dentry)) in ecryptfs_setattr()
903 else if (d_is_reg(dentry) in ecryptfs_setattr()
909 dentry->d_sb)->mount_crypt_stat; in ecryptfs_setattr()
910 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_setattr()
915 rc = ecryptfs_read_metadata(dentry); in ecryptfs_setattr()
936 rc = setattr_prepare(dentry, ia); in ecryptfs_setattr()
949 rc = truncate_upper(dentry, ia, &lower_ia); in ecryptfs_setattr()
972 struct dentry *dentry = path->dentry; in ecryptfs_getattr_link() local
977 dentry->d_sb)->mount_crypt_stat; in ecryptfs_getattr_link()
978 generic_fillattr(d_inode(dentry), stat); in ecryptfs_getattr_link()
983 target = ecryptfs_readlink_lower(dentry, &targetsiz); in ecryptfs_getattr_link()
997 struct dentry *dentry = path->dentry; in ecryptfs_getattr() local
1001 rc = vfs_getattr(ecryptfs_dentry_to_lower_path(dentry), &lower_stat, in ecryptfs_getattr()
1004 fsstack_copy_attr_all(d_inode(dentry), in ecryptfs_getattr()
1005 ecryptfs_inode_to_lower(d_inode(dentry))); in ecryptfs_getattr()
1006 generic_fillattr(d_inode(dentry), stat); in ecryptfs_getattr()
1013 ecryptfs_setxattr(struct dentry *dentry, struct inode *inode, in ecryptfs_setxattr() argument
1018 struct dentry *lower_dentry; in ecryptfs_setxattr()
1020 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setxattr()
1033 ecryptfs_getxattr_lower(struct dentry *lower_dentry, struct inode *lower_inode, in ecryptfs_getxattr_lower()
1051 ecryptfs_getxattr(struct dentry *dentry, struct inode *inode, in ecryptfs_getxattr() argument
1054 return ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), in ecryptfs_getxattr()
1060 ecryptfs_listxattr(struct dentry *dentry, char *list, size_t size) in ecryptfs_listxattr() argument
1063 struct dentry *lower_dentry; in ecryptfs_listxattr()
1065 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_listxattr()
1077 static int ecryptfs_removexattr(struct dentry *dentry, struct inode *inode, in ecryptfs_removexattr() argument
1081 struct dentry *lower_dentry; in ecryptfs_removexattr()
1084 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_removexattr()
1128 struct dentry *dentry, struct inode *inode, in ecryptfs_xattr_get() argument
1132 return ecryptfs_getxattr(dentry, inode, name, buffer, size); in ecryptfs_xattr_get()
1136 struct dentry *dentry, struct inode *inode, in ecryptfs_xattr_set() argument
1141 return ecryptfs_setxattr(dentry, inode, name, value, size, flags); in ecryptfs_xattr_set()
1144 return ecryptfs_removexattr(dentry, inode, name); in ecryptfs_xattr_set()