Lines Matching refs:dentry

38 static struct dentry *lock_parent(struct dentry *dentry)  in lock_parent()  argument
40 struct dentry *dir; in lock_parent()
42 dir = dget_parent(dentry); in lock_parent()
47 static void unlock_dir(struct dentry *dir) in unlock_dir()
129 static int ecryptfs_interpose(struct dentry *lower_dentry, in ecryptfs_interpose()
130 struct dentry *dentry, struct super_block *sb) in ecryptfs_interpose() argument
136 d_instantiate(dentry, inode); in ecryptfs_interpose()
141 static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry, in ecryptfs_do_unlink() argument
144 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_do_unlink()
146 struct dentry *lower_dir_dentry; in ecryptfs_do_unlink()
159 d_drop(dentry); in ecryptfs_do_unlink()
180 struct dentry *ecryptfs_dentry, umode_t mode) in ecryptfs_do_create()
183 struct dentry *lower_dentry; in ecryptfs_do_create()
184 struct dentry *lower_dir_dentry; in ecryptfs_do_create()
217 int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry, in ecryptfs_initialize_file()
263 ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry, in ecryptfs_create()
291 static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode) in ecryptfs_i_size_read() argument
296 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_i_size_read()
301 dentry, rc); in ecryptfs_i_size_read()
313 rc = ecryptfs_read_and_validate_xattr_region(dentry, inode); in ecryptfs_i_size_read()
325 static struct dentry *ecryptfs_lookup_interpose(struct dentry *dentry, in ecryptfs_lookup_interpose() argument
326 struct dentry *lower_dentry) in ecryptfs_lookup_interpose()
339 lower_mnt = mntget(ecryptfs_dentry_to_lower_mnt(dentry->d_parent)); in ecryptfs_lookup_interpose()
340 fsstack_copy_attr_atime(d_inode(dentry->d_parent), in ecryptfs_lookup_interpose()
344 ecryptfs_set_dentry_private(dentry, dentry_info); in ecryptfs_lookup_interpose()
346 dentry_info->lower_path.dentry = lower_dentry; in ecryptfs_lookup_interpose()
350 d_add(dentry, NULL); in ecryptfs_lookup_interpose()
353 inode = __ecryptfs_get_inode(lower_inode, dentry->d_sb); in ecryptfs_lookup_interpose()
360 rc = ecryptfs_i_size_read(dentry, inode); in ecryptfs_lookup_interpose()
369 return d_splice_alias(inode, dentry); in ecryptfs_lookup_interpose()
381 static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, in ecryptfs_lookup()
382 struct dentry *ecryptfs_dentry, in ecryptfs_lookup()
387 struct dentry *lower_dir_dentry, *lower_dentry; in ecryptfs_lookup()
390 struct dentry *res; in ecryptfs_lookup()
423 static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir, in ecryptfs_link()
424 struct dentry *new_dentry) in ecryptfs_link()
426 struct dentry *lower_old_dentry; in ecryptfs_link()
427 struct dentry *lower_new_dentry; in ecryptfs_link()
428 struct dentry *lower_dir_dentry; in ecryptfs_link()
457 static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) in ecryptfs_unlink() argument
459 return ecryptfs_do_unlink(dir, dentry, d_inode(dentry)); in ecryptfs_unlink()
462 static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry, in ecryptfs_symlink() argument
466 struct dentry *lower_dentry; in ecryptfs_symlink()
467 struct dentry *lower_dir_dentry; in ecryptfs_symlink()
472 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_symlink()
488 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_symlink()
496 if (d_really_is_negative(dentry)) in ecryptfs_symlink()
497 d_drop(dentry); in ecryptfs_symlink()
501 static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in ecryptfs_mkdir() argument
504 struct dentry *lower_dentry; in ecryptfs_mkdir()
505 struct dentry *lower_dir_dentry; in ecryptfs_mkdir()
507 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mkdir()
512 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mkdir()
520 if (d_really_is_negative(dentry)) in ecryptfs_mkdir()
521 d_drop(dentry); in ecryptfs_mkdir()
525 static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) in ecryptfs_rmdir() argument
527 struct dentry *lower_dentry; in ecryptfs_rmdir()
528 struct dentry *lower_dir_dentry; in ecryptfs_rmdir()
531 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_rmdir()
532 dget(dentry); in ecryptfs_rmdir()
537 if (!rc && d_really_is_positive(dentry)) in ecryptfs_rmdir()
538 clear_nlink(d_inode(dentry)); in ecryptfs_rmdir()
543 d_drop(dentry); in ecryptfs_rmdir()
544 dput(dentry); in ecryptfs_rmdir()
549 ecryptfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) in ecryptfs_mknod() argument
552 struct dentry *lower_dentry; in ecryptfs_mknod()
553 struct dentry *lower_dir_dentry; in ecryptfs_mknod()
555 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mknod()
560 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mknod()
567 if (d_really_is_negative(dentry)) in ecryptfs_mknod()
568 d_drop(dentry); in ecryptfs_mknod()
573 ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry, in ecryptfs_rename()
574 struct inode *new_dir, struct dentry *new_dentry, in ecryptfs_rename()
578 struct dentry *lower_old_dentry; in ecryptfs_rename()
579 struct dentry *lower_new_dentry; in ecryptfs_rename()
580 struct dentry *lower_old_dir_dentry; in ecryptfs_rename()
581 struct dentry *lower_new_dir_dentry; in ecryptfs_rename()
582 struct dentry *trap = NULL; in ecryptfs_rename()
626 static char *ecryptfs_readlink_lower(struct dentry *dentry, size_t *bufsiz) in ecryptfs_readlink_lower() argument
629 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_readlink_lower()
638 rc = ecryptfs_decode_and_decrypt_filename(&buf, bufsiz, dentry->d_sb, in ecryptfs_readlink_lower()
647 static const char *ecryptfs_get_link(struct dentry *dentry, in ecryptfs_get_link() argument
654 if (!dentry) in ecryptfs_get_link()
657 buf = ecryptfs_readlink_lower(dentry, &len); in ecryptfs_get_link()
660 fsstack_copy_attr_atime(d_inode(dentry), in ecryptfs_get_link()
661 d_inode(ecryptfs_dentry_to_lower(dentry))); in ecryptfs_get_link()
712 static int truncate_upper(struct dentry *dentry, struct iattr *ia, in truncate_upper() argument
716 struct inode *inode = d_inode(dentry); in truncate_upper()
726 rc = ecryptfs_get_lower_file(dentry, inode); in truncate_upper()
729 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in truncate_upper()
830 int ecryptfs_truncate(struct dentry *dentry, loff_t new_length) in ecryptfs_truncate() argument
836 rc = ecryptfs_inode_newsize_ok(d_inode(dentry), new_length); in ecryptfs_truncate()
840 rc = truncate_upper(dentry, &ia, &lower_ia); in ecryptfs_truncate()
842 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_truncate()
869 static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) in ecryptfs_setattr() argument
872 struct dentry *lower_dentry; in ecryptfs_setattr()
878 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; in ecryptfs_setattr()
884 inode = d_inode(dentry); in ecryptfs_setattr()
886 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setattr()
888 if (d_is_dir(dentry)) in ecryptfs_setattr()
890 else if (d_is_reg(dentry) in ecryptfs_setattr()
896 dentry->d_sb)->mount_crypt_stat; in ecryptfs_setattr()
897 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_setattr()
902 rc = ecryptfs_read_metadata(dentry); in ecryptfs_setattr()
923 rc = setattr_prepare(dentry, ia); in ecryptfs_setattr()
936 rc = truncate_upper(dentry, ia, &lower_ia); in ecryptfs_setattr()
959 struct dentry *dentry = path->dentry; in ecryptfs_getattr_link() local
964 dentry->d_sb)->mount_crypt_stat; in ecryptfs_getattr_link()
965 generic_fillattr(d_inode(dentry), stat); in ecryptfs_getattr_link()
970 target = ecryptfs_readlink_lower(dentry, &targetsiz); in ecryptfs_getattr_link()
984 struct dentry *dentry = path->dentry; in ecryptfs_getattr() local
988 rc = vfs_getattr(ecryptfs_dentry_to_lower_path(dentry), &lower_stat, in ecryptfs_getattr()
991 fsstack_copy_attr_all(d_inode(dentry), in ecryptfs_getattr()
992 ecryptfs_inode_to_lower(d_inode(dentry))); in ecryptfs_getattr()
993 generic_fillattr(d_inode(dentry), stat); in ecryptfs_getattr()
1000 ecryptfs_setxattr(struct dentry *dentry, struct inode *inode, in ecryptfs_setxattr() argument
1005 struct dentry *lower_dentry; in ecryptfs_setxattr()
1007 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setxattr()
1020 ecryptfs_getxattr_lower(struct dentry *lower_dentry, struct inode *lower_inode, in ecryptfs_getxattr_lower()
1037 ecryptfs_getxattr(struct dentry *dentry, struct inode *inode, in ecryptfs_getxattr() argument
1040 return ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), in ecryptfs_getxattr()
1046 ecryptfs_listxattr(struct dentry *dentry, char *list, size_t size) in ecryptfs_listxattr() argument
1049 struct dentry *lower_dentry; in ecryptfs_listxattr()
1051 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_listxattr()
1063 static int ecryptfs_removexattr(struct dentry *dentry, struct inode *inode, in ecryptfs_removexattr() argument
1067 struct dentry *lower_dentry; in ecryptfs_removexattr()
1070 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_removexattr()
1114 struct dentry *dentry, struct inode *inode, in ecryptfs_xattr_get() argument
1117 return ecryptfs_getxattr(dentry, inode, name, buffer, size); in ecryptfs_xattr_get()
1121 struct dentry *dentry, struct inode *inode, in ecryptfs_xattr_set() argument
1126 return ecryptfs_setxattr(dentry, inode, name, value, size, flags); in ecryptfs_xattr_set()
1129 return ecryptfs_removexattr(dentry, inode, name); in ecryptfs_xattr_set()