Lines Matching +full:dout +full:- +full:default
1 // SPDX-License-Identifier: GPL-2.0-only
55 const struct ceph_fsid *fsid = &fsc->client->fsid; in ceph_fscache_register_fs()
56 const char *fscache_uniq = fsc->mount_options->fscache_uniq; in ceph_fscache_register_fs()
63 if (memcmp(&ent->fsid, fsid, sizeof(*fsid))) in ceph_fscache_register_fs()
65 if (ent->uniq_len != uniq_len) in ceph_fscache_register_fs()
67 if (uniq_len && memcmp(ent->uniquifier, fscache_uniq, uniq_len)) in ceph_fscache_register_fs()
72 err = -EBUSY; in ceph_fscache_register_fs()
78 err = -ENOMEM; in ceph_fscache_register_fs()
82 memcpy(&ent->fsid, fsid, sizeof(*fsid)); in ceph_fscache_register_fs()
84 memcpy(&ent->uniquifier, fscache_uniq, uniq_len); in ceph_fscache_register_fs()
85 ent->uniq_len = uniq_len; in ceph_fscache_register_fs()
88 fsc->fscache = fscache_acquire_cookie(ceph_cache_netfs.primary_index, in ceph_fscache_register_fs()
90 &ent->fsid, sizeof(ent->fsid) + uniq_len, in ceph_fscache_register_fs()
94 if (fsc->fscache) { in ceph_fscache_register_fs()
95 ent->fscache = fsc->fscache; in ceph_fscache_register_fs()
96 list_add_tail(&ent->list, &ceph_fscache_list); in ceph_fscache_register_fs()
114 struct inode* inode = &ci->vfs_inode; in ceph_fscache_inode_check_aux()
121 aux.version = ci->i_version; in ceph_fscache_inode_check_aux()
122 aux.mtime_sec = inode->i_mtime.tv_sec; in ceph_fscache_inode_check_aux()
123 aux.mtime_nsec = inode->i_mtime.tv_nsec; in ceph_fscache_inode_check_aux()
128 dout("ceph inode 0x%p cached okay\n", ci); in ceph_fscache_inode_check_aux()
145 if (!fsc->fscache) in ceph_fscache_register_inode_cookie()
149 if (!S_ISREG(inode->i_mode)) in ceph_fscache_register_inode_cookie()
153 if (!ci->fscache) { in ceph_fscache_register_inode_cookie()
155 aux.version = ci->i_version; in ceph_fscache_register_inode_cookie()
156 aux.mtime_sec = inode->i_mtime.tv_sec; in ceph_fscache_register_inode_cookie()
157 aux.mtime_nsec = inode->i_mtime.tv_nsec; in ceph_fscache_register_inode_cookie()
158 ci->fscache = fscache_acquire_cookie(fsc->fscache, in ceph_fscache_register_inode_cookie()
160 &ci->i_vino, sizeof(ci->i_vino), in ceph_fscache_register_inode_cookie()
171 if ((cookie = ci->fscache) == NULL) in ceph_fscache_unregister_inode_cookie()
174 ci->fscache = NULL; in ceph_fscache_unregister_inode_cookie()
176 fscache_uncache_all_inode_pages(cookie, &ci->vfs_inode); in ceph_fscache_unregister_inode_cookie()
177 fscache_relinquish_cookie(cookie, &ci->i_vino, false); in ceph_fscache_unregister_inode_cookie()
190 if (!fscache_cookie_valid(ci->fscache)) in ceph_fscache_file_set_cookie()
194 dout("fscache_file_set_cookie %p %p disabling cache\n", in ceph_fscache_file_set_cookie()
196 fscache_disable_cookie(ci->fscache, &ci->i_vino, false); in ceph_fscache_file_set_cookie()
197 fscache_uncache_all_inode_pages(ci->fscache, inode); in ceph_fscache_file_set_cookie()
199 fscache_enable_cookie(ci->fscache, &ci->i_vino, i_size_read(inode), in ceph_fscache_file_set_cookie()
201 if (fscache_cookie_enabled(ci->fscache)) { in ceph_fscache_file_set_cookie()
202 dout("fscache_file_set_cookie %p %p enabling cache\n", in ceph_fscache_file_set_cookie()
218 return ci->i_fscache_gen == ci->i_rdcache_gen; in cache_valid()
233 return -ENOBUFS; in ceph_readpage_from_fscache()
235 ret = fscache_read_or_alloc_page(ci->fscache, page, in ceph_readpage_from_fscache()
241 dout("page read submitted\n"); in ceph_readpage_from_fscache()
243 case -ENOBUFS: /* Pages were not found, and can't be */ in ceph_readpage_from_fscache()
244 case -ENODATA: /* Pages were not found */ in ceph_readpage_from_fscache()
245 dout("page/inode not in cache\n"); in ceph_readpage_from_fscache()
247 default: in ceph_readpage_from_fscache()
248 dout("%s: unknown error ret = %i\n", __func__, ret); in ceph_readpage_from_fscache()
262 return -ENOBUFS; in ceph_readpages_from_fscache()
264 ret = fscache_read_or_alloc_pages(ci->fscache, mapping, pages, nr_pages, in ceph_readpages_from_fscache()
270 dout("all-page read submitted\n"); in ceph_readpages_from_fscache()
272 case -ENOBUFS: /* Some pages were not found, and can't be */ in ceph_readpages_from_fscache()
273 case -ENODATA: /* some pages were not found */ in ceph_readpages_from_fscache()
274 dout("page/inode not in cache\n"); in ceph_readpages_from_fscache()
276 default: in ceph_readpages_from_fscache()
277 dout("%s: unknown error ret = %i\n", __func__, ret); in ceph_readpages_from_fscache()
293 ret = fscache_write_page(ci->fscache, page, i_size_read(inode), in ceph_readpage_to_fscache()
296 fscache_uncache_page(ci->fscache, page); in ceph_readpage_to_fscache()
306 fscache_wait_on_page_write(ci->fscache, page); in ceph_invalidate_fscache_page()
307 fscache_uncache_page(ci->fscache, page); in ceph_invalidate_fscache_page()
312 if (fscache_cookie_valid(fsc->fscache)) { in ceph_fscache_unregister_fs()
318 if (ent->fscache == fsc->fscache) { in ceph_fscache_unregister_fs()
319 list_del(&ent->list); in ceph_fscache_unregister_fs()
328 __fscache_relinquish_cookie(fsc->fscache, NULL, false); in ceph_fscache_unregister_fs()
330 fsc->fscache = NULL; in ceph_fscache_unregister_fs()
343 mutex_lock(&ci->i_truncate_mutex); in ceph_fscache_revalidate_cookie()
345 if (fscache_check_consistency(ci->fscache, &ci->i_vino)) in ceph_fscache_revalidate_cookie()
346 fscache_invalidate(ci->fscache); in ceph_fscache_revalidate_cookie()
347 spin_lock(&ci->i_ceph_lock); in ceph_fscache_revalidate_cookie()
348 ci->i_fscache_gen = ci->i_rdcache_gen; in ceph_fscache_revalidate_cookie()
349 spin_unlock(&ci->i_ceph_lock); in ceph_fscache_revalidate_cookie()
351 mutex_unlock(&ci->i_truncate_mutex); in ceph_fscache_revalidate_cookie()