From: Alexander Graf Subject: Re: [PATCH 1/3] iov: Add 'offset' parameter to iov_to_buf() Date: Fri, 1 Jul 2011 10:11:52 +0200 Message-ID: References: <1309506172-17762-1-git-send-email-hare@suse.de> <1309506172-17762-2-git-send-email-hare@suse.de> <0709C61D-84CB-4CD2-803D-93CE3AD66888@suse.de> <4E0D803F.5060605@suse.de> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Cc: qemu-devel@nongnu.org, Paolo Bonzini , Stefan Haynoczi , kvm@vger.kernel.org To: Hannes Reinecke Return-path: Received: from cantor2.suse.de ([195.135.220.15]:42797 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754902Ab1GAILy convert rfc822-to-8bit (ORCPT ); Fri, 1 Jul 2011 04:11:54 -0400 In-Reply-To: <4E0D803F.5060605@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On 01.07.2011, at 10:07, Hannes Reinecke wrote: > On 07/01/2011 10:02 AM, Alexander Graf wrote: >> >> On 01.07.2011, at 09:42, Hannes Reinecke wrote: >> >>> Occasionally, the buffer needs to be placed at a offset within >>> the iovec when copying the buffer to the iovec. >> >> So this is a buffer into the iovec, right? Wouldn't it make sense > > to also modify iov_to_buf respectively then, so the API stays similar? > > Ahem. That's exactly what the patch does. Except from the mixed-up subject. > > iov_to_buff() has an offset parameter, iov_from_buf() has not. > For no obvious reasons. Ah, I see. Please state this in your patch description :). Makes it a lot easier to understand the rationale that you're merely moving the "from" API towards the same parameters as to "to" one. > >> Also, it'd be nice to give the parameter a more obvious name, so potential > > users can easily recognize what it offsets. >> > Yes, that sounds reasonable. > > What about 'iov_off' ? > (And possibly rename 'iovcnt' to 'iov_cnt' for consistency ?) Yup, that'd be a lot more readable :) Alex