aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p/cache.c')
-rw-r--r--fs/9p/cache.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/fs/9p/cache.c b/fs/9p/cache.c
index 945aa5f02f9b..a9ea73d6dcf3 100644
--- a/fs/9p/cache.c
+++ b/fs/9p/cache.c
@@ -62,8 +62,8 @@ static uint16_t v9fs_cache_session_get_key(const void *cookie_netfs_data,
62 uint16_t klen = 0; 62 uint16_t klen = 0;
63 63
64 v9ses = (struct v9fs_session_info *)cookie_netfs_data; 64 v9ses = (struct v9fs_session_info *)cookie_netfs_data;
65 P9_DPRINTK(P9_DEBUG_FSC, "session %p buf %p size %u", v9ses, 65 p9_debug(P9_DEBUG_FSC, "session %p buf %p size %u\n",
66 buffer, bufmax); 66 v9ses, buffer, bufmax);
67 67
68 if (v9ses->cachetag) 68 if (v9ses->cachetag)
69 klen = strlen(v9ses->cachetag); 69 klen = strlen(v9ses->cachetag);
@@ -72,7 +72,7 @@ static uint16_t v9fs_cache_session_get_key(const void *cookie_netfs_data,
72 return 0; 72 return 0;
73 73
74 memcpy(buffer, v9ses->cachetag, klen); 74 memcpy(buffer, v9ses->cachetag, klen);
75 P9_DPRINTK(P9_DEBUG_FSC, "cache session tag %s", v9ses->cachetag); 75 p9_debug(P9_DEBUG_FSC, "cache session tag %s\n", v9ses->cachetag);
76 return klen; 76 return klen;
77} 77}
78 78
@@ -91,14 +91,14 @@ void v9fs_cache_session_get_cookie(struct v9fs_session_info *v9ses)
91 v9ses->fscache = fscache_acquire_cookie(v9fs_cache_netfs.primary_index, 91 v9ses->fscache = fscache_acquire_cookie(v9fs_cache_netfs.primary_index,
92 &v9fs_cache_session_index_def, 92 &v9fs_cache_session_index_def,
93 v9ses); 93 v9ses);
94 P9_DPRINTK(P9_DEBUG_FSC, "session %p get cookie %p", v9ses, 94 p9_debug(P9_DEBUG_FSC, "session %p get cookie %p\n",
95 v9ses->fscache); 95 v9ses, v9ses->fscache);
96} 96}
97 97
98void v9fs_cache_session_put_cookie(struct v9fs_session_info *v9ses) 98void v9fs_cache_session_put_cookie(struct v9fs_session_info *v9ses)
99{ 99{
100 P9_DPRINTK(P9_DEBUG_FSC, "session %p put cookie %p", v9ses, 100 p9_debug(P9_DEBUG_FSC, "session %p put cookie %p\n",
101 v9ses->fscache); 101 v9ses, v9ses->fscache);
102 fscache_relinquish_cookie(v9ses->fscache, 0); 102 fscache_relinquish_cookie(v9ses->fscache, 0);
103 v9ses->fscache = NULL; 103 v9ses->fscache = NULL;
104} 104}
@@ -109,8 +109,8 @@ static uint16_t v9fs_cache_inode_get_key(const void *cookie_netfs_data,
109{ 109{
110 const struct v9fs_inode *v9inode = cookie_netfs_data; 110 const struct v9fs_inode *v9inode = cookie_netfs_data;
111 memcpy(buffer, &v9inode->qid.path, sizeof(v9inode->qid.path)); 111 memcpy(buffer, &v9inode->qid.path, sizeof(v9inode->qid.path));
112 P9_DPRINTK(P9_DEBUG_FSC, "inode %p get key %llu", &v9inode->vfs_inode, 112 p9_debug(P9_DEBUG_FSC, "inode %p get key %llu\n",
113 v9inode->qid.path); 113 &v9inode->vfs_inode, v9inode->qid.path);
114 return sizeof(v9inode->qid.path); 114 return sizeof(v9inode->qid.path);
115} 115}
116 116
@@ -120,8 +120,8 @@ static void v9fs_cache_inode_get_attr(const void *cookie_netfs_data,
120 const struct v9fs_inode *v9inode = cookie_netfs_data; 120 const struct v9fs_inode *v9inode = cookie_netfs_data;
121 *size = i_size_read(&v9inode->vfs_inode); 121 *size = i_size_read(&v9inode->vfs_inode);
122 122
123 P9_DPRINTK(P9_DEBUG_FSC, "inode %p get attr %llu", &v9inode->vfs_inode, 123 p9_debug(P9_DEBUG_FSC, "inode %p get attr %llu\n",
124 *size); 124 &v9inode->vfs_inode, *size);
125} 125}
126 126
127static uint16_t v9fs_cache_inode_get_aux(const void *cookie_netfs_data, 127static uint16_t v9fs_cache_inode_get_aux(const void *cookie_netfs_data,
@@ -129,8 +129,8 @@ static uint16_t v9fs_cache_inode_get_aux(const void *cookie_netfs_data,
129{ 129{
130 const struct v9fs_inode *v9inode = cookie_netfs_data; 130 const struct v9fs_inode *v9inode = cookie_netfs_data;
131 memcpy(buffer, &v9inode->qid.version, sizeof(v9inode->qid.version)); 131 memcpy(buffer, &v9inode->qid.version, sizeof(v9inode->qid.version));
132 P9_DPRINTK(P9_DEBUG_FSC, "inode %p get aux %u", &v9inode->vfs_inode, 132 p9_debug(P9_DEBUG_FSC, "inode %p get aux %u\n",
133 v9inode->qid.version); 133 &v9inode->vfs_inode, v9inode->qid.version);
134 return sizeof(v9inode->qid.version); 134 return sizeof(v9inode->qid.version);
135} 135}
136 136
@@ -206,8 +206,8 @@ void v9fs_cache_inode_get_cookie(struct inode *inode)
206 &v9fs_cache_inode_index_def, 206 &v9fs_cache_inode_index_def,
207 v9inode); 207 v9inode);
208 208
209 P9_DPRINTK(P9_DEBUG_FSC, "inode %p get cookie %p", inode, 209 p9_debug(P9_DEBUG_FSC, "inode %p get cookie %p\n",
210 v9inode->fscache); 210 inode, v9inode->fscache);
211} 211}
212 212
213void v9fs_cache_inode_put_cookie(struct inode *inode) 213void v9fs_cache_inode_put_cookie(struct inode *inode)
@@ -216,8 +216,8 @@ void v9fs_cache_inode_put_cookie(struct inode *inode)
216 216
217 if (!v9inode->fscache) 217 if (!v9inode->fscache)
218 return; 218 return;
219 P9_DPRINTK(P9_DEBUG_FSC, "inode %p put cookie %p", inode, 219 p9_debug(P9_DEBUG_FSC, "inode %p put cookie %p\n",
220 v9inode->fscache); 220 inode, v9inode->fscache);
221 221
222 fscache_relinquish_cookie(v9inode->fscache, 0); 222 fscache_relinquish_cookie(v9inode->fscache, 0);
223 v9inode->fscache = NULL; 223 v9inode->fscache = NULL;
@@ -229,8 +229,8 @@ void v9fs_cache_inode_flush_cookie(struct inode *inode)
229 229
230 if (!v9inode->fscache) 230 if (!v9inode->fscache)
231 return; 231 return;
232 P9_DPRINTK(P9_DEBUG_FSC, "inode %p flush cookie %p", inode, 232 p9_debug(P9_DEBUG_FSC, "inode %p flush cookie %p\n",
233 v9inode->fscache); 233 inode, v9inode->fscache);
234 234
235 fscache_relinquish_cookie(v9inode->fscache, 1); 235 fscache_relinquish_cookie(v9inode->fscache, 1);
236 v9inode->fscache = NULL; 236 v9inode->fscache = NULL;
@@ -272,8 +272,8 @@ void v9fs_cache_inode_reset_cookie(struct inode *inode)
272 v9inode->fscache = fscache_acquire_cookie(v9ses->fscache, 272 v9inode->fscache = fscache_acquire_cookie(v9ses->fscache,
273 &v9fs_cache_inode_index_def, 273 &v9fs_cache_inode_index_def,
274 v9inode); 274 v9inode);
275 P9_DPRINTK(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p", 275 p9_debug(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p\n",
276 inode, old, v9inode->fscache); 276 inode, old, v9inode->fscache);
277 277
278 spin_unlock(&v9inode->fscache_lock); 278 spin_unlock(&v9inode->fscache_lock);
279} 279}
@@ -323,7 +323,7 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page)
323 int ret; 323 int ret;
324 const struct v9fs_inode *v9inode = V9FS_I(inode); 324 const struct v9fs_inode *v9inode = V9FS_I(inode);
325 325
326 P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page); 326 p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
327 if (!v9inode->fscache) 327 if (!v9inode->fscache)
328 return -ENOBUFS; 328 return -ENOBUFS;
329 329
@@ -335,13 +335,13 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page)
335 switch (ret) { 335 switch (ret) {
336 case -ENOBUFS: 336 case -ENOBUFS:
337 case -ENODATA: 337 case -ENODATA:
338 P9_DPRINTK(P9_DEBUG_FSC, "page/inode not in cache %d", ret); 338 p9_debug(P9_DEBUG_FSC, "page/inode not in cache %d\n", ret);
339 return 1; 339 return 1;
340 case 0: 340 case 0:
341 P9_DPRINTK(P9_DEBUG_FSC, "BIO submitted"); 341 p9_debug(P9_DEBUG_FSC, "BIO submitted\n");
342 return ret; 342 return ret;
343 default: 343 default:
344 P9_DPRINTK(P9_DEBUG_FSC, "ret %d", ret); 344 p9_debug(P9_DEBUG_FSC, "ret %d\n", ret);
345 return ret; 345 return ret;
346 } 346 }
347} 347}
@@ -361,7 +361,7 @@ int __v9fs_readpages_from_fscache(struct inode *inode,
361 int ret; 361 int ret;
362 const struct v9fs_inode *v9inode = V9FS_I(inode); 362 const struct v9fs_inode *v9inode = V9FS_I(inode);
363 363
364 P9_DPRINTK(P9_DEBUG_FSC, "inode %p pages %u", inode, *nr_pages); 364 p9_debug(P9_DEBUG_FSC, "inode %p pages %u\n", inode, *nr_pages);
365 if (!v9inode->fscache) 365 if (!v9inode->fscache)
366 return -ENOBUFS; 366 return -ENOBUFS;
367 367
@@ -373,15 +373,15 @@ int __v9fs_readpages_from_fscache(struct inode *inode,
373 switch (ret) { 373 switch (ret) {
374 case -ENOBUFS: 374 case -ENOBUFS:
375 case -ENODATA: 375 case -ENODATA:
376 P9_DPRINTK(P9_DEBUG_FSC, "pages/inodes not in cache %d", ret); 376 p9_debug(P9_DEBUG_FSC, "pages/inodes not in cache %d\n", ret);
377 return 1; 377 return 1;
378 case 0: 378 case 0:
379 BUG_ON(!list_empty(pages)); 379 BUG_ON(!list_empty(pages));
380 BUG_ON(*nr_pages != 0); 380 BUG_ON(*nr_pages != 0);
381 P9_DPRINTK(P9_DEBUG_FSC, "BIO submitted"); 381 p9_debug(P9_DEBUG_FSC, "BIO submitted\n");
382 return ret; 382 return ret;
383 default: 383 default:
384 P9_DPRINTK(P9_DEBUG_FSC, "ret %d", ret); 384 p9_debug(P9_DEBUG_FSC, "ret %d\n", ret);
385 return ret; 385 return ret;
386 } 386 }
387} 387}
@@ -396,9 +396,9 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
396 int ret; 396 int ret;
397 const struct v9fs_inode *v9inode = V9FS_I(inode); 397 const struct v9fs_inode *v9inode = V9FS_I(inode);
398 398
399 P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page); 399 p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
400 ret = fscache_write_page(v9inode->fscache, page, GFP_KERNEL); 400 ret = fscache_write_page(v9inode->fscache, page, GFP_KERNEL);
401 P9_DPRINTK(P9_DEBUG_FSC, "ret = %d", ret); 401 p9_debug(P9_DEBUG_FSC, "ret = %d\n", ret);
402 if (ret != 0) 402 if (ret != 0)
403 v9fs_uncache_page(inode, page); 403 v9fs_uncache_page(inode, page);
404} 404}
@@ -409,7 +409,7 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
409void __v9fs_fscache_wait_on_page_write(struct inode *inode, struct page *page) 409void __v9fs_fscache_wait_on_page_write(struct inode *inode, struct page *page)
410{ 410{
411 const struct v9fs_inode *v9inode = V9FS_I(inode); 411 const struct v9fs_inode *v9inode = V9FS_I(inode);
412 P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page); 412 p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
413 if (PageFsCache(page)) 413 if (PageFsCache(page))
414 fscache_wait_on_page_write(v9inode->fscache, page); 414 fscache_wait_on_page_write(v9inode->fscache, page);
415} 415}