Skip to content

Commit 8d0d47e

Browse files
committed
Merge branch 'mb/dio' into master
2 parents a6d4040 + 378f32b commit 8d0d47e

30 files changed

+1648
-1570
lines changed

fs/dax.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ EXPORT_SYMBOL_GPL(__dax_zero_page_range);
10901090

10911091
static loff_t
10921092
dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
1093-
struct iomap *iomap)
1093+
struct iomap *iomap, struct iomap *srcmap)
10941094
{
10951095
struct block_device *bdev = iomap->bdev;
10961096
struct dax_device *dax_dev = iomap->dax_dev;
@@ -1247,7 +1247,8 @@ static vm_fault_t dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
12471247
struct inode *inode = mapping->host;
12481248
unsigned long vaddr = vmf->address;
12491249
loff_t pos = (loff_t)vmf->pgoff << PAGE_SHIFT;
1250-
struct iomap iomap = { 0 };
1250+
struct iomap iomap = { .type = IOMAP_HOLE };
1251+
struct iomap srcmap = { .type = IOMAP_HOLE };
12511252
unsigned flags = IOMAP_FAULT;
12521253
int error, major = 0;
12531254
bool write = vmf->flags & FAULT_FLAG_WRITE;
@@ -1292,7 +1293,7 @@ static vm_fault_t dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
12921293
* the file system block size to be equal the page size, which means
12931294
* that we never have to deal with more than a single extent here.
12941295
*/
1295-
error = ops->iomap_begin(inode, pos, PAGE_SIZE, flags, &iomap);
1296+
error = ops->iomap_begin(inode, pos, PAGE_SIZE, flags, &iomap, &srcmap);
12961297
if (iomap_errp)
12971298
*iomap_errp = error;
12981299
if (error) {
@@ -1471,7 +1472,8 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
14711472
unsigned int iomap_flags = (write ? IOMAP_WRITE : 0) | IOMAP_FAULT;
14721473
struct inode *inode = mapping->host;
14731474
vm_fault_t result = VM_FAULT_FALLBACK;
1474-
struct iomap iomap = { 0 };
1475+
struct iomap iomap = { .type = IOMAP_HOLE };
1476+
struct iomap srcmap = { .type = IOMAP_HOLE };
14751477
pgoff_t max_pgoff;
14761478
void *entry;
14771479
loff_t pos;
@@ -1546,7 +1548,8 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
15461548
* to look up our filesystem block.
15471549
*/
15481550
pos = (loff_t)xas.xa_index << PAGE_SHIFT;
1549-
error = ops->iomap_begin(inode, pos, PMD_SIZE, iomap_flags, &iomap);
1551+
error = ops->iomap_begin(inode, pos, PMD_SIZE, iomap_flags, &iomap,
1552+
&srcmap);
15501553
if (error)
15511554
goto unlock_entry;
15521555

fs/ext2/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ int ext2_get_block(struct inode *inode, sector_t iblock,
801801

802802
#ifdef CONFIG_FS_DAX
803803
static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
804-
unsigned flags, struct iomap *iomap)
804+
unsigned flags, struct iomap *iomap, struct iomap *srcmap)
805805
{
806806
unsigned int blkbits = inode->i_blkbits;
807807
unsigned long first_block = offset >> blkbits;

fs/ext4/ext4.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,6 @@ enum {
15841584
EXT4_STATE_NO_EXPAND, /* No space for expansion */
15851585
EXT4_STATE_DA_ALLOC_CLOSE, /* Alloc DA blks on close */
15861586
EXT4_STATE_EXT_MIGRATE, /* Inode is migrating */
1587-
EXT4_STATE_DIO_UNWRITTEN, /* need convert on dio done*/
15881587
EXT4_STATE_NEWENTRY, /* File just added to dir */
15891588
EXT4_STATE_MAY_INLINE_DATA, /* may have in-inode data */
15901589
EXT4_STATE_EXT_PRECACHED, /* extents have been precached */
@@ -2565,8 +2564,6 @@ int ext4_get_block_unwritten(struct inode *inode, sector_t iblock,
25652564
struct buffer_head *bh_result, int create);
25662565
int ext4_get_block(struct inode *inode, sector_t iblock,
25672566
struct buffer_head *bh_result, int create);
2568-
int ext4_dio_get_block(struct inode *inode, sector_t iblock,
2569-
struct buffer_head *bh_result, int create);
25702567
int ext4_da_get_block_prep(struct inode *inode, sector_t iblock,
25712568
struct buffer_head *bh, int create);
25722569
int ext4_walk_page_buffers(handle_t *handle,
@@ -3391,6 +3388,7 @@ static inline void ext4_clear_io_unwritten_flag(ext4_io_end_t *io_end)
33913388
}
33923389

33933390
extern const struct iomap_ops ext4_iomap_ops;
3391+
extern const struct iomap_ops ext4_iomap_report_ops;
33943392

33953393
static inline int ext4_buffer_uptodate(struct buffer_head *bh)
33963394
{

fs/ext4/extents.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,16 +1765,9 @@ ext4_can_extents_be_merged(struct inode *inode, struct ext4_extent *ex1,
17651765
*/
17661766
if (ext1_ee_len + ext2_ee_len > EXT_INIT_MAX_LEN)
17671767
return 0;
1768-
/*
1769-
* The check for IO to unwritten extent is somewhat racy as we
1770-
* increment i_unwritten / set EXT4_STATE_DIO_UNWRITTEN only after
1771-
* dropping i_data_sem. But reserved blocks should save us in that
1772-
* case.
1773-
*/
1768+
17741769
if (ext4_ext_is_unwritten(ex1) &&
1775-
(ext4_test_inode_state(inode, EXT4_STATE_DIO_UNWRITTEN) ||
1776-
atomic_read(&EXT4_I(inode)->i_unwritten) ||
1777-
(ext1_ee_len + ext2_ee_len > EXT_UNWRITTEN_MAX_LEN)))
1770+
ext1_ee_len + ext2_ee_len > EXT_UNWRITTEN_MAX_LEN)
17781771
return 0;
17791772
#ifdef AGGRESSIVE_TEST
17801773
if (ext1_ee_len >= 4)

0 commit comments

Comments
 (0)