aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-02-27 15:46:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-02-27 15:46:16 -0500
commit691429e13dfaf5b0994b07cc166db41bd608ee3d (patch)
treebf52870108822c40d9a83d3c402c59d5f15cc6af /fs/ext2
parent1c271479b56da4a8caf5f56a88432d4260e120fe (diff)
parent7f6d5b529b7dfe2fca30cbf4bc81e16575090025 (diff)
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton: "10 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: dax: move writeback calls into the filesystems dax: give DAX clearing code correct bdev ext4: online defrag not supported with DAX ext2, ext4: only set S_DAX for regular inodes block: disable block device DAX by default ocfs2: unlock inode if deleting inode from orphan fails mm: ASLR: use get_random_long() drivers: char: random: add get_random_long() mm: numa: quickly fail allocations for NUMA balancing on full nodes mm: thp: fix SMP race condition between THP page fault and MADV_DONTNEED
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/inode.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 338eefda70c6..6bd58e6ff038 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -737,8 +737,10 @@ static int ext2_get_blocks(struct inode *inode,
737 * so that it's not found by another thread before it's 737 * so that it's not found by another thread before it's
738 * initialised 738 * initialised
739 */ 739 */
740 err = dax_clear_blocks(inode, le32_to_cpu(chain[depth-1].key), 740 err = dax_clear_sectors(inode->i_sb->s_bdev,
741 1 << inode->i_blkbits); 741 le32_to_cpu(chain[depth-1].key) <<
742 (inode->i_blkbits - 9),
743 1 << inode->i_blkbits);
742 if (err) { 744 if (err) {
743 mutex_unlock(&ei->truncate_mutex); 745 mutex_unlock(&ei->truncate_mutex);
744 goto cleanup; 746 goto cleanup;
@@ -874,6 +876,14 @@ ext2_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
874static int 876static int
875ext2_writepages(struct address_space *mapping, struct writeback_control *wbc) 877ext2_writepages(struct address_space *mapping, struct writeback_control *wbc)
876{ 878{
879#ifdef CONFIG_FS_DAX
880 if (dax_mapping(mapping)) {
881 return dax_writeback_mapping_range(mapping,
882 mapping->host->i_sb->s_bdev,
883 wbc);
884 }
885#endif
886
877 return mpage_writepages(mapping, wbc, ext2_get_block); 887 return mpage_writepages(mapping, wbc, ext2_get_block);
878} 888}
879 889
@@ -1296,7 +1306,7 @@ void ext2_set_inode_flags(struct inode *inode)
1296 inode->i_flags |= S_NOATIME; 1306 inode->i_flags |= S_NOATIME;
1297 if (flags & EXT2_DIRSYNC_FL) 1307 if (flags & EXT2_DIRSYNC_FL)
1298 inode->i_flags |= S_DIRSYNC; 1308 inode->i_flags |= S_DIRSYNC;
1299 if (test_opt(inode->i_sb, DAX)) 1309 if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode))
1300 inode->i_flags |= S_DAX; 1310 inode->i_flags |= S_DAX;
1301} 1311}
1302 1312