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]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux