Skip to content

Commit 2efda79

Browse files
kvaneeshericvh
authored andcommitted
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>
1 parent 20656a4 commit 2efda79

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

‎fs/9p/cache.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,3 +461,14 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
461461
if (ret != 0)
462462
v9fs_uncache_page(inode, page);
463463
}
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+
}

‎fs/9p/cache.h‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ extern int __v9fs_readpages_from_fscache(struct inode *inode,
6464
struct list_head *pages,
6565
unsigned *nr_pages);
6666
extern void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page);
67-
68-
67+
extern void __v9fs_fscache_wait_on_page_write(struct inode *inode,
68+
struct page *page);
6969
/**
7070
* v9fs_cache_register - Register v9fs file system with the cache
7171
*/
@@ -131,6 +131,12 @@ static inline void v9fs_vcookie_set_qid(struct inode *inode,
131131
spin_unlock(&vcookie->lock);
132132
}
133133

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+
134140
#else /* CONFIG_9P_FSCACHE */
135141

136142
static inline int v9fs_cache_register(void)
@@ -172,5 +178,11 @@ static inline void v9fs_vcookie_set_qid(struct inode *inode,
172178
struct p9_qid *qid)
173179
{}
174180

181+
static inline void v9fs_fscache_wait_on_page_write(struct inode *inode,
182+
struct page *page)
183+
{
184+
return;
185+
}
186+
175187
#endif /* CONFIG_9P_FSCACHE */
176188
#endif /* _9P_CACHE_H */

‎fs/9p/vfs_addr.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ static void v9fs_invalidate_page(struct page *page, unsigned long offset)
151151

152152
static int v9fs_launder_page(struct page *page)
153153
{
154+
struct inode *inode = page->mapping->host;
155+
v9fs_fscache_wait_on_page_write(inode, page);
154156
return 0;
155157
}
156158

0 commit comments

Comments
 (0)