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 F3003C7EE37 for ; Mon, 12 Jun 2023 13:22:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236081AbjFLNWb (ORCPT ); Mon, 12 Jun 2023 09:22:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236047AbjFLNW2 (ORCPT ); Mon, 12 Jun 2023 09:22:28 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E11F1E3; Mon, 12 Jun 2023 06:22:25 -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=/GSu6OVQs0ltyUd2o+Wvf2F1RPuhTpCI5GZst/CgoWE=; b=s1CFIqLhF/DB1BpvQzWxqDwi2X gBexhrVublgN5U9q9QOFWR+YkEpXhMQ0mdKamThcL8EvmOh3bMk+z0Iby+EXS+AhB245ILWc5aTk8 1WJOlgRPEsLLuTtsSEJNCg8yQhs6po/CNCx5zliRw0RlYpwR2WOHalttAfgd4/vVhKwxbqTWGPXMK td6JvZ3Gt4i3ipbwviF7P7ZUeHmSb8+BvpOavFh8qc9QGRxlpYldphrXWBGMggk42xvn4FptZmqJq +504Lc+nBVkjvGBi5/IbEQXPs6cNjFjU1xy6njHjYwrR7l/LYepJcY8lKkDvXETGjRSU5k3IyQ/tP fcNPTYuQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1q8hV0-002fOh-B5; Mon, 12 Jun 2023 13:22:22 +0000 Date: Mon, 12 Jun 2023 14:22:22 +0100 From: Matthew Wilcox To: "Ritesh Harjani (IBM)" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , "Darrick J. Wong" , Dave Chinner , Brian Foster , Andreas Gruenbacher , Ojaswin Mujoo , Disha Goel Subject: Re: [PATCHv9 4/6] iomap: Refactor iomap_write_delalloc_punch() function out Message-ID: References: <62950460a9e78804df28c548327d779a8d53243f.1686395560.git.ritesh.list@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62950460a9e78804df28c548327d779a8d53243f.1686395560.git.ritesh.list@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sat, Jun 10, 2023 at 05:09:05PM +0530, Ritesh Harjani (IBM) wrote: > +static int iomap_write_delalloc_punch(struct inode *inode, struct folio *folio, > + loff_t *punch_start_byte, loff_t start_byte, loff_t end_byte, > + int (*punch)(struct inode *inode, loff_t offset, loff_t length)) I can't help but feel that a typedef iomap_punch_t(struct inode *, loff_t offset, loff_t length); would make all of this easier to read. > + /* > + * Make sure the next punch start is correctly bound to > + * the end of this data range, not the end of the folio. > + */ > + *punch_start_byte = min_t(loff_t, end_byte, > + folio_next_index(folio) << PAGE_SHIFT); *punch_start_byte = min(end_byte, folio_pos(folio) + folio_size(folio));