Skip to content

Commit f1084bc

Browse files
committed
Revert "fs: remove dio_end_io()"
This reverts commit b75b7ca. The patch restores a helper that was not necessary after direct IO port to iomap infrastructure, which gets reverted. Signed-off-by: David Sterba <[email protected]>
1 parent 8e0fa5d commit f1084bc

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

fs/direct-io.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,25 @@ static void dio_bio_end_io(struct bio *bio)
386386
spin_unlock_irqrestore(&dio->bio_lock, flags);
387387
}
388388

389+
/**
390+
* dio_end_io - handle the end io action for the given bio
391+
* @bio: The direct io bio thats being completed
392+
*
393+
* This is meant to be called by any filesystem that uses their own dio_submit_t
394+
* so that the DIO specific endio actions are dealt with after the filesystem
395+
* has done it's completion work.
396+
*/
397+
void dio_end_io(struct bio *bio)
398+
{
399+
struct dio *dio = bio->bi_private;
400+
401+
if (dio->is_async)
402+
dio_bio_end_aio(bio);
403+
else
404+
dio_bio_end_io(bio);
405+
}
406+
EXPORT_SYMBOL_GPL(dio_end_io);
407+
389408
static inline void
390409
dio_bio_alloc(struct dio *dio, struct dio_submit *sdio,
391410
struct block_device *bdev,

include/linux/fs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3187,6 +3187,8 @@ enum {
31873187
DIO_SKIP_HOLES = 0x02,
31883188
};
31893189

3190+
void dio_end_io(struct bio *bio);
3191+
31903192
ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
31913193
struct block_device *bdev, struct iov_iter *iter,
31923194
get_block_t get_block,

0 commit comments

Comments
 (0)