From patchwork Sat Jan 7 13:48:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 13092171 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 D2F71C46467 for ; Sat, 7 Jan 2023 13:49:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231867AbjAGNs7 (ORCPT ); Sat, 7 Jan 2023 08:48:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbjAGNs5 (ORCPT ); Sat, 7 Jan 2023 08:48:57 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D93C6144A for ; Sat, 7 Jan 2023 05:48:56 -0800 (PST) Received: (qmail 23483 invoked by uid 109); 7 Jan 2023 13:48:55 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sat, 07 Jan 2023 13:48:55 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23772 invoked by uid 111); 7 Jan 2023 13:48:55 -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; Sat, 07 Jan 2023 08:48:55 -0500 Authentication-Results: peff.net; auth=none Date: Sat, 7 Jan 2023 08:48:55 -0500 From: Jeff King To: git@vger.kernel.org Cc: Jonathan Tan Subject: [PATCH 1/5] object-file: inline calls to read_object() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Since read_object() is these days just a thin wrapper around oid_object_info_extended(), and since it only has two callers, let's just inline those calls. This has a few positive outcomes: - it's a net reduction in source code lines - even though the callers end up with a few extra lines, they're now more flexible and can use object_info flags directly. So no more need to convert die_if_corrupt between parameter/flag, and we can ask for lookup replacement with a flag rather than doing it ourselves. - there's one fewer function in an already crowded namespace (e.g., the difference between read_object() and read_object_file() was not immediately obvious; now we only have one of them). Signed-off-by: Jeff King --- object-file.c | 45 +++++++++++++++++---------------------------- object-store.h | 2 +- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/object-file.c b/object-file.c index 80a0cd3b35..ed1babbac2 100644 --- a/object-file.c +++ b/object-file.c @@ -1671,23 +1671,6 @@ int oid_object_info(struct repository *r, return type; } -static void *read_object(struct repository *r, - const struct object_id *oid, enum object_type *type, - unsigned long *size, - int die_if_corrupt) -{ - struct object_info oi = OBJECT_INFO_INIT; - void *content; - oi.typep = type; - oi.sizep = size; - oi.contentp = &content; - - if (oid_object_info_extended(r, oid, &oi, die_if_corrupt - ? OBJECT_INFO_DIE_IF_CORRUPT : 0) < 0) - return NULL; - return content; -} - int pretend_object_file(void *buf, unsigned long len, enum object_type type, struct object_id *oid) { @@ -1709,25 +1692,28 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type, /* * This function dies on corrupt objects; the callers who want to - * deal with them should arrange to call read_object() and give error - * messages themselves. + * deal with them should arrange to call oid_object_info_extended() and give + * error messages themselves. */ void *read_object_file_extended(struct repository *r, const struct object_id *oid, enum object_type *type, unsigned long *size, int lookup_replace) { + struct object_info oi = OBJECT_INFO_INIT; + unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT; void *data; - const struct object_id *repl = lookup_replace ? - lookup_replace_object(r, oid) : oid; - errno = 0; - data = read_object(r, repl, type, size, 1); - if (data) - return data; + oi.typep = type; + oi.sizep = size; + oi.contentp = &data; + if (lookup_replace) + flags |= OBJECT_INFO_LOOKUP_REPLACE; + if (oid_object_info_extended(r, oid, &oi, flags)) + return NULL; - return NULL; + return data; } void *read_object_with_reference(struct repository *r, @@ -2255,15 +2241,18 @@ int force_object_loose(const struct object_id *oid, time_t mtime) { void *buf; unsigned long len; + struct object_info oi = OBJECT_INFO_INIT; enum object_type type; char hdr[MAX_HEADER_LEN]; int hdrlen; int ret; if (has_loose_object(oid)) return 0; - buf = read_object(the_repository, oid, &type, &len, 0); - if (!buf) + oi.typep = &type; + oi.sizep = &len; + oi.contentp = &buf; + if (oid_object_info_extended(the_repository, oid, &oi, 0)) return error(_("cannot read object for %s"), oid_to_hex(oid)); hdrlen = format_object_header(hdr, sizeof(hdr), type, len); ret = write_loose_object(oid, hdr, hdrlen, buf, len, mtime, 0); diff --git a/object-store.h b/object-store.h index 98c1d67946..f0aa03bbb9 100644 --- a/object-store.h +++ b/object-store.h @@ -358,7 +358,7 @@ void assert_oid_type(const struct object_id *oid, enum object_type expect); /* * Enabling the object read lock allows multiple threads to safely call the * following functions in parallel: repo_read_object_file(), read_object_file(), - * read_object_file_extended(), read_object_with_reference(), read_object(), + * read_object_file_extended(), read_object_with_reference(), * oid_object_info() and oid_object_info_extended(). * * obj_read_lock() and obj_read_unlock() may also be used to protect other From patchwork Sat Jan 7 13:49:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 13092172 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 AFA14C46467 for ; Sat, 7 Jan 2023 13:49:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232200AbjAGNtT (ORCPT ); Sat, 7 Jan 2023 08:49:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbjAGNtR (ORCPT ); Sat, 7 Jan 2023 08:49:17 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 547EB61450 for ; Sat, 7 Jan 2023 05:49:16 -0800 (PST) Received: (qmail 23490 invoked by uid 109); 7 Jan 2023 13:49:15 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sat, 07 Jan 2023 13:49:15 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23785 invoked by uid 111); 7 Jan 2023 13:49:15 -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; Sat, 07 Jan 2023 08:49:15 -0500 Authentication-Results: peff.net; auth=none Date: Sat, 7 Jan 2023 08:49:15 -0500 From: Jeff King To: git@vger.kernel.org Cc: Jonathan Tan Subject: [PATCH 2/5] streaming: inline call to read_object_file_extended() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The open_istream_incore() function is the only direct user of read_object_file_extended(), and the only caller which unsets the lookup_replace flag. Since read_object_file_extended() is now just a thin wrapper around oid_object_info_extended(), let's inline the call. That will let us simplify read_object_file_extended() in the next patch. The inlined version here is a few more lines because of the query setup, but it's much more flexible, since we can pass (or omit) any flags we want. Note the updated comment in the istream struct definition. It was already slightly wrong (we never called read_object(); it has been read_object_file_extended() since day one), but should now be accurate. Signed-off-by: Jeff King --- streaming.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/streaming.c b/streaming.c index 7b2f8b2b93..27841dc1d9 100644 --- a/streaming.c +++ b/streaming.c @@ -38,7 +38,7 @@ struct git_istream { union { struct { - char *buf; /* from read_object() */ + char *buf; /* from oid_object_info_extended() */ unsigned long read_ptr; } incore; @@ -388,12 +388,17 @@ static ssize_t read_istream_incore(struct git_istream *st, char *buf, size_t sz) static int open_istream_incore(struct git_istream *st, struct repository *r, const struct object_id *oid, enum object_type *type) { - st->u.incore.buf = read_object_file_extended(r, oid, type, &st->size, 0); + struct object_info oi = OBJECT_INFO_INIT; + st->u.incore.read_ptr = 0; st->close = close_istream_incore; st->read = read_istream_incore; - return st->u.incore.buf ? 0 : -1; + oi.typep = type; + oi.sizep = &st->size; + oi.contentp = (void **)&st->u.incore.buf; + return oid_object_info_extended(r, oid, &oi, + OBJECT_INFO_DIE_IF_CORRUPT); } /***************************************************************************** From patchwork Sat Jan 7 13:50:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 13092173 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 5CAFBC54EBC for ; Sat, 7 Jan 2023 13:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232397AbjAGNuW (ORCPT ); Sat, 7 Jan 2023 08:50:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbjAGNuV (ORCPT ); Sat, 7 Jan 2023 08:50:21 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 701415DE56 for ; Sat, 7 Jan 2023 05:50:20 -0800 (PST) Received: (qmail 23506 invoked by uid 109); 7 Jan 2023 13:50:19 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sat, 07 Jan 2023 13:50:19 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23817 invoked by uid 111); 7 Jan 2023 13:50:19 -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; Sat, 07 Jan 2023 08:50:19 -0500 Authentication-Results: peff.net; auth=none Date: Sat, 7 Jan 2023 08:50:19 -0500 From: Jeff King To: git@vger.kernel.org Cc: Jonathan Tan Subject: [PATCH 3/5] read_object_file_extended(): drop lookup_replace option Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Our sole caller always passes in "1", so we can just drop the parameter entirely. Anybody who doesn't want this behavior could easily call oid_object_info_extended() themselves, as we're just a thin wrapper around it. Signed-off-by: Jeff King --- object-file.c | 7 ++----- object-store.h | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/object-file.c b/object-file.c index ed1babbac2..f472f2d6a0 100644 --- a/object-file.c +++ b/object-file.c @@ -1698,18 +1698,15 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type, void *read_object_file_extended(struct repository *r, const struct object_id *oid, enum object_type *type, - unsigned long *size, - int lookup_replace) + unsigned long *size) { struct object_info oi = OBJECT_INFO_INIT; - unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT; + unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT | OBJECT_INFO_LOOKUP_REPLACE; void *data; oi.typep = type; oi.sizep = size; oi.contentp = &data; - if (lookup_replace) - flags |= OBJECT_INFO_LOOKUP_REPLACE; if (oid_object_info_extended(r, oid, &oi, flags)) return NULL; diff --git a/object-store.h b/object-store.h index f0aa03bbb9..6ccacc947b 100644 --- a/object-store.h +++ b/object-store.h @@ -244,13 +244,13 @@ void *map_loose_object(struct repository *r, const struct object_id *oid, void *read_object_file_extended(struct repository *r, const struct object_id *oid, enum object_type *type, - unsigned long *size, int lookup_replace); + unsigned long *size); static inline void *repo_read_object_file(struct repository *r, const struct object_id *oid, enum object_type *type, unsigned long *size) { - return read_object_file_extended(r, oid, type, size, 1); + return read_object_file_extended(r, oid, type, size); } #ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS #define read_object_file(oid, type, size) repo_read_object_file(the_repository, oid, type, size) From patchwork Sat Jan 7 13:50:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 13092174 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 2ECB4C46467 for ; Sat, 7 Jan 2023 13:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232470AbjAGNug (ORCPT ); Sat, 7 Jan 2023 08:50:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbjAGNuf (ORCPT ); Sat, 7 Jan 2023 08:50:35 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9947C61462 for ; Sat, 7 Jan 2023 05:50:34 -0800 (PST) Received: (qmail 23512 invoked by uid 109); 7 Jan 2023 13:50:34 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sat, 07 Jan 2023 13:50:34 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23821 invoked by uid 111); 7 Jan 2023 13:50:34 -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; Sat, 07 Jan 2023 08:50:34 -0500 Authentication-Results: peff.net; auth=none Date: Sat, 7 Jan 2023 08:50:33 -0500 From: Jeff King To: git@vger.kernel.org Cc: Jonathan Tan Subject: [PATCH 4/5] repo_read_object_file(): stop wrapping read_object_file_extended() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The only caller of read_object_file_extended() is the thin wrapper of repo_read_object_file(). Instead of wrapping, let's just rename the inner function and let people call it directly. This cleans up the namespace and reduces confusion. Signed-off-by: Jeff King --- object-file.c | 8 ++++---- object-store.h | 18 +++++------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/object-file.c b/object-file.c index f472f2d6a0..80b08fc389 100644 --- a/object-file.c +++ b/object-file.c @@ -1695,10 +1695,10 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type, * deal with them should arrange to call oid_object_info_extended() and give * error messages themselves. */ -void *read_object_file_extended(struct repository *r, - const struct object_id *oid, - enum object_type *type, - unsigned long *size) +void *repo_read_object_file(struct repository *r, + const struct object_id *oid, + enum object_type *type, + unsigned long *size) { struct object_info oi = OBJECT_INFO_INIT; unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT | OBJECT_INFO_LOOKUP_REPLACE; diff --git a/object-store.h b/object-store.h index 6ccacc947b..1a713d89d7 100644 --- a/object-store.h +++ b/object-store.h @@ -241,17 +241,10 @@ const char *loose_object_path(struct repository *r, struct strbuf *buf, void *map_loose_object(struct repository *r, const struct object_id *oid, unsigned long *size); -void *read_object_file_extended(struct repository *r, - const struct object_id *oid, - enum object_type *type, - unsigned long *size); -static inline void *repo_read_object_file(struct repository *r, - const struct object_id *oid, - enum object_type *type, - unsigned long *size) -{ - return read_object_file_extended(r, oid, type, size); -} +void *repo_read_object_file(struct repository *r, + const struct object_id *oid, + enum object_type *type, + unsigned long *size); #ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS #define read_object_file(oid, type, size) repo_read_object_file(the_repository, oid, type, size) #endif @@ -358,8 +351,7 @@ void assert_oid_type(const struct object_id *oid, enum object_type expect); /* * Enabling the object read lock allows multiple threads to safely call the * following functions in parallel: repo_read_object_file(), read_object_file(), - * read_object_file_extended(), read_object_with_reference(), - * oid_object_info() and oid_object_info_extended(). + * read_object_with_reference(), oid_object_info() and oid_object_info_extended(). * * obj_read_lock() and obj_read_unlock() may also be used to protect other * section which cannot execute in parallel with object reading. Since the used From patchwork Sat Jan 7 13:50:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 13092175 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 E82BCC46467 for ; Sat, 7 Jan 2023 13:51:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232207AbjAGNu7 (ORCPT ); Sat, 7 Jan 2023 08:50:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230350AbjAGNu4 (ORCPT ); Sat, 7 Jan 2023 08:50:56 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3F0665ACB for ; Sat, 7 Jan 2023 05:50:54 -0800 (PST) Received: (qmail 23524 invoked by uid 109); 7 Jan 2023 13:50:54 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sat, 07 Jan 2023 13:50:54 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23825 invoked by uid 111); 7 Jan 2023 13:50:54 -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; Sat, 07 Jan 2023 08:50:54 -0500 Authentication-Results: peff.net; auth=none Date: Sat, 7 Jan 2023 08:50:53 -0500 From: Jeff King To: git@vger.kernel.org Cc: Jonathan Tan Subject: [PATCH 5/5] packfile: inline custom read_object() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org When the pack code was split into its own file[1], it got a copy of the static read_object() function. But there's only one caller here, so we could just inline it. And it's worth doing so, as the name read_object() invites comparisons to the public read_object_file(), but the two don't behave quite the same. [1] The move happened over several commits, but the relevant one here is f1d8130be0 (pack: move clear_delta_base_cache(), packed_object_info(), unpack_entry(), 2017-08-18). Signed-off-by: Jeff King --- packfile.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/packfile.c b/packfile.c index c0d7dd93f4..79e21ab18e 100644 --- a/packfile.c +++ b/packfile.c @@ -1650,22 +1650,6 @@ struct unpack_entry_stack_ent { unsigned long size; }; -static void *read_object(struct repository *r, - const struct object_id *oid, - enum object_type *type, - unsigned long *size) -{ - struct object_info oi = OBJECT_INFO_INIT; - void *content; - oi.typep = type; - oi.sizep = size; - oi.contentp = &content; - - if (oid_object_info_extended(r, oid, &oi, 0) < 0) - return NULL; - return content; -} - void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset, enum object_type *final_type, unsigned long *final_size) { @@ -1798,14 +1782,22 @@ void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset, uint32_t pos; struct object_id base_oid; if (!(offset_to_pack_pos(p, obj_offset, &pos))) { + struct object_info oi = OBJECT_INFO_INIT; + nth_packed_object_id(&base_oid, p, pack_pos_to_index(p, pos)); error("failed to read delta base object %s" " at offset %"PRIuMAX" from %s", oid_to_hex(&base_oid), (uintmax_t)obj_offset, p->pack_name); mark_bad_packed_object(p, &base_oid); - base = read_object(r, &base_oid, &type, &base_size); + + oi.typep = &type; + oi.sizep = &base_size; + oi.contentp = &base; + if (oid_object_info_extended(r, &base_oid, &oi, 0) < 0) + base = NULL; + external_base = base; } }