Lines Matching refs:dentry

27 static int lock_parent(struct dentry *dentry,  in lock_parent()  argument
28 struct dentry **lower_dentry, in lock_parent()
31 struct dentry *lower_dir_dentry; in lock_parent()
33 lower_dir_dentry = ecryptfs_dentry_to_lower(dentry->d_parent); in lock_parent()
35 *lower_dentry = ecryptfs_dentry_to_lower(dentry); in lock_parent()
125 static int ecryptfs_interpose(struct dentry *lower_dentry, in ecryptfs_interpose()
126 struct dentry *dentry, struct super_block *sb) in ecryptfs_interpose() argument
132 d_instantiate(dentry, inode); in ecryptfs_interpose()
137 static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry, in ecryptfs_do_unlink() argument
140 struct dentry *lower_dentry; in ecryptfs_do_unlink()
144 rc = lock_parent(dentry, &lower_dentry, &lower_dir); in ecryptfs_do_unlink()
164 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()
220 int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry, in ecryptfs_initialize_file()
265 struct inode *directory_inode, struct dentry *ecryptfs_dentry, in ecryptfs_create()
293 static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode) in ecryptfs_i_size_read() argument
298 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_i_size_read()
303 dentry, rc); in ecryptfs_i_size_read()
315 rc = ecryptfs_read_and_validate_xattr_region(dentry, inode); in ecryptfs_i_size_read()
327 static struct dentry *ecryptfs_lookup_interpose(struct dentry *dentry, in ecryptfs_lookup_interpose() argument
328 struct dentry *lower_dentry) in ecryptfs_lookup_interpose()
330 const struct path *path = ecryptfs_dentry_to_lower_path(dentry->d_parent); in ecryptfs_lookup_interpose()
341 fsstack_copy_attr_atime(d_inode(dentry->d_parent), in ecryptfs_lookup_interpose()
342 d_inode(path->dentry)); in ecryptfs_lookup_interpose()
345 ecryptfs_set_dentry_private(dentry, dentry_info); in ecryptfs_lookup_interpose()
347 dentry_info->lower_path.dentry = lower_dentry; in ecryptfs_lookup_interpose()
359 d_add(dentry, NULL); in ecryptfs_lookup_interpose()
362 inode = __ecryptfs_get_inode(lower_inode, dentry->d_sb); in ecryptfs_lookup_interpose()
369 rc = ecryptfs_i_size_read(dentry, inode); in ecryptfs_lookup_interpose()
378 return d_splice_alias(inode, dentry); in ecryptfs_lookup_interpose()
390 static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, in ecryptfs_lookup()
391 struct dentry *ecryptfs_dentry, in ecryptfs_lookup()
396 struct dentry *lower_dir_dentry, *lower_dentry; in ecryptfs_lookup()
399 struct dentry *res; in ecryptfs_lookup()
434 static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir, in ecryptfs_link()
435 struct dentry *new_dentry) in ecryptfs_link()
437 struct dentry *lower_old_dentry; in ecryptfs_link()
438 struct dentry *lower_new_dentry; in ecryptfs_link()
464 static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) in ecryptfs_unlink() argument
466 return ecryptfs_do_unlink(dir, dentry, d_inode(dentry)); in ecryptfs_unlink()
470 struct inode *dir, struct dentry *dentry, in ecryptfs_symlink() argument
474 struct dentry *lower_dentry; in ecryptfs_symlink()
480 rc = lock_parent(dentry, &lower_dentry, &lower_dir); 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()
515 rc = lock_parent(dentry, &lower_dentry, &lower_dir); in ecryptfs_mkdir()
527 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mkdir()
535 if (d_really_is_negative(dentry)) in ecryptfs_mkdir()
536 d_drop(dentry); in ecryptfs_mkdir()
540 static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) in ecryptfs_rmdir() argument
542 struct dentry *lower_dentry; in ecryptfs_rmdir()
546 rc = lock_parent(dentry, &lower_dentry, &lower_dir); in ecryptfs_rmdir()
555 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 rc = lock_parent(dentry, &lower_dentry, &lower_dir); in ecryptfs_mknod()
580 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mknod()
587 if (d_really_is_negative(dentry)) in ecryptfs_mknod()
588 d_drop(dentry); in ecryptfs_mknod()
594 struct dentry *old_dentry, struct inode *new_dir, in ecryptfs_rename()
595 struct dentry *new_dentry, unsigned int flags) in ecryptfs_rename()
598 struct dentry *lower_old_dentry; in ecryptfs_rename()
599 struct dentry *lower_new_dentry; in ecryptfs_rename()
600 struct dentry *lower_old_dir_dentry; in ecryptfs_rename()
601 struct dentry *lower_new_dir_dentry; in ecryptfs_rename()
602 struct dentry *trap; in ecryptfs_rename()
658 static char *ecryptfs_readlink_lower(struct dentry *dentry, size_t *bufsiz) in ecryptfs_readlink_lower() argument
661 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()
679 static const char *ecryptfs_get_link(struct dentry *dentry, in ecryptfs_get_link() argument
686 if (!dentry) in ecryptfs_get_link()
689 buf = ecryptfs_readlink_lower(dentry, &len); in ecryptfs_get_link()
692 fsstack_copy_attr_atime(d_inode(dentry), in ecryptfs_get_link()
693 d_inode(ecryptfs_dentry_to_lower(dentry))); in ecryptfs_get_link()
744 static int truncate_upper(struct dentry *dentry, struct iattr *ia, in truncate_upper() argument
748 struct inode *inode = d_inode(dentry); in truncate_upper()
758 rc = ecryptfs_get_lower_file(dentry, inode); in truncate_upper()
761 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in truncate_upper()
862 int ecryptfs_truncate(struct dentry *dentry, loff_t new_length) in ecryptfs_truncate() argument
868 rc = ecryptfs_inode_newsize_ok(d_inode(dentry), new_length); in ecryptfs_truncate()
872 rc = truncate_upper(dentry, &ia, &lower_ia); in ecryptfs_truncate()
874 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_truncate()
906 struct dentry *dentry, struct iattr *ia) in ecryptfs_setattr() argument
909 struct dentry *lower_dentry; in ecryptfs_setattr()
915 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in ecryptfs_setattr()
921 inode = d_inode(dentry); in ecryptfs_setattr()
923 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setattr()
925 if (d_is_dir(dentry)) in ecryptfs_setattr()
927 else if (d_is_reg(dentry) in ecryptfs_setattr()
933 dentry->d_sb)->mount_crypt_stat; in ecryptfs_setattr()
934 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_setattr()
939 rc = ecryptfs_read_metadata(dentry); in ecryptfs_setattr()
960 rc = setattr_prepare(&nop_mnt_idmap, dentry, ia); in ecryptfs_setattr()
973 rc = truncate_upper(dentry, ia, &lower_ia); in ecryptfs_setattr()
997 struct dentry *dentry = path->dentry; in ecryptfs_getattr_link() local
1002 dentry->d_sb)->mount_crypt_stat; in ecryptfs_getattr_link()
1003 generic_fillattr(&nop_mnt_idmap, request_mask, d_inode(dentry), stat); in ecryptfs_getattr_link()
1008 target = ecryptfs_readlink_lower(dentry, &targetsiz); in ecryptfs_getattr_link()
1023 struct dentry *dentry = path->dentry; in ecryptfs_getattr() local
1027 rc = vfs_getattr_nosec(ecryptfs_dentry_to_lower_path(dentry), in ecryptfs_getattr()
1030 fsstack_copy_attr_all(d_inode(dentry), in ecryptfs_getattr()
1031 ecryptfs_inode_to_lower(d_inode(dentry))); in ecryptfs_getattr()
1033 d_inode(dentry), stat); in ecryptfs_getattr()
1040 ecryptfs_setxattr(struct dentry *dentry, struct inode *inode, in ecryptfs_setxattr() argument
1045 struct dentry *lower_dentry; in ecryptfs_setxattr()
1048 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setxattr()
1064 ecryptfs_getxattr_lower(struct dentry *lower_dentry, struct inode *lower_inode, in ecryptfs_getxattr_lower()
1081 ecryptfs_getxattr(struct dentry *dentry, struct inode *inode, in ecryptfs_getxattr() argument
1084 return ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), in ecryptfs_getxattr()
1090 ecryptfs_listxattr(struct dentry *dentry, char *list, size_t size) in ecryptfs_listxattr() argument
1093 struct dentry *lower_dentry; in ecryptfs_listxattr()
1095 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_listxattr()
1107 static int ecryptfs_removexattr(struct dentry *dentry, struct inode *inode, in ecryptfs_removexattr() argument
1111 struct dentry *lower_dentry; in ecryptfs_removexattr()
1114 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_removexattr()
1127 static int ecryptfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa) in ecryptfs_fileattr_get() argument
1129 return vfs_fileattr_get(ecryptfs_dentry_to_lower(dentry), fa); in ecryptfs_fileattr_get()
1133 struct dentry *dentry, struct file_kattr *fa) in ecryptfs_fileattr_set() argument
1135 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_fileattr_set()
1139 fsstack_copy_attr_all(d_inode(dentry), d_inode(lower_dentry)); in ecryptfs_fileattr_set()
1145 struct dentry *dentry, int type) in ecryptfs_get_acl() argument
1147 return vfs_get_acl(idmap, ecryptfs_dentry_to_lower(dentry), in ecryptfs_get_acl()
1152 struct dentry *dentry, struct posix_acl *acl, in ecryptfs_set_acl() argument
1156 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_set_acl()
1162 fsstack_copy_attr_all(d_inode(dentry), lower_inode); in ecryptfs_set_acl()
1205 struct dentry *dentry, struct inode *inode, in ecryptfs_xattr_get() argument
1208 return ecryptfs_getxattr(dentry, inode, name, buffer, size); in ecryptfs_xattr_get()
1213 struct dentry *dentry, struct inode *inode, in ecryptfs_xattr_set() argument
1218 return ecryptfs_setxattr(dentry, inode, name, value, size, flags); in ecryptfs_xattr_set()
1221 return ecryptfs_removexattr(dentry, inode, name); in ecryptfs_xattr_set()