@@ -1206,7 +1206,8 @@ kaio_fastmap(struct ploop_io *io, struct bio *orig_bio,
return 0;
}
- ret = inode->i_op->fastmap(inode, isec, orig_bio->bi_size, &phys_sec);
+ ret = inode->i_op->fastmap(inode, isec, orig_bio->bi_size, &phys_sec,
+ orig_bio->bi_rw & REQ_WRITE);
if (ret < 0) {
io->plo->st.fast_neg_noem++;
return 1;
@@ -126,7 +126,7 @@ static bool ext4_overwrite_io(struct inode *inode, loff_t pos, loff_t len)
}
static int ext4_fastmap(struct inode *inode, sector_t lblk_sec,
- unsigned int len, sector_t *pblk_sec)
+ unsigned int len, sector_t *pblk_sec, bool write)
{
struct ext4_map_blocks map;
loff_t pos = lblk_sec << 9;
@@ -2013,7 +2013,7 @@ struct inode_operations {
int (*atomic_open)(struct inode *, struct dentry *,
struct file *, unsigned open_flag,
umode_t create_mode, int *opened);
- int (*fastmap)(struct inode *, sector_t, unsigned int, sector_t *);
+ int (*fastmap)(struct inode *, sector_t, unsigned int, sector_t *, bool);
} ____cacheline_aligned;
This allows to differ READ and WRITE request. We need that, since they are required to be protected differently. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> --- drivers/block/ploop/io_kaio.c | 3 ++- fs/ext4/file.c | 2 +- include/linux/fs.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)