Lines Matching refs:dentry

39 static struct dentry *lock_parent(struct dentry *dentry)  in lock_parent()  argument
41 struct dentry *dir; in lock_parent()
43 dir = dget_parent(dentry); in lock_parent()
48 static void unlock_dir(struct dentry *dir) in unlock_dir()
131 static int ecryptfs_interpose(struct dentry *lower_dentry, in ecryptfs_interpose()
132 struct dentry *dentry, struct super_block *sb) in ecryptfs_interpose() argument
138 d_instantiate(dentry, inode); in ecryptfs_interpose()
143 static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry, in ecryptfs_do_unlink() argument
146 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_do_unlink()
148 struct dentry *lower_dir_dentry; in ecryptfs_do_unlink()
161 d_drop(dentry); in ecryptfs_do_unlink()
182 struct dentry *ecryptfs_dentry, umode_t mode) in ecryptfs_do_create()
185 struct dentry *lower_dentry; in ecryptfs_do_create()
186 struct dentry *lower_dir_dentry; in ecryptfs_do_create()
219 int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry, in ecryptfs_initialize_file()
265 ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry, in ecryptfs_create()
296 static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode) in ecryptfs_i_size_read() argument
301 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_i_size_read()
306 dentry, rc); in ecryptfs_i_size_read()
318 rc = ecryptfs_read_and_validate_xattr_region(dentry, inode); in ecryptfs_i_size_read()
330 static int ecryptfs_lookup_interpose(struct dentry *dentry, in ecryptfs_lookup_interpose() argument
331 struct dentry *lower_dentry, in ecryptfs_lookup_interpose()
348 lower_mnt = mntget(ecryptfs_dentry_to_lower_mnt(dentry->d_parent)); in ecryptfs_lookup_interpose()
352 ecryptfs_set_dentry_private(dentry, dentry_info); in ecryptfs_lookup_interpose()
354 dentry_info->lower_path.dentry = lower_dentry; in ecryptfs_lookup_interpose()
358 d_add(dentry, NULL); in ecryptfs_lookup_interpose()
368 rc = ecryptfs_i_size_read(dentry, inode); in ecryptfs_lookup_interpose()
377 d_add(dentry, inode); in ecryptfs_lookup_interpose()
391 static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, in ecryptfs_lookup()
392 struct dentry *ecryptfs_dentry, in ecryptfs_lookup()
398 struct dentry *lower_dir_dentry, *lower_dentry; in ecryptfs_lookup()
451 static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir, in ecryptfs_link()
452 struct dentry *new_dentry) in ecryptfs_link()
454 struct dentry *lower_old_dentry; in ecryptfs_link()
455 struct dentry *lower_new_dentry; in ecryptfs_link()
456 struct dentry *lower_dir_dentry; in ecryptfs_link()
485 static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) in ecryptfs_unlink() argument
487 return ecryptfs_do_unlink(dir, dentry, d_inode(dentry)); in ecryptfs_unlink()
490 static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry, in ecryptfs_symlink() argument
494 struct dentry *lower_dentry; in ecryptfs_symlink()
495 struct dentry *lower_dir_dentry; in ecryptfs_symlink()
500 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_symlink()
517 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_symlink()
525 if (d_really_is_negative(dentry)) in ecryptfs_symlink()
526 d_drop(dentry); in ecryptfs_symlink()
530 static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in ecryptfs_mkdir() argument
533 struct dentry *lower_dentry; in ecryptfs_mkdir()
534 struct dentry *lower_dir_dentry; in ecryptfs_mkdir()
536 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mkdir()
541 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mkdir()
549 if (d_really_is_negative(dentry)) in ecryptfs_mkdir()
550 d_drop(dentry); in ecryptfs_mkdir()
554 static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) in ecryptfs_rmdir() argument
556 struct dentry *lower_dentry; in ecryptfs_rmdir()
557 struct dentry *lower_dir_dentry; in ecryptfs_rmdir()
560 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_rmdir()
561 dget(dentry); in ecryptfs_rmdir()
566 if (!rc && d_really_is_positive(dentry)) in ecryptfs_rmdir()
567 clear_nlink(d_inode(dentry)); in ecryptfs_rmdir()
572 d_drop(dentry); in ecryptfs_rmdir()
573 dput(dentry); in ecryptfs_rmdir()
578 ecryptfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) in ecryptfs_mknod() argument
581 struct dentry *lower_dentry; in ecryptfs_mknod()
582 struct dentry *lower_dir_dentry; in ecryptfs_mknod()
584 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mknod()
589 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mknod()
596 if (d_really_is_negative(dentry)) in ecryptfs_mknod()
597 d_drop(dentry); in ecryptfs_mknod()
602 ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry, in ecryptfs_rename()
603 struct inode *new_dir, struct dentry *new_dentry) in ecryptfs_rename()
606 struct dentry *lower_old_dentry; in ecryptfs_rename()
607 struct dentry *lower_new_dentry; in ecryptfs_rename()
608 struct dentry *lower_old_dir_dentry; in ecryptfs_rename()
609 struct dentry *lower_new_dir_dentry; in ecryptfs_rename()
610 struct dentry *trap = NULL; in ecryptfs_rename()
651 static char *ecryptfs_readlink_lower(struct dentry *dentry, size_t *bufsiz) in ecryptfs_readlink_lower() argument
653 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_readlink_lower()
670 rc = ecryptfs_decode_and_decrypt_filename(&buf, bufsiz, dentry->d_sb, in ecryptfs_readlink_lower()
677 static const char *ecryptfs_follow_link(struct dentry *dentry, void **cookie) in ecryptfs_follow_link() argument
680 char *buf = ecryptfs_readlink_lower(dentry, &len); in ecryptfs_follow_link()
683 fsstack_copy_attr_atime(d_inode(dentry), in ecryptfs_follow_link()
684 d_inode(ecryptfs_dentry_to_lower(dentry))); in ecryptfs_follow_link()
734 static int truncate_upper(struct dentry *dentry, struct iattr *ia, in truncate_upper() argument
738 struct inode *inode = d_inode(dentry); in truncate_upper()
748 rc = ecryptfs_get_lower_file(dentry, inode); in truncate_upper()
751 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in truncate_upper()
852 int ecryptfs_truncate(struct dentry *dentry, loff_t new_length) in ecryptfs_truncate() argument
858 rc = ecryptfs_inode_newsize_ok(d_inode(dentry), new_length); in ecryptfs_truncate()
862 rc = truncate_upper(dentry, &ia, &lower_ia); in ecryptfs_truncate()
864 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_truncate()
891 static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) in ecryptfs_setattr() argument
894 struct dentry *lower_dentry; in ecryptfs_setattr()
900 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in ecryptfs_setattr()
903 inode = d_inode(dentry); in ecryptfs_setattr()
905 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setattr()
907 if (d_is_dir(dentry)) in ecryptfs_setattr()
909 else if (d_is_reg(dentry) in ecryptfs_setattr()
915 dentry->d_sb)->mount_crypt_stat; in ecryptfs_setattr()
916 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_setattr()
921 rc = ecryptfs_read_metadata(dentry); in ecryptfs_setattr()
955 rc = truncate_upper(dentry, ia, &lower_ia); in ecryptfs_setattr()
975 static int ecryptfs_getattr_link(struct vfsmount *mnt, struct dentry *dentry, in ecryptfs_getattr_link() argument
982 dentry->d_sb)->mount_crypt_stat; in ecryptfs_getattr_link()
983 generic_fillattr(d_inode(dentry), stat); in ecryptfs_getattr_link()
988 target = ecryptfs_readlink_lower(dentry, &targetsiz); in ecryptfs_getattr_link()
999 static int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, in ecryptfs_getattr() argument
1005 rc = vfs_getattr(ecryptfs_dentry_to_lower_path(dentry), &lower_stat); in ecryptfs_getattr()
1007 fsstack_copy_attr_all(d_inode(dentry), in ecryptfs_getattr()
1008 ecryptfs_inode_to_lower(d_inode(dentry))); in ecryptfs_getattr()
1009 generic_fillattr(d_inode(dentry), stat); in ecryptfs_getattr()
1016 ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, in ecryptfs_setxattr() argument
1020 struct dentry *lower_dentry; in ecryptfs_setxattr()
1022 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setxattr()
1029 if (!rc && d_really_is_positive(dentry)) in ecryptfs_setxattr()
1030 fsstack_copy_attr_all(d_inode(dentry), d_inode(lower_dentry)); in ecryptfs_setxattr()
1036 ecryptfs_getxattr_lower(struct dentry *lower_dentry, const char *name, in ecryptfs_getxattr_lower()
1054 ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value, in ecryptfs_getxattr() argument
1057 return ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), name, in ecryptfs_getxattr()
1062 ecryptfs_listxattr(struct dentry *dentry, char *list, size_t size) in ecryptfs_listxattr() argument
1065 struct dentry *lower_dentry; in ecryptfs_listxattr()
1067 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_listxattr()
1079 static int ecryptfs_removexattr(struct dentry *dentry, const char *name) in ecryptfs_removexattr() argument
1082 struct dentry *lower_dentry; in ecryptfs_removexattr()
1084 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_removexattr()