aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/file.c')
-rw-r--r--fs/nilfs2/file.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/fs/nilfs2/file.c b/fs/nilfs2/file.c
index 8031086db8d5..cd38124372f3 100644
--- a/fs/nilfs2/file.c
+++ b/fs/nilfs2/file.c
@@ -44,35 +44,14 @@ int nilfs_sync_file(struct file *file, struct dentry *dentry, int datasync)
44 return 0; 44 return 0;
45 45
46 if (datasync) 46 if (datasync)
47 err = nilfs_construct_dsync_segment(inode->i_sb, inode); 47 err = nilfs_construct_dsync_segment(inode->i_sb, inode, 0,
48 LLONG_MAX);
48 else 49 else
49 err = nilfs_construct_segment(inode->i_sb); 50 err = nilfs_construct_segment(inode->i_sb);
50 51
51 return err; 52 return err;
52} 53}
53 54
54static ssize_t
55nilfs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
56 unsigned long nr_segs, loff_t pos)
57{
58 struct file *file = iocb->ki_filp;
59 struct inode *inode = file->f_dentry->d_inode;
60 ssize_t ret;
61
62 ret = generic_file_aio_write(iocb, iov, nr_segs, pos);
63 if (ret <= 0)
64 return ret;
65
66 if ((file->f_flags & O_SYNC) || IS_SYNC(inode)) {
67 int err;
68
69 err = nilfs_construct_dsync_segment(inode->i_sb, inode);
70 if (unlikely(err))
71 return err;
72 }
73 return ret;
74}
75
76static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 55static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
77{ 56{
78 struct page *page = vmf->page; 57 struct page *page = vmf->page;
@@ -160,7 +139,7 @@ struct file_operations nilfs_file_operations = {
160 .read = do_sync_read, 139 .read = do_sync_read,
161 .write = do_sync_write, 140 .write = do_sync_write,
162 .aio_read = generic_file_aio_read, 141 .aio_read = generic_file_aio_read,
163 .aio_write = nilfs_file_aio_write, 142 .aio_write = generic_file_aio_write,
164 .ioctl = nilfs_ioctl, 143 .ioctl = nilfs_ioctl,
165#ifdef CONFIG_COMPAT 144#ifdef CONFIG_COMPAT
166 .compat_ioctl = nilfs_compat_ioctl, 145 .compat_ioctl = nilfs_compat_ioctl,