aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/ext2.h1
-rw-r--r--fs/ext2/file.c21
-rw-r--r--fs/ext2/inode.c18
-rw-r--r--fs/ext2/namei.c10
4 files changed, 10 insertions, 40 deletions
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
index 678f9ab08c48..8d15febd0aa3 100644
--- a/fs/ext2/ext2.h
+++ b/fs/ext2/ext2.h
@@ -793,7 +793,6 @@ extern int ext2_fsync(struct file *file, loff_t start, loff_t end,
793 int datasync); 793 int datasync);
794extern const struct inode_operations ext2_file_inode_operations; 794extern const struct inode_operations ext2_file_inode_operations;
795extern const struct file_operations ext2_file_operations; 795extern const struct file_operations ext2_file_operations;
796extern const struct file_operations ext2_dax_file_operations;
797 796
798/* inode.c */ 797/* inode.c */
799extern const struct address_space_operations ext2_aops; 798extern const struct address_space_operations ext2_aops;
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index e31701713516..3a0a6c6406d0 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -39,6 +39,7 @@ static int ext2_dax_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
39static const struct vm_operations_struct ext2_dax_vm_ops = { 39static const struct vm_operations_struct ext2_dax_vm_ops = {
40 .fault = ext2_dax_fault, 40 .fault = ext2_dax_fault,
41 .page_mkwrite = ext2_dax_mkwrite, 41 .page_mkwrite = ext2_dax_mkwrite,
42 .pfn_mkwrite = dax_pfn_mkwrite,
42}; 43};
43 44
44static int ext2_file_mmap(struct file *file, struct vm_area_struct *vma) 45static int ext2_file_mmap(struct file *file, struct vm_area_struct *vma)
@@ -92,8 +93,6 @@ int ext2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
92 */ 93 */
93const struct file_operations ext2_file_operations = { 94const struct file_operations ext2_file_operations = {
94 .llseek = generic_file_llseek, 95 .llseek = generic_file_llseek,
95 .read = new_sync_read,
96 .write = new_sync_write,
97 .read_iter = generic_file_read_iter, 96 .read_iter = generic_file_read_iter,
98 .write_iter = generic_file_write_iter, 97 .write_iter = generic_file_write_iter,
99 .unlocked_ioctl = ext2_ioctl, 98 .unlocked_ioctl = ext2_ioctl,
@@ -108,24 +107,6 @@ const struct file_operations ext2_file_operations = {
108 .splice_write = iter_file_splice_write, 107 .splice_write = iter_file_splice_write,
109}; 108};
110 109
111#ifdef CONFIG_FS_DAX
112const struct file_operations ext2_dax_file_operations = {
113 .llseek = generic_file_llseek,
114 .read = new_sync_read,
115 .write = new_sync_write,
116 .read_iter = generic_file_read_iter,
117 .write_iter = generic_file_write_iter,
118 .unlocked_ioctl = ext2_ioctl,
119#ifdef CONFIG_COMPAT
120 .compat_ioctl = ext2_compat_ioctl,
121#endif
122 .mmap = ext2_file_mmap,
123 .open = dquot_file_open,
124 .release = ext2_release_file,
125 .fsync = ext2_fsync,
126};
127#endif
128
129const struct inode_operations ext2_file_inode_operations = { 110const struct inode_operations ext2_file_inode_operations = {
130#ifdef CONFIG_EXT2_FS_XATTR 111#ifdef CONFIG_EXT2_FS_XATTR
131 .setxattr = generic_setxattr, 112 .setxattr = generic_setxattr,
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 6434bc000125..5d9213963fae 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -31,7 +31,7 @@
31#include <linux/mpage.h> 31#include <linux/mpage.h>
32#include <linux/fiemap.h> 32#include <linux/fiemap.h>
33#include <linux/namei.h> 33#include <linux/namei.h>
34#include <linux/aio.h> 34#include <linux/uio.h>
35#include "ext2.h" 35#include "ext2.h"
36#include "acl.h" 36#include "acl.h"
37#include "xattr.h" 37#include "xattr.h"
@@ -851,8 +851,7 @@ static sector_t ext2_bmap(struct address_space *mapping, sector_t block)
851} 851}
852 852
853static ssize_t 853static ssize_t
854ext2_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, 854ext2_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
855 loff_t offset)
856{ 855{
857 struct file *file = iocb->ki_filp; 856 struct file *file = iocb->ki_filp;
858 struct address_space *mapping = file->f_mapping; 857 struct address_space *mapping = file->f_mapping;
@@ -861,12 +860,12 @@ ext2_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
861 ssize_t ret; 860 ssize_t ret;
862 861
863 if (IS_DAX(inode)) 862 if (IS_DAX(inode))
864 ret = dax_do_io(rw, iocb, inode, iter, offset, ext2_get_block, 863 ret = dax_do_io(iocb, inode, iter, offset, ext2_get_block, NULL,
865 NULL, DIO_LOCKING); 864 DIO_LOCKING);
866 else 865 else
867 ret = blockdev_direct_IO(rw, iocb, inode, iter, offset, 866 ret = blockdev_direct_IO(iocb, inode, iter, offset,
868 ext2_get_block); 867 ext2_get_block);
869 if (ret < 0 && (rw & WRITE)) 868 if (ret < 0 && iov_iter_rw(iter) == WRITE)
870 ext2_write_failed(mapping, offset + count); 869 ext2_write_failed(mapping, offset + count);
871 return ret; 870 return ret;
872} 871}
@@ -1388,10 +1387,7 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino)
1388 1387
1389 if (S_ISREG(inode->i_mode)) { 1388 if (S_ISREG(inode->i_mode)) {
1390 inode->i_op = &ext2_file_inode_operations; 1389 inode->i_op = &ext2_file_inode_operations;
1391 if (test_opt(inode->i_sb, DAX)) { 1390 if (test_opt(inode->i_sb, NOBH)) {
1392 inode->i_mapping->a_ops = &ext2_aops;
1393 inode->i_fop = &ext2_dax_file_operations;
1394 } else if (test_opt(inode->i_sb, NOBH)) {
1395 inode->i_mapping->a_ops = &ext2_nobh_aops; 1391 inode->i_mapping->a_ops = &ext2_nobh_aops;
1396 inode->i_fop = &ext2_file_operations; 1392 inode->i_fop = &ext2_file_operations;
1397 } else { 1393 } else {
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index 148f6e3789ea..ce422931f411 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -104,10 +104,7 @@ static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode
104 return PTR_ERR(inode); 104 return PTR_ERR(inode);
105 105
106 inode->i_op = &ext2_file_inode_operations; 106 inode->i_op = &ext2_file_inode_operations;
107 if (test_opt(inode->i_sb, DAX)) { 107 if (test_opt(inode->i_sb, NOBH)) {
108 inode->i_mapping->a_ops = &ext2_aops;
109 inode->i_fop = &ext2_dax_file_operations;
110 } else if (test_opt(inode->i_sb, NOBH)) {
111 inode->i_mapping->a_ops = &ext2_nobh_aops; 108 inode->i_mapping->a_ops = &ext2_nobh_aops;
112 inode->i_fop = &ext2_file_operations; 109 inode->i_fop = &ext2_file_operations;
113 } else { 110 } else {
@@ -125,10 +122,7 @@ static int ext2_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
125 return PTR_ERR(inode); 122 return PTR_ERR(inode);
126 123
127 inode->i_op = &ext2_file_inode_operations; 124 inode->i_op = &ext2_file_inode_operations;
128 if (test_opt(inode->i_sb, DAX)) { 125 if (test_opt(inode->i_sb, NOBH)) {
129 inode->i_mapping->a_ops = &ext2_aops;
130 inode->i_fop = &ext2_dax_file_operations;
131 } else if (test_opt(inode->i_sb, NOBH)) {
132 inode->i_mapping->a_ops = &ext2_nobh_aops; 126 inode->i_mapping->a_ops = &ext2_nobh_aops;
133 inode->i_fop = &ext2_file_operations; 127 inode->i_fop = &ext2_file_operations;
134 } else { 128 } else {