diff options
author | Ross Zwisler <ross.zwisler@linux.intel.com> | 2015-02-16 18:59:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-16 20:56:04 -0500 |
commit | 923ae0ff9250430133b3310fe62c47538cf1cbc1 (patch) | |
tree | 3c4194cbedbe77e719bf7c8762fba5362ec26032 /fs/ext4/namei.c | |
parent | 25726bc15731d42112b579cf73f30edbc43d3973 (diff) |
ext4: add DAX functionality
This is a port of the DAX functionality found in the current version of
ext2.
[matthew.r.wilcox@intel.com: heavily tweaked]
[akpm@linux-foundation.org: remap_pages went away]
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Boaz Harrosh <boaz@plexistor.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 2291923dae4e..28fe71a2904c 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -2235,7 +2235,10 @@ retry: | |||
2235 | err = PTR_ERR(inode); | 2235 | err = PTR_ERR(inode); |
2236 | if (!IS_ERR(inode)) { | 2236 | if (!IS_ERR(inode)) { |
2237 | inode->i_op = &ext4_file_inode_operations; | 2237 | inode->i_op = &ext4_file_inode_operations; |
2238 | inode->i_fop = &ext4_file_operations; | 2238 | if (test_opt(inode->i_sb, DAX)) |
2239 | inode->i_fop = &ext4_dax_file_operations; | ||
2240 | else | ||
2241 | inode->i_fop = &ext4_file_operations; | ||
2239 | ext4_set_aops(inode); | 2242 | ext4_set_aops(inode); |
2240 | err = ext4_add_nondir(handle, dentry, inode); | 2243 | err = ext4_add_nondir(handle, dentry, inode); |
2241 | if (!err && IS_DIRSYNC(dir)) | 2244 | if (!err && IS_DIRSYNC(dir)) |
@@ -2299,7 +2302,10 @@ retry: | |||
2299 | err = PTR_ERR(inode); | 2302 | err = PTR_ERR(inode); |
2300 | if (!IS_ERR(inode)) { | 2303 | if (!IS_ERR(inode)) { |
2301 | inode->i_op = &ext4_file_inode_operations; | 2304 | inode->i_op = &ext4_file_inode_operations; |
2302 | inode->i_fop = &ext4_file_operations; | 2305 | if (test_opt(inode->i_sb, DAX)) |
2306 | inode->i_fop = &ext4_dax_file_operations; | ||
2307 | else | ||
2308 | inode->i_fop = &ext4_file_operations; | ||
2303 | ext4_set_aops(inode); | 2309 | ext4_set_aops(inode); |
2304 | d_tmpfile(dentry, inode); | 2310 | d_tmpfile(dentry, inode); |
2305 | err = ext4_orphan_add(handle, inode); | 2311 | err = ext4_orphan_add(handle, inode); |