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()
134 static int ecryptfs_interpose(struct dentry *lower_dentry, in ecryptfs_interpose()
135 struct dentry *dentry, struct super_block *sb) in ecryptfs_interpose() argument
141 d_instantiate(dentry, inode); in ecryptfs_interpose()
146 static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry, in ecryptfs_do_unlink() argument
149 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_do_unlink()
151 struct dentry *lower_dir_dentry; in ecryptfs_do_unlink()
164 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()
190 struct dentry *lower_dir_dentry; in ecryptfs_do_create()
230 int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry, in ecryptfs_initialize_file()
277 ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry, in ecryptfs_create()
308 static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode) in ecryptfs_i_size_read() argument
313 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_i_size_read()
318 dentry->d_name.name, rc); in ecryptfs_i_size_read()
330 rc = ecryptfs_read_and_validate_xattr_region(dentry, inode); in ecryptfs_i_size_read()
342 static int ecryptfs_lookup_interpose(struct dentry *dentry, in ecryptfs_lookup_interpose() argument
343 struct dentry *lower_dentry, in ecryptfs_lookup_interpose()
351 lower_mnt = mntget(ecryptfs_dentry_to_lower_mnt(dentry->d_parent)); in ecryptfs_lookup_interpose()
356 ecryptfs_set_dentry_private(dentry, dentry_info); in ecryptfs_lookup_interpose()
363 d_drop(dentry); in ecryptfs_lookup_interpose()
366 ecryptfs_set_dentry_lower(dentry, lower_dentry); in ecryptfs_lookup_interpose()
367 ecryptfs_set_dentry_lower_mnt(dentry, lower_mnt); in ecryptfs_lookup_interpose()
371 d_add(dentry, NULL); in ecryptfs_lookup_interpose()
381 rc = ecryptfs_i_size_read(dentry, inode); in ecryptfs_lookup_interpose()
390 d_add(dentry, inode); in ecryptfs_lookup_interpose()
404 static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, in ecryptfs_lookup()
405 struct dentry *ecryptfs_dentry, in ecryptfs_lookup()
411 struct dentry *lower_dir_dentry, *lower_dentry; in ecryptfs_lookup()
473 static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir, in ecryptfs_link()
474 struct dentry *new_dentry) in ecryptfs_link()
476 struct dentry *lower_old_dentry; in ecryptfs_link()
477 struct dentry *lower_new_dentry; in ecryptfs_link()
478 struct dentry *lower_dir_dentry; in ecryptfs_link()
507 static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) in ecryptfs_unlink() argument
509 return ecryptfs_do_unlink(dir, dentry, dentry->d_inode); in ecryptfs_unlink()
512 static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry, in ecryptfs_symlink() argument
516 struct dentry *lower_dentry; in ecryptfs_symlink()
517 struct dentry *lower_dir_dentry; in ecryptfs_symlink()
522 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_symlink()
539 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_symlink()
547 if (!dentry->d_inode) in ecryptfs_symlink()
548 d_drop(dentry); in ecryptfs_symlink()
552 static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in ecryptfs_mkdir() argument
555 struct dentry *lower_dentry; in ecryptfs_mkdir()
556 struct dentry *lower_dir_dentry; in ecryptfs_mkdir()
558 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mkdir()
563 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mkdir()
571 if (!dentry->d_inode) in ecryptfs_mkdir()
572 d_drop(dentry); in ecryptfs_mkdir()
576 static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) in ecryptfs_rmdir() argument
578 struct dentry *lower_dentry; in ecryptfs_rmdir()
579 struct dentry *lower_dir_dentry; in ecryptfs_rmdir()
582 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_rmdir()
583 dget(dentry); in ecryptfs_rmdir()
588 if (!rc && dentry->d_inode) in ecryptfs_rmdir()
589 clear_nlink(dentry->d_inode); in ecryptfs_rmdir()
594 d_drop(dentry); in ecryptfs_rmdir()
595 dput(dentry); in ecryptfs_rmdir()
600 ecryptfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) in ecryptfs_mknod() argument
603 struct dentry *lower_dentry; in ecryptfs_mknod()
604 struct dentry *lower_dir_dentry; in ecryptfs_mknod()
606 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_mknod()
611 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mknod()
618 if (!dentry->d_inode) in ecryptfs_mknod()
619 d_drop(dentry); in ecryptfs_mknod()
624 ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry, in ecryptfs_rename()
625 struct inode *new_dir, struct dentry *new_dentry) in ecryptfs_rename()
628 struct dentry *lower_old_dentry; in ecryptfs_rename()
629 struct dentry *lower_new_dentry; in ecryptfs_rename()
630 struct dentry *lower_old_dir_dentry; in ecryptfs_rename()
631 struct dentry *lower_new_dir_dentry; in ecryptfs_rename()
632 struct dentry *trap = NULL; in ecryptfs_rename()
672 static int ecryptfs_readlink_lower(struct dentry *dentry, char **buf, in ecryptfs_readlink_lower() argument
675 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_readlink_lower()
695 rc = ecryptfs_decode_and_decrypt_filename(buf, bufsiz, dentry, in ecryptfs_readlink_lower()
703 ecryptfs_readlink(struct dentry *dentry, char __user *buf, int bufsiz) in ecryptfs_readlink() argument
709 rc = ecryptfs_readlink_lower(dentry, &kbuf, &kbufsiz); in ecryptfs_readlink()
715 fsstack_copy_attr_atime(dentry->d_inode, in ecryptfs_readlink()
716 ecryptfs_dentry_to_lower(dentry)->d_inode); in ecryptfs_readlink()
721 static void *ecryptfs_follow_link(struct dentry *dentry, struct nameidata *nd) in ecryptfs_follow_link() argument
735 rc = dentry->d_inode->i_op->readlink(dentry, (char __user *)buf, len); in ecryptfs_follow_link()
748 ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr) in ecryptfs_put_link() argument
802 static int truncate_upper(struct dentry *dentry, struct iattr *ia, in truncate_upper() argument
806 struct inode *inode = dentry->d_inode; in truncate_upper()
816 rc = ecryptfs_get_lower_file(dentry, inode); in truncate_upper()
819 crypt_stat = &ecryptfs_inode_to_private(dentry->d_inode)->crypt_stat; in truncate_upper()
920 int ecryptfs_truncate(struct dentry *dentry, loff_t new_length) in ecryptfs_truncate() argument
926 rc = ecryptfs_inode_newsize_ok(dentry->d_inode, new_length); in ecryptfs_truncate()
930 rc = truncate_upper(dentry, &ia, &lower_ia); in ecryptfs_truncate()
932 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_truncate()
959 static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) in ecryptfs_setattr() argument
962 struct dentry *lower_dentry; in ecryptfs_setattr()
968 crypt_stat = &ecryptfs_inode_to_private(dentry->d_inode)->crypt_stat; in ecryptfs_setattr()
971 inode = dentry->d_inode; in ecryptfs_setattr()
973 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setattr()
975 if (S_ISDIR(dentry->d_inode->i_mode)) in ecryptfs_setattr()
977 else if (S_ISREG(dentry->d_inode->i_mode) in ecryptfs_setattr()
983 dentry->d_sb)->mount_crypt_stat; in ecryptfs_setattr()
984 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_setattr()
989 rc = ecryptfs_read_metadata(dentry); in ecryptfs_setattr()
1023 rc = truncate_upper(dentry, ia, &lower_ia); in ecryptfs_setattr()
1043 int ecryptfs_getattr_link(struct vfsmount *mnt, struct dentry *dentry, in ecryptfs_getattr_link() argument
1050 dentry->d_sb)->mount_crypt_stat; in ecryptfs_getattr_link()
1051 generic_fillattr(dentry->d_inode, stat); in ecryptfs_getattr_link()
1056 rc = ecryptfs_readlink_lower(dentry, &target, &targetsiz); in ecryptfs_getattr_link()
1065 int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, in ecryptfs_getattr() argument
1071 rc = vfs_getattr(ecryptfs_dentry_to_lower_mnt(dentry), in ecryptfs_getattr()
1072 ecryptfs_dentry_to_lower(dentry), &lower_stat); in ecryptfs_getattr()
1074 fsstack_copy_attr_all(dentry->d_inode, in ecryptfs_getattr()
1075 ecryptfs_inode_to_lower(dentry->d_inode)); in ecryptfs_getattr()
1076 generic_fillattr(dentry->d_inode, stat); in ecryptfs_getattr()
1083 ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, in ecryptfs_setxattr() argument
1087 struct dentry *lower_dentry; in ecryptfs_setxattr()
1089 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_setxattr()
1097 fsstack_copy_attr_all(dentry->d_inode, lower_dentry->d_inode); in ecryptfs_setxattr()
1103 ecryptfs_getxattr_lower(struct dentry *lower_dentry, const char *name, in ecryptfs_getxattr_lower()
1121 ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value, in ecryptfs_getxattr() argument
1124 return ecryptfs_getxattr_lower(ecryptfs_dentry_to_lower(dentry), name, in ecryptfs_getxattr()
1129 ecryptfs_listxattr(struct dentry *dentry, char *list, size_t size) in ecryptfs_listxattr() argument
1132 struct dentry *lower_dentry; in ecryptfs_listxattr()
1134 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_listxattr()
1146 static int ecryptfs_removexattr(struct dentry *dentry, const char *name) in ecryptfs_removexattr() argument
1149 struct dentry *lower_dentry; in ecryptfs_removexattr()
1151 lower_dentry = ecryptfs_dentry_to_lower(dentry); in ecryptfs_removexattr()