From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 8 May 2019 15:36:18 +0200 From: Cornelia Huck Subject: Re: [PATCH 3/7] s390/cio: Split pfn_array_alloc_pin into pieces Message-ID: <20190508153618.3ff9174f.cohuck@redhat.com> In-Reply-To: <15e733fc-e6eb-176e-e9bd-3f7629d5f935@linux.ibm.com> References: <20190503134912.39756-1-farman@linux.ibm.com> <20190503134912.39756-4-farman@linux.ibm.com> <20190508124327.5c496c8a.cohuck@redhat.com> <15e733fc-e6eb-176e-e9bd-3f7629d5f935@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: kvm-owner@vger.kernel.org List-Archive: List-Post: To: Eric Farman Cc: Farhan Ali , Halil Pasic , Pierre Morel , linux-s390@vger.kernel.org, kvm@vger.kernel.org List-ID: On Wed, 8 May 2019 09:25:57 -0400 Eric Farman wrote: > On 5/8/19 6:43 AM, Cornelia Huck wrote: > > On Fri, 3 May 2019 15:49:08 +0200 > > Eric Farman 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!