Lines Matching refs:dentry

27 static struct dentry *ecryptfs_start_creating_dentry(struct dentry *dentry)  in ecryptfs_start_creating_dentry()  argument
29 struct dentry *parent = dget_parent(dentry); in ecryptfs_start_creating_dentry()
30 struct dentry *ret; in ecryptfs_start_creating_dentry()
33 ecryptfs_dentry_to_lower(dentry)); in ecryptfs_start_creating_dentry()
38 static struct dentry *ecryptfs_start_removing_dentry(struct dentry *dentry) in ecryptfs_start_removing_dentry() argument
40 struct dentry *parent = dget_parent(dentry); in ecryptfs_start_removing_dentry()
41 struct dentry *ret; in ecryptfs_start_removing_dentry()
44 ecryptfs_dentry_to_lower(dentry)); in ecryptfs_start_removing_dentry()
133 static int ecryptfs_interpose(struct dentry *lower_dentry, in ecryptfs_interpose()
134 struct dentry *dentry, struct super_block *sb) in ecryptfs_interpose() argument
140 d_instantiate(dentry, inode); in ecryptfs_interpose()
145 static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry, in ecryptfs_do_unlink() argument
148 struct dentry *lower_dentry; in ecryptfs_do_unlink()
152 lower_dentry = ecryptfs_start_removing_dentry(dentry); in ecryptfs_do_unlink()
168 d_drop(dentry); in ecryptfs_do_unlink()
186 struct dentry *ecryptfs_dentry, umode_t mode) in ecryptfs_do_create()
189 struct dentry *lower_dentry; in ecryptfs_do_create()
225 int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry, in ecryptfs_initialize_file()
270 struct inode *directory_inode, struct dentry *ecryptfs_dentry, in ecryptfs_create()
298 static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode) in ecryptfs_i_size_read() argument
303 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_i_size_read()
308 dentry, rc); in ecryptfs_i_size_read()
320 rc = ecryptfs_read_and_validate_xattr_region(dentry, inode); in ecryptfs_i_size_read()
332 static struct dentry *ecryptfs_lookup_interpose(struct dentry *dentry, in ecryptfs_lookup_interpose() argument
333 struct dentry *lower_dentry) in ecryptfs_lookup_interpose()
335 struct dentry *lower_parent = ecryptfs_dentry_to_lower(dentry->d_parent); in ecryptfs_lookup_interpose()
339 fsstack_copy_attr_atime(d_inode(dentry->d_parent), in ecryptfs_lookup_interpose()
343 ecryptfs_set_dentry_lower(dentry, lower_dentry); in ecryptfs_lookup_interpose()
355 d_add(dentry, NULL); in ecryptfs_lookup_interpose()
358 inode = __ecryptfs_get_inode(lower_inode, dentry->d_sb); in ecryptfs_lookup_interpose()
365 rc = ecryptfs_i_size_read(dentry, inode); in ecryptfs_lookup_interpose()
374 return d_splice_alias(inode, dentry); in ecryptfs_lookup_interpose()
386 static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, in ecryptfs_lookup()
387 struct dentry *ecryptfs_dentry, in ecryptfs_lookup()
392 struct dentry *lower_dir_dentry, *lower_dentry; in ecryptfs_lookup()
395 struct dentry *res; in ecryptfs_lookup()
430 static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir, in ecryptfs_link()
431 struct dentry *new_dentry) in ecryptfs_link()
433 struct dentry *lower_old_dentry; in ecryptfs_link()
434 struct dentry *lower_new_dentry; in ecryptfs_link()
462 static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) in ecryptfs_unlink() argument
464 return ecryptfs_do_unlink(dir, dentry, d_inode(dentry)); in ecryptfs_unlink()
468 struct inode *dir, struct dentry *dentry, in ecryptfs_symlink() argument
472 struct dentry *lower_dentry; in ecryptfs_symlink()
478 lower_dentry = ecryptfs_start_creating_dentry(dentry); in ecryptfs_symlink()
496 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_symlink()
503 if (d_really_is_negative(dentry)) in ecryptfs_symlink()
504 d_drop(dentry); in ecryptfs_symlink()
508 static struct dentry *ecryptfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, in ecryptfs_mkdir()
509 struct dentry *dentry, umode_t mode) in ecryptfs_mkdir() argument
512 struct dentry *lower_dentry; in ecryptfs_mkdir()
513 struct dentry *lower_dir_dentry; in ecryptfs_mkdir()
516 lower_dentry = ecryptfs_start_creating_dentry(dentry); in ecryptfs_mkdir()
529 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mkdir()
538 if (d_really_is_negative(dentry)) in ecryptfs_mkdir()
539 d_drop(dentry); in ecryptfs_mkdir()
543 static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) in ecryptfs_rmdir() argument
545 struct dentry *lower_dentry; in ecryptfs_rmdir()
549 lower_dentry = ecryptfs_start_removing_dentry(dentry); in ecryptfs_rmdir()
556 clear_nlink(d_inode(dentry)); in ecryptfs_rmdir()
562 d_drop(dentry); in ecryptfs_rmdir()
568 struct dentry *dentry, umode_t mode, dev_t dev) in ecryptfs_mknod() argument
571 struct dentry *lower_dentry; in ecryptfs_mknod()
574 lower_dentry = ecryptfs_start_creating_dentry(dentry); in ecryptfs_mknod()
582 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mknod()
589 if (d_really_is_negative(dentry)) in ecryptfs_mknod()
590 d_drop(dentry); in ecryptfs_mknod()
596 struct dentry *old_dentry, struct inode *new_dir, in ecryptfs_rename()
597 struct dentry *new_dentry, unsigned int flags) in ecryptfs_rename()
600 struct dentry *lower_old_dentry; in ecryptfs_rename()
601 struct dentry *lower_new_dentry; in ecryptfs_rename()
602 struct dentry *lower_old_dir_dentry; in ecryptfs_rename()
603 struct dentry *lower_new_dir_dentry; 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()
887 struct dentry *dentry, struct iattr *ia) in ecryptfs_setattr() argument
890 struct dentry *lower_dentry; in ecryptfs_setattr()
896 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in ecryptfs_setattr()
899 inode = d_inode(dentry); in ecryptfs_setattr()
901 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setattr()
903 if (d_is_dir(dentry)) in ecryptfs_setattr()
905 else if (d_is_reg(dentry) in ecryptfs_setattr()
911 dentry->d_sb)->mount_crypt_stat; in ecryptfs_setattr()
912 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_setattr()
917 rc = ecryptfs_read_metadata(dentry); in ecryptfs_setattr()
938 rc = setattr_prepare(&nop_mnt_idmap, dentry, ia); in ecryptfs_setattr()
951 rc = truncate_upper(dentry, ia, &lower_ia); in ecryptfs_setattr()
975 struct dentry *dentry = path->dentry; in ecryptfs_getattr_link() local
980 dentry->d_sb)->mount_crypt_stat; in ecryptfs_getattr_link()
981 generic_fillattr(&nop_mnt_idmap, request_mask, d_inode(dentry), stat); in ecryptfs_getattr_link()
986 target = ecryptfs_readlink_lower(dentry, &targetsiz); in ecryptfs_getattr_link()
1001 struct dentry *dentry = path->dentry; in ecryptfs_getattr() local
1003 struct path lower_path = ecryptfs_lower_path(dentry); in ecryptfs_getattr()
1008 fsstack_copy_attr_all(d_inode(dentry), in ecryptfs_getattr()
1009 ecryptfs_inode_to_lower(d_inode(dentry))); in ecryptfs_getattr()
1011 d_inode(dentry), stat); in ecryptfs_getattr()
1018 ecryptfs_setxattr(struct dentry *dentry, struct inode *inode, in ecryptfs_setxattr() argument
1023 struct dentry *lower_dentry; in ecryptfs_setxattr()
1026 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setxattr()
1042 ecryptfs_getxattr_lower(struct dentry *lower_dentry, struct inode *lower_inode, in ecryptfs_getxattr_lower()
1059 ecryptfs_getxattr(struct dentry *dentry, struct inode *inode, in ecryptfs_getxattr() argument
1062 return ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), in ecryptfs_getxattr()
1068 ecryptfs_listxattr(struct dentry *dentry, char *list, size_t size) in ecryptfs_listxattr() argument
1071 struct dentry *lower_dentry; in ecryptfs_listxattr()
1073 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_listxattr()
1085 static int ecryptfs_removexattr(struct dentry *dentry, struct inode *inode, in ecryptfs_removexattr() argument
1089 struct dentry *lower_dentry; in ecryptfs_removexattr()
1092 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_removexattr()
1105 static int ecryptfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa) in ecryptfs_fileattr_get() argument
1107 return vfs_fileattr_get(ecryptfs_dentry_to_lower(dentry), fa); in ecryptfs_fileattr_get()
1111 struct dentry *dentry, struct file_kattr *fa) in ecryptfs_fileattr_set() argument
1113 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_fileattr_set()
1117 fsstack_copy_attr_all(d_inode(dentry), d_inode(lower_dentry)); in ecryptfs_fileattr_set()
1123 struct dentry *dentry, int type) in ecryptfs_get_acl() argument
1125 return vfs_get_acl(idmap, ecryptfs_dentry_to_lower(dentry), in ecryptfs_get_acl()
1130 struct dentry *dentry, struct posix_acl *acl, in ecryptfs_set_acl() argument
1134 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_set_acl()
1140 fsstack_copy_attr_all(d_inode(dentry), lower_inode); in ecryptfs_set_acl()
1183 struct dentry *dentry, struct inode *inode, in ecryptfs_xattr_get() argument
1186 return ecryptfs_getxattr(dentry, inode, name, buffer, size); in ecryptfs_xattr_get()
1191 struct dentry *dentry, struct inode *inode, in ecryptfs_xattr_set() argument
1196 return ecryptfs_setxattr(dentry, inode, name, value, size, flags); in ecryptfs_xattr_set()
1199 return ecryptfs_removexattr(dentry, inode, name); in ecryptfs_xattr_set()