{
struct file *file = iocb->ki_filp;
struct block_device *bdev = I_BDEV(bdev_file_inode(file));
- unsigned blkbits = blksize_bits(bdev_logical_block_size(bdev));
struct bio_vec inline_vecs[DIO_INLINE_BIO_VECS], *vecs, *bvec;
loff_t pos = iocb->ki_pos;
bool should_dirty = false;
blk_qc_t qc;
int i;
- if ((pos | iov_iter_alignment(iter)) & ((1 << blkbits) - 1))
+ if ((pos | iov_iter_alignment(iter)) &
+ (bdev_logical_block_size(bdev) - 1))
return -EINVAL;
if (nr_pages <= DIO_INLINE_BIO_VECS)
struct file *file = iocb->ki_filp;
struct inode *inode = bdev_file_inode(file);
struct block_device *bdev = I_BDEV(inode);
- unsigned blkbits = blksize_bits(bdev_logical_block_size(bdev));
struct blkdev_dio *dio;
struct bio *bio;
bool is_read = (iov_iter_rw(iter) == READ);
blk_qc_t qc = BLK_QC_T_NONE;
int ret;
- if ((pos | iov_iter_alignment(iter)) & ((1 << blkbits) - 1))
+ if ((pos | iov_iter_alignment(iter)) &
+ (bdev_logical_block_size(bdev) - 1))
return -EINVAL;
bio = bio_alloc_bioset(GFP_KERNEL, nr_pages, blkdev_dio_pool);