Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753108AbeAJVT6 (ORCPT + 1 other); Wed, 10 Jan 2018 16:19:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48686 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbeAJVT4 (ORCPT ); Wed, 10 Jan 2018 16:19:56 -0500 From: Jeff Moyer To: Christoph Hellwig Cc: viro@zeniv.linux.org.uk, Avi Kivity , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 26/32] aio: refactor read/write iocb setup References: <20180110155853.32348-1-hch@lst.de> <20180110155853.32348-27-hch@lst.de> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Wed, 10 Jan 2018 16:19:53 -0500 In-Reply-To: <20180110155853.32348-27-hch@lst.de> (Christoph Hellwig's message of "Wed, 10 Jan 2018 16:58:47 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 10 Jan 2018 21:19:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Christoph Hellwig writes: > Don't reference the kiocb structure from the common aio code, and move > any use of it into helper specific to the read/write path. This is in > preparation for aio_poll support that wants to use the space for different > fields. > > Signed-off-by: Christoph Hellwig I think this all looks okay (making sure everything was still cleaned up in the error cases was a bit of a chore). One nit below. > +static int aio_prep_rw(struct kiocb *req, struct iocb *iocb) > +{ > + int ret; > + > + req->ki_filp = fget(iocb->aio_fildes); > + if (unlikely(!req->ki_filp)) > + return -EBADF; > + req->ki_complete = aio_complete_rw; > + req->ki_flags = 0; The above assignment seems superfluous... > + req->ki_pos = iocb->aio_offset; > + req->ki_flags = iocb_flags(req->ki_filp); because of this. Acked-by: Jeff Moyer