Re: [PATCH 3/7] s390/cio: Split pfn_array_alloc_pin into pieces

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

 



On Wed, 8 May 2019 09:25:57 -0400
Eric Farman <farman@xxxxxxxxxxxxx> wrote:

> On 5/8/19 6:43 AM, Cornelia Huck wrote:
> > On Fri,  3 May 2019 15:49:08 +0200
> > Eric Farman <farman@xxxxxxxxxxxxx> wrote:

> >> +/*
> >> + * pfn_array_pin() - Pin user pages in memory
> >> + * @pa: pfn_array on which to perform the operation
> >> + * @mdev: the mediated device to perform pin operations
> >> + *
> >> + * Returns:
> >> + *   Number of pages pinned on success.
> >> + *   If fewer pages than requested were pinned, returns -EINVAL
> >> + *   If no pages were pinned, returns -errno.  
> > 
> > I don't really like the 'returns -errno' :) It's actually the return
> > code of vfio_pin_pages(), and that might include -EINVAL as well.
> > 
> > So, what about mentioning in the function description that
> > pfn_array_pin() only succeeds if it coult pin all pages, and simply
> > stating that it returns a negative error value on failure?  
> 
> Seems reasonable to me...  Something like:
> 
>   * Returns number of pages pinned upon success.
>   * If the pin request partially succeeds, or fails completely,
>   * all pages are left unpinned and a negative error value is returned.

Sounds good to me!



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux