Re: [PATCH 07/19] block: simplify bio_map_kern

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

 



On Fri, May 02, 2025 at 03:56:08AM +0900, Damien Le Moal wrote:
> > -	unsigned long kaddr = (unsigned long)data;
> > -	unsigned long end = (kaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT;
> > -	unsigned long start = kaddr >> PAGE_SHIFT;
> > -	const int nr_pages = end - start;
> > -	bool is_vmalloc = is_vmalloc_addr(data);
> > -	struct page *page;
> > -	int offset, i;
> > +	unsigned int nr_vecs = bio_add_max_vecs(data, len);
> >  	struct bio *bio;
> >  
> > -	bio = bio_kmalloc(nr_pages, gfp_mask);
> > +	bio = bio_kmalloc(nr_vecs, gfp_mask);
> 
> This may also fail if nr_vecs is larger than UIO_MAXIOV, in which case, the
> ENOMEM error may not really be appropriate. I guess we can sort this out
> separately though.

Yeah.  It's also existing behavior, so no real change here.





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux