Re: [PATCH] block: fix splitting segments

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

 



> +static inline unsigned get_max_segment_size(const struct request_queue *q,
> +					    const struct page *start_page,
> +					    unsigned long offset)
>  {
>  	unsigned long mask = queue_segment_boundary(q);
>  
> -	/* default segment boundary mask means no boundary limit */
> -	if (mask == BLK_SEG_BOUNDARY_MASK)
> -		return queue_max_segment_size(q);
> -
> -	return min_t(unsigned long, mask - (mask & offset) + 1,
> +	offset = mask & (page_to_phys(start_page) + offset);

This looks weird and potentionaly incorrect - once you add the offset
to page_phys it really isn't an offset anymore and should be in a
variable named paddr or similar.  And that needs to use a phys_addr_t
as we can have 32-bit architectures that use 64-bit physical addresses.

I'd also pass in the actual phys_addr_t instead of the page and offset.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux