Lines Matching refs:ci

88 	const struct ceph_inode_info* ci = cookie_netfs_data;  in ceph_fscache_inode_get_key()  local
92 klen = sizeof(ci->i_vino); in ceph_fscache_inode_get_key()
96 memcpy(buffer, &ci->i_vino, klen); in ceph_fscache_inode_get_key()
104 const struct ceph_inode_info* ci = cookie_netfs_data; in ceph_fscache_inode_get_aux() local
105 const struct inode* inode = &ci->vfs_inode; in ceph_fscache_inode_get_aux()
119 const struct ceph_inode_info* ci = cookie_netfs_data; in ceph_fscache_inode_get_attr() local
120 const struct inode* inode = &ci->vfs_inode; in ceph_fscache_inode_get_attr()
129 struct ceph_inode_info* ci = cookie_netfs_data; in ceph_fscache_inode_check_aux() local
130 struct inode* inode = &ci->vfs_inode; in ceph_fscache_inode_check_aux()
142 dout("ceph inode 0x%p cached okay", ci); in ceph_fscache_inode_check_aux()
148 struct ceph_inode_info* ci = cookie_netfs_data; in ceph_fscache_inode_now_uncached() local
156 dout("ceph inode 0x%p now uncached", ci); in ceph_fscache_inode_now_uncached()
159 nr_pages = pagevec_lookup(&pvec, ci->vfs_inode.i_mapping, first, in ceph_fscache_inode_now_uncached()
187 struct ceph_inode_info* ci) in ceph_fscache_register_inode_cookie() argument
189 struct inode* inode = &ci->vfs_inode; in ceph_fscache_register_inode_cookie()
196 if ((ci->vfs_inode.i_mode & S_IFREG) == 0) in ceph_fscache_register_inode_cookie()
202 if (ci->fscache) in ceph_fscache_register_inode_cookie()
205 ci->fscache = fscache_acquire_cookie(fsc->fscache, in ceph_fscache_register_inode_cookie()
207 ci, true); in ceph_fscache_register_inode_cookie()
208 fscache_check_consistency(ci->fscache); in ceph_fscache_register_inode_cookie()
214 void ceph_fscache_unregister_inode_cookie(struct ceph_inode_info* ci) in ceph_fscache_unregister_inode_cookie() argument
218 if ((cookie = ci->fscache) == NULL) in ceph_fscache_unregister_inode_cookie()
221 ci->fscache = NULL; in ceph_fscache_unregister_inode_cookie()
223 fscache_uncache_all_inode_pages(cookie, &ci->vfs_inode); in ceph_fscache_unregister_inode_cookie()
241 static inline int cache_valid(struct ceph_inode_info *ci) in cache_valid() argument
243 return ((ceph_caps_issued(ci) & CEPH_CAP_FILE_CACHE) && in cache_valid()
244 (ci->i_fscache_gen == ci->i_rdcache_gen)); in cache_valid()
255 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_readpage_from_fscache() local
258 if (!cache_valid(ci)) in ceph_readpage_from_fscache()
261 ret = fscache_read_or_alloc_page(ci->fscache, page, in ceph_readpage_from_fscache()
284 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_readpages_from_fscache() local
287 if (!cache_valid(ci)) in ceph_readpages_from_fscache()
290 ret = fscache_read_or_alloc_pages(ci->fscache, mapping, pages, nr_pages, in ceph_readpages_from_fscache()
310 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_readpage_to_fscache() local
316 if (!cache_valid(ci)) in ceph_readpage_to_fscache()
319 ret = fscache_write_page(ci->fscache, page, GFP_KERNEL); in ceph_readpage_to_fscache()
321 fscache_uncache_page(ci->fscache, page); in ceph_readpage_to_fscache()
326 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_invalidate_fscache_page() local
331 fscache_wait_on_page_write(ci->fscache, page); in ceph_invalidate_fscache_page()
332 fscache_uncache_page(ci->fscache, page); in ceph_invalidate_fscache_page()
348 struct ceph_inode_info *ci = container_of(work, struct ceph_inode_info, in ceph_revalidate_work() local
350 struct inode *inode = &ci->vfs_inode; in ceph_revalidate_work()
352 spin_lock(&ci->i_ceph_lock); in ceph_revalidate_work()
353 issued = __ceph_caps_issued(ci, NULL); in ceph_revalidate_work()
354 orig_gen = ci->i_rdcache_gen; in ceph_revalidate_work()
355 spin_unlock(&ci->i_ceph_lock); in ceph_revalidate_work()
363 if (!fscache_check_consistency(ci->fscache)) in ceph_revalidate_work()
364 fscache_invalidate(ci->fscache); in ceph_revalidate_work()
366 spin_lock(&ci->i_ceph_lock); in ceph_revalidate_work()
368 if (orig_gen > ci->i_fscache_gen) { in ceph_revalidate_work()
369 ci->i_fscache_gen = orig_gen; in ceph_revalidate_work()
371 spin_unlock(&ci->i_ceph_lock); in ceph_revalidate_work()
374 iput(&ci->vfs_inode); in ceph_revalidate_work()
380 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_queue_revalidate() local
382 if (fsc->revalidate_wq == NULL || ci->fscache == NULL) in ceph_queue_revalidate()
388 &ci->i_revalidate_work)) { in ceph_queue_revalidate()
396 void ceph_fscache_inode_init(struct ceph_inode_info *ci) in ceph_fscache_inode_init() argument
398 ci->fscache = NULL; in ceph_fscache_inode_init()
400 ci->i_fscache_gen = 1; in ceph_fscache_inode_init()
401 INIT_WORK(&ci->i_revalidate_work, ceph_revalidate_work); in ceph_fscache_inode_init()