legacy direct-io cleanup

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQqUNBr3gm4hGXdBJlZ7Krx/gZQ6wUCZEYDPAAKCRBZ7Krx/gZQ
 65qvAQC60ak71gAqOSktR93GXYrQ5Q8hbpug7t3lzDQE9huGqgEAl0Zvr8d5ir3j
 y0X5U5Yl6bcUSQDd4VY76C+53yIKZQs=
 =rKXE
 -----END PGP SIGNATURE-----

Merge tag 'pull-old-dio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull legacy dio cleanup from Al Viro.

* tag 'pull-old-dio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  __blockdev_direct_IO(): get rid of submit_io callback
This commit is contained in:
Linus Torvalds 2023-04-24 19:28:49 -07:00
commit 11b32219cb
3 changed files with 5 additions and 10 deletions

View File

@ -86,7 +86,6 @@ struct dio_submit {
sector_t final_block_in_request;/* doesn't change */ sector_t final_block_in_request;/* doesn't change */
int boundary; /* prev block is at a boundary */ int boundary; /* prev block is at a boundary */
get_block_t *get_block; /* block mapping function */ get_block_t *get_block; /* block mapping function */
dio_submit_t *submit_io; /* IO submition function */
loff_t logical_offset_in_bio; /* current first logical block in bio */ loff_t logical_offset_in_bio; /* current first logical block in bio */
sector_t final_block_in_bio; /* current final block in bio + 1 */ sector_t final_block_in_bio; /* current final block in bio + 1 */
@ -431,10 +430,7 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio)
dio->bio_disk = bio->bi_bdev->bd_disk; dio->bio_disk = bio->bi_bdev->bd_disk;
if (sdio->submit_io) submit_bio(bio);
sdio->submit_io(bio, dio->inode, sdio->logical_offset_in_bio);
else
submit_bio(bio);
sdio->bio = NULL; sdio->bio = NULL;
sdio->boundary = 0; sdio->boundary = 0;
@ -1098,7 +1094,7 @@ static inline int drop_refcount(struct dio *dio)
ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
struct block_device *bdev, struct iov_iter *iter, struct block_device *bdev, struct iov_iter *iter,
get_block_t get_block, dio_iodone_t end_io, get_block_t get_block, dio_iodone_t end_io,
dio_submit_t submit_io, int flags) int flags)
{ {
unsigned i_blkbits = READ_ONCE(inode->i_blkbits); unsigned i_blkbits = READ_ONCE(inode->i_blkbits);
unsigned blkbits = i_blkbits; unsigned blkbits = i_blkbits;
@ -1215,7 +1211,6 @@ ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
sdio.get_block = get_block; sdio.get_block = get_block;
dio->end_io = end_io; dio->end_io = end_io;
sdio.submit_io = submit_io;
sdio.final_block_in_bio = -1; sdio.final_block_in_bio = -1;
sdio.next_block_for_io = -1; sdio.next_block_for_io = -1;

View File

@ -2463,7 +2463,7 @@ static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
return __blockdev_direct_IO(iocb, inode, inode->i_sb->s_bdev, return __blockdev_direct_IO(iocb, inode, inode->i_sb->s_bdev,
iter, get_block, iter, get_block,
ocfs2_dio_end_io, NULL, 0); ocfs2_dio_end_io, 0);
} }
const struct address_space_operations ocfs2_aops = { const struct address_space_operations ocfs2_aops = {

View File

@ -2780,7 +2780,7 @@ enum {
ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
struct block_device *bdev, struct iov_iter *iter, struct block_device *bdev, struct iov_iter *iter,
get_block_t get_block, get_block_t get_block,
dio_iodone_t end_io, dio_submit_t submit_io, dio_iodone_t end_io,
int flags); int flags);
static inline ssize_t blockdev_direct_IO(struct kiocb *iocb, static inline ssize_t blockdev_direct_IO(struct kiocb *iocb,
@ -2789,7 +2789,7 @@ static inline ssize_t blockdev_direct_IO(struct kiocb *iocb,
get_block_t get_block) get_block_t get_block)
{ {
return __blockdev_direct_IO(iocb, inode, inode->i_sb->s_bdev, iter, return __blockdev_direct_IO(iocb, inode, inode->i_sb->s_bdev, iter,
get_block, NULL, NULL, DIO_LOCKING | DIO_SKIP_HOLES); get_block, NULL, DIO_LOCKING | DIO_SKIP_HOLES);
} }
#endif #endif