diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-02-28 06:33:56 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-03-15 10:57:37 -0400 |
commit | 2efda7998bbc50589d28f18fddfb0c44d412128e (patch) | |
tree | af3d83d0370b8d39b024ff8dbd34051d466bfa2d /fs/9p | |
parent | 20656a49ef37d8f44ed1e0b47d132197f9628adc (diff) |
fs/9p: [fscache] wait for page write in cached mode
We need to call fscache_wait_on_page_write in launder_page
for fscache
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/cache.c | 11 | ||||
-rw-r--r-- | fs/9p/cache.h | 16 | ||||
-rw-r--r-- | fs/9p/vfs_addr.c | 2 |
3 files changed, 27 insertions, 2 deletions
diff --git a/fs/9p/cache.c b/fs/9p/cache.c index 0dbe0d139ac2..610913d42a28 100644 --- a/fs/9p/cache.c +++ b/fs/9p/cache.c | |||
@@ -461,3 +461,14 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page) | |||
461 | if (ret != 0) | 461 | if (ret != 0) |
462 | v9fs_uncache_page(inode, page); | 462 | v9fs_uncache_page(inode, page); |
463 | } | 463 | } |
464 | |||
465 | /* | ||
466 | * wait for a page to complete writing to the cache | ||
467 | */ | ||
468 | void __v9fs_fscache_wait_on_page_write(struct inode *inode, struct page *page) | ||
469 | { | ||
470 | const struct v9fs_cookie *vcookie = v9fs_inode2cookie(inode); | ||
471 | P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page); | ||
472 | if (PageFsCache(page)) | ||
473 | fscache_wait_on_page_write(vcookie->fscache, page); | ||
474 | } | ||
diff --git a/fs/9p/cache.h b/fs/9p/cache.h index a94192bfaee8..ec16fcdc3a67 100644 --- a/fs/9p/cache.h +++ b/fs/9p/cache.h | |||
@@ -64,8 +64,8 @@ extern int __v9fs_readpages_from_fscache(struct inode *inode, | |||
64 | struct list_head *pages, | 64 | struct list_head *pages, |
65 | unsigned *nr_pages); | 65 | unsigned *nr_pages); |
66 | extern void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page); | 66 | extern void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page); |
67 | 67 | extern void __v9fs_fscache_wait_on_page_write(struct inode *inode, | |
68 | 68 | struct page *page); | |
69 | /** | 69 | /** |
70 | * v9fs_cache_register - Register v9fs file system with the cache | 70 | * v9fs_cache_register - Register v9fs file system with the cache |
71 | */ | 71 | */ |
@@ -131,6 +131,12 @@ static inline void v9fs_vcookie_set_qid(struct inode *inode, | |||
131 | spin_unlock(&vcookie->lock); | 131 | spin_unlock(&vcookie->lock); |
132 | } | 132 | } |
133 | 133 | ||
134 | static inline void v9fs_fscache_wait_on_page_write(struct inode *inode, | ||
135 | struct page *page) | ||
136 | { | ||
137 | return __v9fs_fscache_wait_on_page_write(inode, page); | ||
138 | } | ||
139 | |||
134 | #else /* CONFIG_9P_FSCACHE */ | 140 | #else /* CONFIG_9P_FSCACHE */ |
135 | 141 | ||
136 | static inline int v9fs_cache_register(void) | 142 | static inline int v9fs_cache_register(void) |
@@ -172,5 +178,11 @@ static inline void v9fs_vcookie_set_qid(struct inode *inode, | |||
172 | struct p9_qid *qid) | 178 | struct p9_qid *qid) |
173 | {} | 179 | {} |
174 | 180 | ||
181 | static inline void v9fs_fscache_wait_on_page_write(struct inode *inode, | ||
182 | struct page *page) | ||
183 | { | ||
184 | return; | ||
185 | } | ||
186 | |||
175 | #endif /* CONFIG_9P_FSCACHE */ | 187 | #endif /* CONFIG_9P_FSCACHE */ |
176 | #endif /* _9P_CACHE_H */ | 188 | #endif /* _9P_CACHE_H */ |
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index b7f2a8e3863e..637bd703e28c 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c | |||
@@ -151,6 +151,8 @@ static void v9fs_invalidate_page(struct page *page, unsigned long offset) | |||
151 | 151 | ||
152 | static int v9fs_launder_page(struct page *page) | 152 | static int v9fs_launder_page(struct page *page) |
153 | { | 153 | { |
154 | struct inode *inode = page->mapping->host; | ||
155 | v9fs_fscache_wait_on_page_write(inode, page); | ||
154 | return 0; | 156 | return 0; |
155 | } | 157 | } |
156 | 158 | ||