From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.137.202.133 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796113886; b=gYWYi6JT+SzMVUpooLY0SzgNYJRwmAENpJ730LW1+JK/VdCMrHwJw/2YBgCzIy17FTXT plFTpYbN45BPxV2IszwK3DUG2Ifo52TM4eqz/QguIX+HPinA5SS3xpR3NP8RwIS45K8/f mGtHr5xjhJTkyc/v/IxeBwgThv/LQDvcpMqmtavHUOJiZaGX/nWXRVVGJvRWJIYuDt7c3 NHxpdr2CvuSxwXYP0nd+cTYFUIOJCy/QqXQe0zTrRT2qpTqUSBStY9r/wpM5b51XR+Qvp PXRynr+ptefRCQn/OfHPlDuVhF21gDRt+TSHatex0Uv6XAgTQcMU5FohPlRNcgC6WyA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796113886; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To:X-SRS-Rewrite; bh=qMXnv1iG2T8bq0R2P1FDWoWhUdmehDKkrfBzNY10exE=; b=OTTdxSYLeJO7h/8Ya24D3jYSRGtp+uwNzueZv5B2zjPPIfOjX+4MFOpgi3aaFiYELcxV b/wjyeqOQa8Ln1+qyAFhpk1wrHEdD5uMnct3FrFPt3/Qp4rz1WwRls1h5QomgxzBcJvai HZ/POvGpOCmU7AmvwpSzEfHDQFfMMan6zhCZq9Eb2zrpGKgK1GmA/bwY04SjieDMfoBUj 9OOP3QnMn2ivW90ZzVwfpy+oYHntvhq33XK8gPknZAJbmCuhH0eWcmUgOKTb4FnmBbxa1 A8w6HtLP+6JAL4bdNwXS64X/z4l2Y/gkwdQYOYlY8mSbS2StPLhPlMBTGpl8eAbqZ5Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=cxa1PzVm; arc=none smtp.remote-ip=198.137.202.133 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37398606A31A; Tue, 1 Dec 2026 08:31:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 37398606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=cxa1PzVm DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=qMXnv1iG2T8bq0R2P1FDWoWhUdmehDKkrfBzNY10exE=; b=cxa1PzVmIY+uAF69qhZxz8PzsL 5UFgT9AjWh8U0xmHe0yxIFGDu/bfDrsVcoPm3BIAHpw2AukiBY2tT2xdisZkNGiAXkbe9jKrEJe38 KPuRBj4I/sGvOfSyCp9IR7kQwbEkrHPZr2Xnrq/Ea5Y5YbO0k12majHDF7fmNbkEp+BBkvaUjwOUR EUSx0a5L+NInPyAaT/nIyIXnQPULKuRZ0ZMuckrjjl9RVYMuj/5bO2XJ2hH/AFKjD6TL9phLdYE22 PFJgYrYij3yIKv2rM25oPztQxoWj0G1vuSCjsmCiwYRcpje9JPd5DTLDVTU+dmq2mS8eBGnoi95k5 6ZoKqPqw==; Received: from hch by bombadil.infradead.org with local (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYJGm-000000071Ry-0Mgz; Tue, 01 Dec 2026 08:31:24 +0000 Date: Tue, 1 Dec 2026 00:31:24 -0800 From: Christoph Hellwig To: zhangshida2026@163.com Cc: Carlos Maiolino , "Darrick J . Wong" , Christoph Hellwig , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, Shida Zhang Subject: Re: [PATCH v3 2/2] xfs: optimize getfsmap by reusing and advancing the refcount cursor Message-ID: References: <20261201074947.3338021-1-zhangshida2026@163.com> <20261201074947.3338021-3-zhangshida2026@163.com> X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261201074947.3338021-3-zhangshida2026@163.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, Dec 01, 2026 at 03:49:47PM +0800, zhangshida2026@163.com wrote: > > + bool rc_done; /* no more shared records to find */ overly long line. Just stip the "to find". > static void > xfs_getfsmap_del_cursors( > - struct xfs_btree_cur *bt_cur, > - int error) > + struct xfs_getfsmap_info *info, > + struct xfs_btree_cur *bt_cur, > + int error) As pointed out last time, please just put the final alignment in place in the previous patch instead of the churn here. > + /* Advance to the first record that ends after agbno. */ > + while (rc->rc_startblock + rc->rc_blockcount <= agbno) { > + error = xfs_btree_increment(info->refcount_cur, 0, &have); > + if (error) > + goto out_error; > + if (!have) { > + info->rc_done = true; > + return 0; > + } > + error = xfs_refcount_get_rec(info->refcount_cur, &info->rc_cur, &i); Overly long line. > + if (error) > + goto out_error; > + if (XFS_IS_CORRUPT(mp, i != 1)) { > + xfs_btree_mark_sick(info->refcount_cur); > + error = -EFSCORRUPTED; > + goto out_error; > + } > + } > > - *stat = flen > 0; > + /* Shared iff this SHARED record overlaps the query range. */ > + if (rc->rc_domain == XFS_REFC_DOMAIN_SHARED && > + rc->rc_startblock < agbno + XFS_BB_TO_FSBT(mp, frec->len_daddr)) As point out by Sashiko last round, the iteration above should just break out once the record isn't in the shared domain, saving potentially pointless iteration‥