9 #include <linux/sched.h>
13 loff_t
pos,
unsigned len,
unsigned flags,
14 struct page **pagep,
void **fsdata)
29 unsigned end = start + len;
38 static int logfs_write_end(
struct file *file,
struct address_space *mapping,
39 loff_t pos,
unsigned len,
unsigned copied,
struct page *page,
42 struct inode *inode = mapping->
host;
45 unsigned end = start + copied;
56 if (!PageUptodate(page)) {
64 if (i_size_read(inode) < (index << PAGE_CACHE_SHIFT) + end) {
65 i_size_write(inode, (index << PAGE_CACHE_SHIFT) + end);
66 mark_inode_dirty_sync(inode);
69 SetPageUptodate(page);
70 if (!PageDirty(page)) {
79 return ret ? ret : copied;
96 static void clear_radix_tree_dirty(
struct page *page)
99 set_page_writeback(page);
103 static int __logfs_writepage(
struct page *page)
105 struct inode *inode = page->
mapping->host;
112 clear_radix_tree_dirty(page);
119 struct inode *inode = page->
mapping->host;
120 loff_t
i_size = i_size_read(inode);
133 return __logfs_writepage(page);
142 return __logfs_writepage(page);
146 if (bix > end_index || offset == 0) {
159 return __logfs_writepage(page);
162 static void logfs_invalidatepage(
struct page *page,
unsigned long offset)
171 block->
ops->free_block(sb, block);
178 static int logfs_releasepage(
struct page *page,
gfp_t only_xfs_uses_this)
186 struct inode *inode = file->
f_path.dentry->d_inode;
188 unsigned int oldflags,
flags;
214 mark_inode_dirty_sync(inode);
222 int logfs_fsync(
struct file *file, loff_t start, loff_t end,
int datasync)
225 struct inode *inode = file->
f_mapping->host;
243 struct inode *inode = dentry->
d_inode;
257 mark_inode_dirty(inode);
262 .setattr = logfs_setattr,
278 .invalidatepage = logfs_invalidatepage,
280 .releasepage = logfs_releasepage,
282 .writepage = logfs_writepage,
284 .write_begin = logfs_write_begin,
285 .write_end = logfs_write_end,