From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B4434CE05 for ; Wed, 10 Jan 2024 18:46:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oexaswOe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1F64C43601; Wed, 10 Jan 2024 18:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704912383; bh=3sZbPwQ1UDxh+oBKPpBulcOz9IsZKopDz5c/h4RqvVk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oexaswOeYj231+q8yUaF6dGMg+w7AAMhf7FNRkBIQ5RVHMu97JCxUoXea50ZU2w2F Yr2UymtQlpcGHNKHo706AgTP2G7Tb0038NVs1lhc2w3C5TZpA9j7kQiRv/m9om23QC IgbjRjUaQZaV6frPUR3n91R/lGwNXL2hbvve87t6r2+KKwtNvJGifhWda3aPqDnTEO MTgg7mo9l/WCCGjOnRvXRCEXU6KL5xKl+BbNJMvNGLavzyy7FOmW1XXVnNxpVAjjXp vBrgCoxFRBwCzoyGdO0jyNH+AyCbcpg7ABRbSuXVcLTkmV/i0KN2V8PS99ELGwZHRc MDNAjSzqTD1KA== Date: Wed, 10 Jan 2024 11:46:21 -0700 From: Keith Busch To: Jens Axboe Cc: io-uring Subject: Re: [PATCH v2] io_uring/rw: cleanup io_rw_done() Message-ID: References: Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jan 10, 2024 at 11:38:02AM -0700, Jens Axboe wrote: > This originally came from the aio side, and it's laid out rather oddly. > The common case here is that we either get -EIOCBQUEUED from submitting > an async request, or that we complete the request correctly with the > given number of bytes. Handling the odd internal restart error codes > is not a common operation. > > Lay it out a bit more optimally that better explains the normal flow, > and switch to avoiding the indirect call completely as this is our > kiocb and we know the completion handler can only be one of two > possible variants. While at it, move it to where it belongs in the > file, with fellow end IO helpers. > > Outside of being easier to read, this also reduces the text size of the > function by 24 bytes for me on arm64. > > Signed-off-by: Jens Axboe Looks good! Reviewed-by: Keith Busch