26 #include <linux/module.h>
27 #include <linux/errno.h>
30 #include <linux/stat.h>
31 #include <linux/string.h>
35 #include <linux/sched.h>
63 retval = v9fs_readpage_from_fscache(inode, page);
72 v9fs_uncache_page(inode, page);
78 SetPageUptodate(page);
80 v9fs_readpage_to_fscache(inode, page);
97 static int v9fs_vfs_readpage(
struct file *filp,
struct page *page)
118 inode = mapping->
host;
121 ret = v9fs_readpages_from_fscache(inode, mapping, pages, &nr_pages);
136 static int v9fs_release_page(
struct page *page,
gfp_t gfp)
138 if (PagePrivate(page))
140 return v9fs_fscache_release_page(page, gfp);
150 static void v9fs_invalidate_page(
struct page *page,
unsigned long offset)
157 v9fs_fscache_invalidate_page(page);
160 static int v9fs_vfs_writepage_locked(
struct page *page)
167 struct inode *inode = page->
mapping->host;
169 v9inode = V9FS_I(inode);
170 size = i_size_read(inode);
176 set_page_writeback(page);
188 (
__force const char __user *)buffer,
203 retval = v9fs_vfs_writepage_locked(page);
210 mapping_set_error(page->
mapping, retval);
224 static int v9fs_launder_page(
struct page *page)
227 struct inode *inode = page->
mapping->host;
229 v9fs_fscache_wait_on_page_write(inode, page);
231 retval = v9fs_vfs_writepage_locked(page);
259 loff_t
pos,
unsigned long nr_segs)
267 iocb->
ki_filp->f_path.dentry->d_name.name,
268 (
long long)pos, nr_segs);
274 loff_t
pos,
unsigned len,
unsigned flags,
275 struct page **pagep,
void **fsdata)
281 struct inode *inode = mapping->
host;
283 v9inode = V9FS_I(inode);
291 if (PageUptodate(page))
307 loff_t pos,
unsigned len,
unsigned copied,
308 struct page *page,
void *fsdata)
310 loff_t last_pos = pos + copied;
311 struct inode *inode = page->
mapping->host;
319 zero_user(page, from + copied, len - copied);
323 if (!PageUptodate(page))
324 SetPageUptodate(page);
329 if (last_pos > inode->
i_size) {
331 i_size_write(inode, last_pos);
342 .readpage = v9fs_vfs_readpage,
343 .readpages = v9fs_vfs_readpages,
345 .writepage = v9fs_vfs_writepage,
346 .write_begin = v9fs_write_begin,
347 .write_end = v9fs_write_end,
348 .releasepage = v9fs_release_page,
349 .invalidatepage = v9fs_invalidate_page,
350 .launder_page = v9fs_launder_page,
351 .direct_IO = v9fs_direct_IO,