Skip to content

Commit

Permalink
Revert "fs: remove dio_end_io()"
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kdave committed Jun 9, 2020
1 parent 8e0fa5d commit f1084bc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions fs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,25 @@ static void dio_bio_end_io(struct bio *bio)
spin_unlock_irqrestore(&dio->bio_lock, flags);
}

/**
* dio_end_io - handle the end io action for the given bio
* @bio: The direct io bio thats being completed
*
* This is meant to be called by any filesystem that uses their own dio_submit_t
* so that the DIO specific endio actions are dealt with after the filesystem
* has done it's completion work.
*/
void dio_end_io(struct bio *bio)
{
struct dio *dio = bio->bi_private;

if (dio->is_async)
dio_bio_end_aio(bio);
else
dio_bio_end_io(bio);
}
EXPORT_SYMBOL_GPL(dio_end_io);

static inline void
dio_bio_alloc(struct dio *dio, struct dio_submit *sdio,
struct block_device *bdev,
Expand Down
2 changes: 2 additions & 0 deletions include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3187,6 +3187,8 @@ enum {
DIO_SKIP_HOLES = 0x02,
};

void dio_end_io(struct bio *bio);

ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
struct block_device *bdev, struct iov_iter *iter,
get_block_t get_block,
Expand Down

0 comments on commit f1084bc

Please sign in to comment.