From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A593EB64D9 for ; Tue, 27 Jun 2023 11:08:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230444AbjF0LIk (ORCPT ); Tue, 27 Jun 2023 07:08:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbjF0LIh (ORCPT ); Tue, 27 Jun 2023 07:08:37 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91D6B1BE8; Tue, 27 Jun 2023 04:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aiHsdcFdbTne0FqDQT/At35HF+CebE5/fvRBdL3jClE=; b=e1JCm0AVlzhQRuuH7L20hP1en/ mmmXaECSpteaMbbsjANEEOmcPHi7jaWDKqXSoBko4ELgk5SjkY0k/Dm/tpvZ7xFqJlv0DVN3HOxSm EdK7jGPSMQV0ikV5BZZUQ7aU7glxBrMqX/itX1usITYtxc78qpuGlqRw8jVrJFb8/pBJfinfIyA8d fQgmib4k2bgEMIDOmp7Cxb4noKr76/9CzA/oDJekzBQWF62f7y2uePqVi5CBVBsGufdRLW5XieA5p +UDJnjCpzHbRWILEhJPwP6Xju8HkfNqymNy4sklauET7ON/xQ+1iVQyj/862p8g5jaeh1KEj/33/P 5DaKqISQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qE6Yg-002eID-H1; Tue, 27 Jun 2023 11:08:30 +0000 Date: Tue, 27 Jun 2023 12:08:30 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , David Howells Subject: Re: [PATCH 07/12] writeback: Factor writeback_iter_init() out of write_cache_pages() Message-ID: References: <20230626173521.459345-1-willy@infradead.org> <20230626173521.459345-8-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 26, 2023 at 09:31:56PM -0700, Christoph Hellwig wrote: > On Mon, Jun 26, 2023 at 09:30:07PM -0700, Christoph Hellwig wrote: > > On Mon, Jun 26, 2023 at 06:35:16PM +0100, Matthew Wilcox (Oracle) wrote: > > > + for (folio = writeback_iter_init(mapping, wbc); > > > + folio; > > > + folio = writeback_get_next(mapping, wbc)) { > > > > Ok that's another way to structure it. Guess I should look over the > > whole series first.. Perhaps ... it's a little hard to decide which of your comments are worth replying to, and which are obviated by later realisations. > That beeing said. Given that writeback_iter_init calls > writeback_get_next anyway, > > writeback_iter_init(mapping, wbc); > while ((folio = writeback_get_next(mapping, wbc))) > > still feels a little easier to follow to be. No hard feelings either > way, just an observation. I had it structured that way originally, but we need to pass in 'error' to the get_next, and it's better if we also pass in 'folio', which means that the user then needs to initialise error to 0 and folio to NULL before using the macro, and that all felt a bit "You're holding it wrong".