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()
183 struct dentry *ecryptfs_dentry, umode_t mode) in ecryptfs_do_create()
186 struct dentry *lower_dentry; in ecryptfs_do_create()
187 struct dentry *lower_dir_dentry; in ecryptfs_do_create()
220 int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry, in ecryptfs_initialize_file()
266 ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry, in ecryptfs_create()
297 static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode) in ecryptfs_i_size_read() argument
302 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_i_size_read()
307 dentry, rc); in ecryptfs_i_size_read()
319 rc = ecryptfs_read_and_validate_xattr_region(dentry, inode); in ecryptfs_i_size_read()
331 static int ecryptfs_lookup_interpose(struct dentry *dentry, in ecryptfs_lookup_interpose() argument
332 struct dentry *lower_dentry, in ecryptfs_lookup_interpose()
349 lower_mnt = mntget(ecryptfs_dentry_to_lower_mnt(dentry->d_parent)); in ecryptfs_lookup_interpose()
353 ecryptfs_set_dentry_private(dentry, dentry_info); in ecryptfs_lookup_interpose()
355 dentry_info->lower_path.dentry = lower_dentry; in ecryptfs_lookup_interpose()
359 d_add(dentry, NULL); in ecryptfs_lookup_interpose()
369 rc = ecryptfs_i_size_read(dentry, inode); in ecryptfs_lookup_interpose()
378 d_add(dentry, inode); in ecryptfs_lookup_interpose()
392 static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, in ecryptfs_lookup()
393 struct dentry *ecryptfs_dentry, in ecryptfs_lookup()
399 struct dentry *lower_dir_dentry, *lower_dentry; in ecryptfs_lookup()
452 static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir, in ecryptfs_link()
453 struct dentry *new_dentry) in ecryptfs_link()
455 struct dentry *lower_old_dentry; in ecryptfs_link()
456 struct dentry *lower_new_dentry; in ecryptfs_link()
457 struct dentry *lower_dir_dentry; in ecryptfs_link()
486 static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) in ecryptfs_unlink() argument
488 return ecryptfs_do_unlink(dir, dentry, d_inode(dentry)); in ecryptfs_unlink()
491 static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry, in ecryptfs_symlink() argument
495 struct dentry *lower_dentry; in ecryptfs_symlink()
496 struct dentry *lower_dir_dentry; in ecryptfs_symlink()
501 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_symlink()
518 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_symlink()
526 if (d_really_is_negative(dentry)) in ecryptfs_symlink()
527 d_drop(dentry); in ecryptfs_symlink()
531 static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in ecryptfs_mkdir() argument
534 struct dentry *lower_dentry; in ecryptfs_mkdir()
535 struct dentry *lower_dir_dentry; in ecryptfs_mkdir()
537 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mkdir()
542 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mkdir()
550 if (d_really_is_negative(dentry)) in ecryptfs_mkdir()
551 d_drop(dentry); in ecryptfs_mkdir()
555 static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) in ecryptfs_rmdir() argument
557 struct dentry *lower_dentry; in ecryptfs_rmdir()
558 struct dentry *lower_dir_dentry; in ecryptfs_rmdir()
561 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_rmdir()
562 dget(dentry); in ecryptfs_rmdir()
567 if (!rc && d_really_is_positive(dentry)) in ecryptfs_rmdir()
568 clear_nlink(d_inode(dentry)); in ecryptfs_rmdir()
573 d_drop(dentry); in ecryptfs_rmdir()
574 dput(dentry); in ecryptfs_rmdir()
579 ecryptfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) in ecryptfs_mknod() argument
582 struct dentry *lower_dentry; in ecryptfs_mknod()
583 struct dentry *lower_dir_dentry; in ecryptfs_mknod()
585 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mknod()
590 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mknod()
597 if (d_really_is_negative(dentry)) in ecryptfs_mknod()
598 d_drop(dentry); in ecryptfs_mknod()
603 ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry, in ecryptfs_rename()
604 struct inode *new_dir, struct dentry *new_dentry) in ecryptfs_rename()
607 struct dentry *lower_old_dentry; in ecryptfs_rename()
608 struct dentry *lower_new_dentry; in ecryptfs_rename()
609 struct dentry *lower_old_dir_dentry; in ecryptfs_rename()
610 struct dentry *lower_new_dir_dentry; in ecryptfs_rename()
611 struct dentry *trap = NULL; in ecryptfs_rename()
652 static char *ecryptfs_readlink_lower(struct dentry *dentry, size_t *bufsiz) in ecryptfs_readlink_lower() argument
654 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_readlink_lower()
671 rc = ecryptfs_decode_and_decrypt_filename(&buf, bufsiz, dentry->d_sb, in ecryptfs_readlink_lower()
678 static void *ecryptfs_follow_link(struct dentry *dentry, struct nameidata *nd) in ecryptfs_follow_link() argument
681 char *buf = ecryptfs_readlink_lower(dentry, &len); in ecryptfs_follow_link()
684 fsstack_copy_attr_atime(d_inode(dentry), in ecryptfs_follow_link()
685 d_inode(ecryptfs_dentry_to_lower(dentry))); in ecryptfs_follow_link()
737 static int truncate_upper(struct dentry *dentry, struct iattr *ia, in truncate_upper() argument
741 struct inode *inode = d_inode(dentry); in truncate_upper()
751 rc = ecryptfs_get_lower_file(dentry, inode); in truncate_upper()
754 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in truncate_upper()
855 int ecryptfs_truncate(struct dentry *dentry, loff_t new_length) in ecryptfs_truncate() argument
861 rc = ecryptfs_inode_newsize_ok(d_inode(dentry), new_length); in ecryptfs_truncate()
865 rc = truncate_upper(dentry, &ia, &lower_ia); in ecryptfs_truncate()
867 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_truncate()
894 static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) in ecryptfs_setattr() argument
897 struct dentry *lower_dentry; in ecryptfs_setattr()
903 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in ecryptfs_setattr()
906 inode = d_inode(dentry); in ecryptfs_setattr()
908 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setattr()
910 if (d_is_dir(dentry)) in ecryptfs_setattr()
912 else if (d_is_reg(dentry) in ecryptfs_setattr()
918 dentry->d_sb)->mount_crypt_stat; in ecryptfs_setattr()
919 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_setattr()
924 rc = ecryptfs_read_metadata(dentry); in ecryptfs_setattr()
958 rc = truncate_upper(dentry, ia, &lower_ia); in ecryptfs_setattr()
978 static int ecryptfs_getattr_link(struct vfsmount *mnt, struct dentry *dentry, in ecryptfs_getattr_link() argument
985 dentry->d_sb)->mount_crypt_stat; in ecryptfs_getattr_link()
986 generic_fillattr(d_inode(dentry), stat); in ecryptfs_getattr_link()
991 target = ecryptfs_readlink_lower(dentry, &targetsiz); in ecryptfs_getattr_link()
1002 static int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, in ecryptfs_getattr() argument
1008 rc = vfs_getattr(ecryptfs_dentry_to_lower_path(dentry), &lower_stat); in ecryptfs_getattr()
1010 fsstack_copy_attr_all(d_inode(dentry), in ecryptfs_getattr()
1011 ecryptfs_inode_to_lower(d_inode(dentry))); in ecryptfs_getattr()
1012 generic_fillattr(d_inode(dentry), stat); in ecryptfs_getattr()
1019 ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, in ecryptfs_setxattr() argument
1023 struct dentry *lower_dentry; in ecryptfs_setxattr()
1025 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setxattr()
1032 if (!rc && d_really_is_positive(dentry)) in ecryptfs_setxattr()
1033 fsstack_copy_attr_all(d_inode(dentry), d_inode(lower_dentry)); in ecryptfs_setxattr()
1039 ecryptfs_getxattr_lower(struct dentry *lower_dentry, const char *name, in ecryptfs_getxattr_lower()
1057 ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value, in ecryptfs_getxattr() argument
1060 return ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), name, in ecryptfs_getxattr()
1065 ecryptfs_listxattr(struct dentry *dentry, char *list, size_t size) in ecryptfs_listxattr() argument
1068 struct dentry *lower_dentry; in ecryptfs_listxattr()
1070 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_listxattr()
1082 static int ecryptfs_removexattr(struct dentry *dentry, const char *name) in ecryptfs_removexattr() argument
1085 struct dentry *lower_dentry; in ecryptfs_removexattr()
1087 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_removexattr()