diff options
author | Suresh Jayaraman <sjayaraman@suse.de> | 2010-07-05 08:43:00 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-08-02 08:40:36 -0400 |
commit | 85f2d6b44d7e83bdeab87df910127c6f296866cf (patch) | |
tree | 238389c1726e212a80336551809b44b0bbedec38 /fs/cifs/fscache.c | |
parent | 9451a9a52f91a4c171cfaca2f6d7a2ce91867b8d (diff) |
cifs: FS-Cache page management
Takes care of invalidation and release of FS-Cache marked pages and also
invalidation of the FsCache page flag when the inode is removed.
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/fscache.c')
-rw-r--r-- | fs/cifs/fscache.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c index 6c8d96758ddb..5dd935280049 100644 --- a/fs/cifs/fscache.c +++ b/fs/cifs/fscache.c | |||
@@ -124,3 +124,29 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode) | |||
124 | cifsi->fscache, old); | 124 | cifsi->fscache, old); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | |||
128 | int cifs_fscache_release_page(struct page *page, gfp_t gfp) | ||
129 | { | ||
130 | if (PageFsCache(page)) { | ||
131 | struct inode *inode = page->mapping->host; | ||
132 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | ||
133 | |||
134 | cFYI(1, "CIFS: fscache release page (0x%p/0x%p)", | ||
135 | page, cifsi->fscache); | ||
136 | if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) | ||
137 | return 0; | ||
138 | } | ||
139 | |||
140 | return 1; | ||
141 | } | ||
142 | |||
143 | void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) | ||
144 | { | ||
145 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | ||
146 | struct fscache_cookie *cookie = cifsi->fscache; | ||
147 | |||
148 | cFYI(1, "CIFS: fscache invalidatepage (0x%p/0x%p)", page, cookie); | ||
149 | fscache_wait_on_page_write(cookie, page); | ||
150 | fscache_uncache_page(cookie, page); | ||
151 | } | ||
152 | |||