Lines Matching refs:dir

132 	struct inode *dir = d_inode(parent);  in __dcache_find_get_entry()  local
138 if (ptr_pos >= i_size_read(dir)) in __dcache_find_get_entry()
143 cache_ctl->page = find_lock_page(&dir->i_data, ptr_pgoff); in __dcache_find_get_entry()
160 if (ceph_dir_is_complete_ordered(dir) && ptr_pos < i_size_read(dir)) in __dcache_find_get_entry()
187 struct inode *dir = d_inode(parent); in __dcache_readdir() local
194 dout("__dcache_readdir %p v%u at %llx\n", dir, (unsigned)shared_gen, ctx->pos); in __dcache_readdir()
198 u64 count = div_u64(i_size_read(dir), sizeof(struct dentry *)); in __dcache_readdir()
224 dout("__dcache_readdir %p cache idx %llu\n", dir, idx); in __dcache_readdir()
247 fscrypt_has_encryption_key(dir))) { in __dcache_readdir()
771 static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry, in ceph_lookup() argument
774 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dir->i_sb); in ceph_lookup()
775 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_lookup()
782 dir, dentry, dentry); in ceph_lookup()
787 if (IS_ENCRYPTED(dir)) { in ceph_lookup()
788 bool had_key = fscrypt_has_encryption_key(dir); in ceph_lookup()
790 err = fscrypt_prepare_lookup_partial(dir, dentry); in ceph_lookup()
795 if (!had_key && fscrypt_has_encryption_key(dir)) in ceph_lookup()
796 ceph_dir_clear_complete(dir); in ceph_lookup()
801 struct ceph_inode_info *ci = ceph_inode(dir); in ceph_lookup()
805 dout(" dir %p flags are 0x%lx\n", dir, ci->i_ceph_flags); in ceph_lookup()
809 !is_root_ceph_dentry(dir, dentry) && in ceph_lookup()
815 dout(" dir %p complete, -ENOENT\n", dir); in ceph_lookup()
823 op = ceph_snap(dir) == CEPH_SNAPDIR ? in ceph_lookup()
832 if (ceph_security_xattr_wanted(dir)) in ceph_lookup()
836 ihold(dir); in ceph_lookup()
837 req->r_parent = dir; in ceph_lookup()
861 int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry) in ceph_handle_notrace_create() argument
863 struct dentry *result = ceph_lookup(dir, dentry, 0); in ceph_handle_notrace_create()
884 static int ceph_mknod(struct mnt_idmap *idmap, struct inode *dir, in ceph_mknod() argument
887 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_mknod()
892 if (ceph_snap(dir) != CEPH_NOSNAP) in ceph_mknod()
899 if (ceph_quota_is_max_files_exceeded(dir)) { in ceph_mknod()
905 dir, dentry, mode, rdev); in ceph_mknod()
912 req->r_new_inode = ceph_new_inode(dir, dentry, &mode, &as_ctx); in ceph_mknod()
919 if (S_ISREG(mode) && IS_ENCRYPTED(dir)) in ceph_mknod()
924 req->r_parent = dir; in ceph_mknod()
925 ihold(dir); in ceph_mknod()
935 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_mknod()
937 err = ceph_handle_notrace_create(dir, dentry); in ceph_mknod()
949 static int ceph_create(struct mnt_idmap *idmap, struct inode *dir, in ceph_create() argument
952 return ceph_mknod(idmap, dir, dentry, mode, 0); in ceph_create()
992 static int ceph_symlink(struct mnt_idmap *idmap, struct inode *dir, in ceph_symlink() argument
995 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_symlink()
1001 if (ceph_snap(dir) != CEPH_NOSNAP) in ceph_symlink()
1008 if (ceph_quota_is_max_files_exceeded(dir)) { in ceph_symlink()
1013 dout("symlink in dir %p dentry %p to '%s'\n", dir, dentry, dest); in ceph_symlink()
1020 req->r_new_inode = ceph_new_inode(dir, dentry, &mode, &as_ctx); in ceph_symlink()
1027 req->r_parent = dir; in ceph_symlink()
1028 ihold(dir); in ceph_symlink()
1051 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_symlink()
1053 err = ceph_handle_notrace_create(dir, dentry); in ceph_symlink()
1063 static int ceph_mkdir(struct mnt_idmap *idmap, struct inode *dir, in ceph_mkdir() argument
1066 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_mkdir()
1076 if (ceph_snap(dir) == CEPH_SNAPDIR) { in ceph_mkdir()
1079 dout("mksnap dir %p snap '%pd' dn %p\n", dir, in ceph_mkdir()
1081 } else if (ceph_snap(dir) == CEPH_NOSNAP) { in ceph_mkdir()
1082 dout("mkdir dir %p dn %p mode 0%ho\n", dir, dentry, mode); in ceph_mkdir()
1090 ceph_quota_is_max_files_exceeded(dir)) { in ceph_mkdir()
1094 if ((op == CEPH_MDS_OP_MKSNAP) && IS_ENCRYPTED(dir) && in ceph_mkdir()
1095 !fscrypt_has_encryption_key(dir)) { in ceph_mkdir()
1108 req->r_new_inode = ceph_new_inode(dir, dentry, &mode, &as_ctx); in ceph_mkdir()
1117 req->r_parent = dir; in ceph_mkdir()
1118 ihold(dir); in ceph_mkdir()
1127 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_mkdir()
1131 err = ceph_handle_notrace_create(dir, dentry); in ceph_mkdir()
1143 static int ceph_link(struct dentry *old_dentry, struct inode *dir, in ceph_link() argument
1146 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_link()
1157 if (ceph_snap(dir) != CEPH_NOSNAP) in ceph_link()
1160 err = fscrypt_prepare_link(old_dentry, dir, dentry); in ceph_link()
1165 dir, ceph_vinop(dir), old_dentry, old_dentry, dentry, dentry); in ceph_link()
1180 req->r_parent = dir; in ceph_link()
1181 ihold(dir); in ceph_link()
1187 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_link()
1252 static int get_caps_for_async_unlink(struct inode *dir, struct dentry *dentry) in get_caps_for_async_unlink() argument
1254 struct ceph_inode_info *ci = ceph_inode(dir); in get_caps_for_async_unlink()
1291 static int ceph_unlink(struct inode *dir, struct dentry *dentry) in ceph_unlink() argument
1293 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dir->i_sb); in ceph_unlink()
1301 if (ceph_snap(dir) == CEPH_SNAPDIR) { in ceph_unlink()
1303 dout("rmsnap dir %p '%pd' dn %p\n", dir, dentry, dentry); in ceph_unlink()
1305 } else if (ceph_snap(dir) == CEPH_NOSNAP) { in ceph_unlink()
1307 dir, dentry, inode); in ceph_unlink()
1320 req->r_parent = dir; in ceph_unlink()
1321 ihold(dir); in ceph_unlink()
1327 (req->r_dir_caps = get_caps_for_async_unlink(dir, dentry))) { in ceph_unlink()
1330 dout("async unlink on %llu/%.*s caps=%s", ceph_ino(dir), in ceph_unlink()
1347 err = ceph_mdsc_submit_request(mdsc, dir, req); in ceph_unlink()
1372 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_unlink()
1802 struct inode *dir; in __dir_lease_try_check() local
1811 dir = d_inode(dentry->d_parent); in __dir_lease_try_check()
1812 ci = ceph_inode(dir); in __dir_lease_try_check()
1831 static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry, in dir_lease_is_valid() argument
1834 struct ceph_inode_info *ci = ceph_inode(dir); in dir_lease_is_valid()
1849 if (dir == d_inode(dentry->d_parent) && in dir_lease_is_valid()
1857 dir, (unsigned)atomic_read(&ci->i_shared_gen), dentry, valid); in dir_lease_is_valid()
1868 struct inode *dir, *inode; in ceph_d_revalidate() local
1877 dir = d_inode_rcu(parent); in ceph_d_revalidate()
1878 if (!dir) in ceph_d_revalidate()
1883 dir = d_inode(parent); in ceph_d_revalidate()
1891 mdsc = ceph_sb_to_fs_client(dir->i_sb)->mdsc; in ceph_d_revalidate()
1894 if (ceph_snap(dir) != CEPH_NOSNAP) { in ceph_d_revalidate()
1904 if (valid || dir_lease_is_valid(dir, dentry, mdsc)) { in ceph_d_revalidate()
1922 op = ceph_snap(dir) == CEPH_SNAPDIR ? in ceph_d_revalidate()
1928 req->r_parent = dir; in ceph_d_revalidate()
1929 ihold(dir); in ceph_d_revalidate()
1932 if (ceph_security_xattr_wanted(dir)) in ceph_d_revalidate()
1960 ceph_dir_clear_complete(dir); in ceph_d_revalidate()
2111 unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn) in ceph_dentry_hash() argument
2113 struct ceph_inode_info *dci = ceph_inode(dir); in ceph_dentry_hash()