lkml.org 
[lkml]   [2015]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 4/6] block: loop: prepare for supporing direct IO
> +	/*
> + * loop block's logical block size is 512, now
> + * we support direct I/O only if the backing
> + * block devices' minimize I/O size is 512 and
> + * the offset is aligned with 512.
> + */
> + if (dio) {
> + if (inode->i_sb->s_bdev &&
> + bdev_io_min(inode->i_sb->s_bdev) == 512 &&
> + !(lo->lo_offset & 511))

Why the hardcoded value? I suspect this should be more like:

if (dio && inode->i_sb->s_bdev &&
(lo->lo_offset & (bdev_io_min(inode->i_sb->s_bdev) - 1)) != 0)
dio = false;

> + blk_mq_freeze_queue(lo->lo_queue);
> + lo->use_dio = use_dio;
> + if (use_dio)
> + lo->lo_flags |= LO_FLAGS_DIRECT_IO;
> + else
> + lo->lo_flags &= ~LO_FLAGS_DIRECT_IO;
> + blk_mq_unfreeze_queue(lo->lo_queue);

Locking?


\
 
 \ /
  Last update: 2015-07-27 11:01    [W:0.095 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site