From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id D2C9B1F47C for ; Thu, 19 Jan 2023 02:07:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbjASCHd (ORCPT ); Wed, 18 Jan 2023 21:07:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbjASCHc (ORCPT ); Wed, 18 Jan 2023 21:07:32 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 042FA51428 for ; Wed, 18 Jan 2023 18:07:29 -0800 (PST) Received: (qmail 5650 invoked by uid 109); 19 Jan 2023 02:07:29 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 19 Jan 2023 02:07:29 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 28045 invoked by uid 111); 19 Jan 2023 02:07:31 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Wed, 18 Jan 2023 21:07:31 -0500 Authentication-Results: peff.net; auth=none Date: Wed, 18 Jan 2023 21:07:27 -0500 From: Jeff King To: Taylor Blau Cc: git@vger.kernel.org, =?utf-8?B?UmVuw6k=?= Scharfe , =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Subject: Re: [PATCH 5/6] fsck: provide a function to fsck buffer without object struct Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Jan 18, 2023 at 04:24:25PM -0500, Taylor Blau wrote: > On Wed, Jan 18, 2023 at 03:43:53PM -0500, Jeff King wrote: > > However, the only external interface that fsck.c provides is > > fsck_object(), which requires an object struct, then promptly discards > > everything except its oid and type. Let's factor out the post-discard > > part of that function as fsck_buffer(), leaving fsck_object() as a thin > > wrapper around it. That will provide more flexibility for callers which > > may not have a struct. > > It's really nice that the only thing we care about having an object > struct around for is basically just knowing its type. IOW it seems to > have made the refactoring here pretty straightforward, which is nice > ;-). Yeah, it was always in the back of my mind while doing other fsck refactors. But I have to admit that I was surprised that we were so close to the finish line. :) -Peff