Re: [RFC PATCH V11 09/21] Btrfs: subpagesize-blocksize: Direct I/O read: Work on sectorsized blocks.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 01 Jul 2015 22:45:00 Liu Bo wrote:
> On Mon, Jun 01, 2015 at 08:52:44PM +0530, Chandan Rajendra wrote:
> > The direct I/O read's endio and corresponding repair functions work on
> > page sized blocks. Fix this.
> > 
> > Signed-off-by: Chandan Rajendra <chandan@xxxxxxxxxxxxxxxxxx>
> > ---
> >  try_again:
> > @@ -7810,10 +7853,10 @@ try_again:
> >  		done.start = start;
> >  		init_completion(&done.done);
> > 
> > -		ret = dio_read_error(inode, &io_bio->bio, bvec->bv_page, 
start,
> > -				     start + bvec->bv_len - 1,
> > -				     io_bio->mirror_num,
> > -				     btrfs_retry_endio, &done);
> > +		ret = dio_read_error(inode, &io_bio->bio, bvec->bv_page,
> > +				pgoff, start, start + sectorsize - 1,
> > +				io_bio->mirror_num,
> > +				btrfs_retry_endio, &done);
> > 
> >  		if (ret) {
> >  		
> >  			err = ret;
> >  			goto next;
> > 
> > @@ -7826,8 +7869,13 @@ try_again:
> >  			goto try_again;
> >  		
> >  		}
> >  
> >  next:
> > -		offset += bvec->bv_len;
> > -		start += bvec->bv_len;
> > +		offset += sectorsize;
> > +		start += sectorsize;
> > +
> 
> It'd better to put a ASSERT(nr_sectors) in case some crazy things
> happen.
> 

Yes, I will add that statement in the future versions of the patchset.

> 
> > +		if (--nr_sectors) {
> > +			pgoff += sectorsize;
> > +			goto next_block;
> > +		}
> > 
> >  	}
> >  	
> >  	return err;

-- 
chandan

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux