Lines Matching full:dir
109 * regardless of what dir changes take place on the
134 struct inode *dir = d_inode(parent); in __dcache_find_get_entry() local
135 struct ceph_client *cl = ceph_inode_to_client(dir); in __dcache_find_get_entry()
141 if (ptr_pos >= i_size_read(dir)) in __dcache_find_get_entry()
146 cache_ctl->folio = filemap_lock_folio(&dir->i_data, ptr_pgoff); in __dcache_find_get_entry()
164 if (ceph_dir_is_complete_ordered(dir) && ptr_pos < i_size_read(dir)) in __dcache_find_get_entry()
179 * falling back to a "normal" sync readdir if any dentries in the dir
182 * Complete dir indicates that we have all dentries in the dir. It is
191 struct inode *dir = d_inode(parent); in __dcache_readdir() local
192 struct ceph_fs_client *fsc = ceph_inode_to_fs_client(dir); in __dcache_readdir()
193 struct ceph_client *cl = ceph_inode_to_client(dir); in __dcache_readdir()
200 doutc(cl, "%p %llx.%llx v%u at %llx\n", dir, ceph_vinop(dir), in __dcache_readdir()
205 u64 count = div_u64(i_size_read(dir), sizeof(struct dentry *)); in __dcache_readdir()
231 doutc(cl, "%p %llx.%llx cache idx %llu\n", dir, in __dcache_readdir()
232 ceph_vinop(dir), idx); in __dcache_readdir()
255 fscrypt_has_encryption_key(dir))) { in __dcache_readdir()
486 /* preclude from marking dir ordered */ in ceph_readdir()
490 /* note dir version at start of readdir so in ceph_readdir()
500 /* preclude from marking dir complete */ in ceph_readdir()
607 * if dir_release_count still matches the dir, no dentries in ceph_readdir()
609 * the complete dir contents in our cache. in ceph_readdir()
729 /* .snap dir? */ in ceph_handle_snapdir()
793 * Look up a single dir entry. If there is a lookup intent, inform
796 static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry, in ceph_lookup() argument
799 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dir->i_sb); in ceph_lookup()
800 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_lookup()
807 doutc(cl, "%p %llx.%llx/'%pd' dentry %p\n", dir, ceph_vinop(dir), in ceph_lookup()
813 if (IS_ENCRYPTED(dir)) { in ceph_lookup()
814 bool had_key = fscrypt_has_encryption_key(dir); in ceph_lookup()
816 err = fscrypt_prepare_lookup_partial(dir, dentry); in ceph_lookup()
821 if (!had_key && fscrypt_has_encryption_key(dir)) in ceph_lookup()
822 ceph_dir_clear_complete(dir); in ceph_lookup()
827 struct ceph_inode_info *ci = ceph_inode(dir); in ceph_lookup()
831 doutc(cl, " dir %llx.%llx flags are 0x%lx\n", in ceph_lookup()
832 ceph_vinop(dir), ci->i_ceph_flags); in ceph_lookup()
836 !is_root_ceph_dentry(dir, dentry) && in ceph_lookup()
842 doutc(cl, " dir %llx.%llx complete, -ENOENT\n", in ceph_lookup()
843 ceph_vinop(dir)); in ceph_lookup()
852 op = ceph_snap(dir) == CEPH_SNAPDIR ? in ceph_lookup()
861 if (ceph_security_xattr_wanted(dir)) in ceph_lookup()
865 ihold(dir); in ceph_lookup()
866 req->r_parent = dir; in ceph_lookup()
890 int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry) in ceph_handle_notrace_create() argument
892 struct dentry *result = ceph_lookup(dir, dentry, 0); in ceph_handle_notrace_create()
913 static int ceph_mknod(struct mnt_idmap *idmap, struct inode *dir, in ceph_mknod() argument
916 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_mknod()
922 if (ceph_snap(dir) != CEPH_NOSNAP) in ceph_mknod()
929 if (ceph_quota_is_max_files_exceeded(dir)) { in ceph_mknod()
935 dir, ceph_vinop(dir), dentry, dentry, mode, rdev); in ceph_mknod()
942 req->r_new_inode = ceph_new_inode(dir, dentry, &mode, &as_ctx); in ceph_mknod()
949 if (S_ISREG(mode) && IS_ENCRYPTED(dir)) in ceph_mknod()
954 req->r_parent = dir; in ceph_mknod()
955 ihold(dir); in ceph_mknod()
966 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_mknod()
968 err = ceph_handle_notrace_create(dir, dentry); in ceph_mknod()
980 static int ceph_create(struct mnt_idmap *idmap, struct inode *dir, in ceph_create() argument
983 return ceph_mknod(idmap, dir, dentry, mode, 0); in ceph_create()
1024 static int ceph_symlink(struct mnt_idmap *idmap, struct inode *dir, in ceph_symlink() argument
1027 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_symlink()
1034 if (ceph_snap(dir) != CEPH_NOSNAP) in ceph_symlink()
1041 if (ceph_quota_is_max_files_exceeded(dir)) { in ceph_symlink()
1046 doutc(cl, "%p %llx.%llx/'%pd' to '%s'\n", dir, ceph_vinop(dir), dentry, in ceph_symlink()
1054 req->r_new_inode = ceph_new_inode(dir, dentry, &mode, &as_ctx); in ceph_symlink()
1061 req->r_parent = dir; in ceph_symlink()
1062 ihold(dir); in ceph_symlink()
1086 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_symlink()
1088 err = ceph_handle_notrace_create(dir, dentry); in ceph_symlink()
1098 static struct dentry *ceph_mkdir(struct mnt_idmap *idmap, struct inode *dir, in ceph_mkdir() argument
1101 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_mkdir()
1113 if (ceph_snap(dir) == CEPH_SNAPDIR) { in ceph_mkdir()
1117 ceph_vinop(dir), dentry, dentry); in ceph_mkdir()
1118 } else if (ceph_snap(dir) == CEPH_NOSNAP) { in ceph_mkdir()
1120 ceph_vinop(dir), dentry, dentry, mode); in ceph_mkdir()
1128 ceph_quota_is_max_files_exceeded(dir)) { in ceph_mkdir()
1132 if ((op == CEPH_MDS_OP_MKSNAP) && IS_ENCRYPTED(dir) && in ceph_mkdir()
1133 !fscrypt_has_encryption_key(dir)) { in ceph_mkdir()
1146 req->r_new_inode = ceph_new_inode(dir, dentry, &mode, &as_ctx); in ceph_mkdir()
1155 req->r_parent = dir; in ceph_mkdir()
1156 ihold(dir); in ceph_mkdir()
1167 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_mkdir()
1171 err = ceph_handle_notrace_create(dir, dentry); in ceph_mkdir()
1190 static int ceph_link(struct dentry *old_dentry, struct inode *dir, in ceph_link() argument
1193 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_link()
1205 if (ceph_snap(dir) != CEPH_NOSNAP) in ceph_link()
1208 err = fscrypt_prepare_link(old_dentry, dir, dentry); in ceph_link()
1212 doutc(cl, "%p %llx.%llx/'%pd' to '%pd'\n", dir, ceph_vinop(dir), in ceph_link()
1228 req->r_parent = dir; in ceph_link()
1229 ihold(dir); in ceph_link()
1235 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_link()
1299 static int get_caps_for_async_unlink(struct inode *dir, struct dentry *dentry) in get_caps_for_async_unlink() argument
1301 struct ceph_inode_info *ci = ceph_inode(dir); in get_caps_for_async_unlink()
1338 static int ceph_unlink(struct inode *dir, struct dentry *dentry) in ceph_unlink() argument
1340 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dir->i_sb); in ceph_unlink()
1352 if (ceph_snap(dir) == CEPH_SNAPDIR) { in ceph_unlink()
1354 doutc(cl, "rmsnap %llx.%llx/'%pd' dn\n", ceph_vinop(dir), in ceph_unlink()
1357 } else if (ceph_snap(dir) == CEPH_NOSNAP) { in ceph_unlink()
1359 ceph_vinop(dir), dentry, ceph_vinop(inode)); in ceph_unlink()
1365 dn = d_find_alias(dir); in ceph_unlink()
1397 req->r_parent = dir; in ceph_unlink()
1398 ihold(dir); in ceph_unlink()
1404 (req->r_dir_caps = get_caps_for_async_unlink(dir, dentry))) { in ceph_unlink()
1408 ceph_vinop(dir), dentry, in ceph_unlink()
1424 err = ceph_mdsc_submit_request(mdsc, dir, req); in ceph_unlink()
1461 err = ceph_mdsc_do_request(mdsc, dir, req); in ceph_unlink()
1579 * When dir lease is used, add dentry to tail of mdsc->dentry_dir_leases
1681 /* move it into tail of dir lease list */ in __dentry_leases_walk()
1762 /* Move dentry to tail of dir lease list if we don't want in __dir_lease_check()
1770 /* invalidate dir lease */ in __dir_lease_check()
1899 struct inode *dir; in __dir_lease_try_check() local
1908 dir = d_inode(dentry->d_parent); in __dir_lease_try_check()
1909 ci = ceph_inode(dir); in __dir_lease_try_check()
1928 static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry, in dir_lease_is_valid() argument
1931 struct ceph_inode_info *ci = ceph_inode(dir); in dir_lease_is_valid()
1947 if (dir == d_inode(dentry->d_parent) && in dir_lease_is_valid()
1954 doutc(cl, "dir %p %llx.%llx v%u dentry %p '%pd' = %d\n", dir, in dir_lease_is_valid()
1955 ceph_vinop(dir), (unsigned)atomic_read(&ci->i_shared_gen), in dir_lease_is_valid()
1963 static int ceph_d_revalidate(struct inode *dir, const struct qstr *name, in ceph_d_revalidate() argument
1971 valid = fscrypt_d_revalidate(dir, name, dentry, flags); in ceph_d_revalidate()
1981 mdsc = ceph_sb_to_fs_client(dir->i_sb)->mdsc; in ceph_d_revalidate()
1984 if (ceph_snap(dir) != CEPH_NOSNAP) { in ceph_d_revalidate()
1994 if (valid || dir_lease_is_valid(dir, dentry, mdsc)) { in ceph_d_revalidate()
2012 op = ceph_snap(dir) == CEPH_SNAPDIR ? in ceph_d_revalidate()
2018 req->r_parent = dir; in ceph_d_revalidate()
2019 ihold(dir); in ceph_d_revalidate()
2024 if (ceph_security_xattr_wanted(dir)) in ceph_d_revalidate()
2052 ceph_dir_clear_complete(dir); in ceph_d_revalidate()
2146 * read() on a dir. This weird interface hack only works if mounted
2201 unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn) in ceph_dentry_hash() argument
2203 struct ceph_inode_info *dci = ceph_inode(dir); in ceph_dentry_hash()