31 cFYI(1,
"%s: (0x%p/0x%p)", __func__, server,
37 cFYI(1,
"%s: (0x%p/0x%p)", __func__, server,
39 fscache_relinquish_cookie(server->fscache, 0);
40 server->fscache =
NULL;
48 fscache_acquire_cookie(server->fscache,
50 cFYI(1,
"%s: (0x%p/0x%p)", __func__, server->fscache,
56 cFYI(1,
"%s: (0x%p)", __func__, tcon->fscache);
57 fscache_relinquish_cookie(tcon->fscache, 0);
61 static void cifs_fscache_enable_inode_cookie(
struct inode *
inode)
71 cifsi->fscache = fscache_acquire_cookie(tcon->fscache,
73 cFYI(1,
"%s: got FH cookie (0x%p/0x%p)", __func__,
74 tcon->fscache, cifsi->fscache);
83 cFYI(1,
"%s: (0x%p)", __func__, cifsi->fscache);
84 fscache_relinquish_cookie(cifsi->fscache, 0);
85 cifsi->fscache =
NULL;
89 static void cifs_fscache_disable_inode_cookie(
struct inode *inode)
94 cFYI(1,
"%s: (0x%p)", __func__, cifsi->fscache);
95 fscache_uncache_all_inode_pages(cifsi->fscache, inode);
96 fscache_relinquish_cookie(cifsi->fscache, 1);
97 cifsi->fscache =
NULL;
104 cifs_fscache_disable_inode_cookie(inode);
106 cifs_fscache_enable_inode_cookie(inode);
115 if (cifsi->fscache) {
117 fscache_relinquish_cookie(cifsi->fscache, 1);
119 cifsi->fscache = fscache_acquire_cookie(
123 cFYI(1,
"%s: new cookie 0x%p oldcookie 0x%p",
124 __func__, cifsi->fscache, old);
131 struct inode *inode = page->
mapping->host;
134 cFYI(1,
"%s: (0x%p/0x%p)", __func__, page,
136 if (!fscache_maybe_release_page(cifsi->fscache, page, gfp))
143 static void cifs_readpage_from_fscache_complete(
struct page *
page,
void *
ctx,
146 cFYI(1,
"%s: (0x%p/%d)", __func__, page, error);
148 SetPageUptodate(page);
159 cFYI(1,
"%s: (fsc:%p, p:%p, i:0x%p", __func__,
160 CIFS_I(inode)->fscache, page, inode);
161 ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page,
162 cifs_readpage_from_fscache_complete,
168 cFYI(1,
"%s: submitted", __func__);
172 cFYI(1,
"%s: %d", __func__, ret);
176 cERROR(1,
"unknown error ret = %d", ret);
191 cFYI(1,
"%s: (0x%p/%u/0x%p)", __func__,
192 CIFS_I(inode)->fscache, *nr_pages, inode);
193 ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping,
195 cifs_readpage_from_fscache_complete,
197 mapping_gfp_mask(mapping));
200 cFYI(1,
"%s: submitted", __func__);
205 cFYI(1,
"%s: no page", __func__);
209 cFYI(1,
"unknown error ret = %d", ret);
219 cFYI(1,
"%s: (fsc: %p, p: %p, i: %p)", __func__,
220 CIFS_I(inode)->fscache, page, inode);
221 ret = fscache_write_page(CIFS_I(inode)->fscache, page,
GFP_KERNEL);
223 fscache_uncache_page(CIFS_I(inode)->fscache, page);
231 cFYI(1,
"%s: (0x%p/0x%p)", __func__, page, cookie);
232 fscache_wait_on_page_write(cookie, page);
233 fscache_uncache_page(cookie, page);