lkml.org 
[lkml]   [2014]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 4/6] block: loop: say goodby to bio
From
On Sun, Aug 31, 2014 at 6:14 AM, Elliott, Robert (Server Storage)
<Elliott@hp.com> wrote:
>
>
>> -----Original Message-----
>> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
>> owner@vger.kernel.org] On Behalf Of Ming Lei
>> Sent: Saturday, 30 August, 2014 11:08 AM
>> To: Jens Axboe; linux-kernel@vger.kernel.org; Dave Kleikamp
>> Cc: Zach Brown; Christoph Hellwig; Maxim Patlasov; Ming Lei
>> Subject: [PATCH v2 4/6] block: loop: say goodby to bio
> ...
>> -static int do_bio_filebacked(struct loop_device *lo, struct bio
>> *bio)
>> +static int do_req_filebacked(struct loop_device *lo, struct request
>> *rq)
>> {
>> loff_t pos;
>> int ret;
>>
>> - pos = ((loff_t) bio->bi_iter.bi_sector << 9) + lo->lo_offset;
>> + pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset;
>>
>> - if (bio_rw(bio) == WRITE) {
>> + if (rq->cmd_flags & REQ_WRITE) {
>> struct file *file = lo->lo_backing_file;
>>
>> - if (bio->bi_rw & REQ_FLUSH) {
>> + if (rq->cmd_flags & REQ_FLUSH) {
>> ret = vfs_fsync(file, 0);
>> if (unlikely(ret && ret != -EINVAL)) {
>> ret = -EIO;
>> @@ -436,7 +439,7 @@ static int do_bio_filebacked(struct loop_device
>> *lo, struct bio *bio)
>> * encryption is enabled, because it may give an attacker
>> * useful information.
>> */
>> - if (bio->bi_rw & REQ_DISCARD) {
>> + if (rq->cmd_flags & REQ_DISCARD) {
>> struct file *file = lo->lo_backing_file;
>> int mode = FALLOC_FL_PUNCH_HOLE |
>> FALLOC_FL_KEEP_SIZE;
>
> Can a REQ_WRITE_SAME make it through to here?

It can't because loop doesn't support WRITE_SAME.


Thanks,
--
Ming Lei


\
 
 \ /
  Last update: 2014-09-01 07:01    [W:0.051 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site