Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235022
b: refs/heads/master
c: 2efda79
h: refs/heads/master
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Eric Van Hensbergen committed Mar 15, 2011
1 parent ac22a78 commit 9cd8527
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 20656a49ef37d8f44ed1e0b47d132197f9628adc
refs/heads/master: 2efda7998bbc50589d28f18fddfb0c44d412128e
11 changes: 11 additions & 0 deletions trunk/fs/9p/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,14 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
if (ret != 0)
v9fs_uncache_page(inode, page);
}

/*
* wait for a page to complete writing to the cache
*/
void __v9fs_fscache_wait_on_page_write(struct inode *inode, struct page *page)
{
const struct v9fs_cookie *vcookie = v9fs_inode2cookie(inode);
P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page);
if (PageFsCache(page))
fscache_wait_on_page_write(vcookie->fscache, page);
}
16 changes: 14 additions & 2 deletions trunk/fs/9p/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ extern int __v9fs_readpages_from_fscache(struct inode *inode,
struct list_head *pages,
unsigned *nr_pages);
extern void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page);


extern void __v9fs_fscache_wait_on_page_write(struct inode *inode,
struct page *page);
/**
* v9fs_cache_register - Register v9fs file system with the cache
*/
Expand Down Expand Up @@ -131,6 +131,12 @@ static inline void v9fs_vcookie_set_qid(struct inode *inode,
spin_unlock(&vcookie->lock);
}

static inline void v9fs_fscache_wait_on_page_write(struct inode *inode,
struct page *page)
{
return __v9fs_fscache_wait_on_page_write(inode, page);
}

#else /* CONFIG_9P_FSCACHE */

static inline int v9fs_cache_register(void)
Expand Down Expand Up @@ -172,5 +178,11 @@ static inline void v9fs_vcookie_set_qid(struct inode *inode,
struct p9_qid *qid)
{}

static inline void v9fs_fscache_wait_on_page_write(struct inode *inode,
struct page *page)
{
return;
}

#endif /* CONFIG_9P_FSCACHE */
#endif /* _9P_CACHE_H */
2 changes: 2 additions & 0 deletions trunk/fs/9p/vfs_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ static void v9fs_invalidate_page(struct page *page, unsigned long offset)

static int v9fs_launder_page(struct page *page)
{
struct inode *inode = page->mapping->host;
v9fs_fscache_wait_on_page_write(inode, page);
return 0;
}

Expand Down

0 comments on commit 9cd8527

Please sign in to comment.