aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r--fs/nilfs2/inode.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index b4697d9d7e5d..289d1798decb 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -24,6 +24,7 @@
24#include <linux/buffer_head.h> 24#include <linux/buffer_head.h>
25#include <linux/mpage.h> 25#include <linux/mpage.h>
26#include <linux/writeback.h> 26#include <linux/writeback.h>
27#include <linux/uio.h>
27#include "nilfs.h" 28#include "nilfs.h"
28#include "segment.h" 29#include "segment.h"
29#include "page.h" 30#include "page.h"
@@ -145,8 +146,14 @@ static int nilfs_readpages(struct file *file, struct address_space *mapping,
145static int nilfs_writepages(struct address_space *mapping, 146static int nilfs_writepages(struct address_space *mapping,
146 struct writeback_control *wbc) 147 struct writeback_control *wbc)
147{ 148{
148 /* This empty method is required not to call generic_writepages() */ 149 struct inode *inode = mapping->host;
149 return 0; 150 int err = 0;
151
152 if (wbc->sync_mode == WB_SYNC_ALL)
153 err = nilfs_construct_dsync_segment(inode->i_sb, inode,
154 wbc->range_start,
155 wbc->range_end);
156 return err;
150} 157}
151 158
152static int nilfs_writepage(struct page *page, struct writeback_control *wbc) 159static int nilfs_writepage(struct page *page, struct writeback_control *wbc)
@@ -225,11 +232,6 @@ nilfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
225 struct file *file = iocb->ki_filp; 232 struct file *file = iocb->ki_filp;
226 struct inode *inode = file->f_mapping->host; 233 struct inode *inode = file->f_mapping->host;
227 ssize_t size; 234 ssize_t size;
228 int err;
229
230 err = nilfs_construct_dsync_segment(inode->i_sb, inode);
231 if (unlikely(err))
232 return err;
233 235
234 if (rw == WRITE) 236 if (rw == WRITE)
235 return 0; 237 return 0;