From 161345e7d1927c2e80f2ba69c344af41193113f3 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Fri, 11 May 2007 14:46:53 -0700 Subject: [PATCH] Use larger metadata blocks, and don't output type field twice. --- scandir.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scandir.cc b/scandir.cc index 702fce2..2570be5 100644 --- a/scandir.cc +++ b/scandir.cc @@ -33,6 +33,8 @@ static TarSegmentStore *tss = NULL; static const int LBS_BLOCK_SIZE = 1024 * 1024; static char *block_buf; +static const int LBS_METADATA_BLOCK_SIZE = 65536; + /* Contents of the root object. This will contain a set of indirect links to * the metadata objects. */ std::ostringstream metadata_root; @@ -263,13 +265,12 @@ void scanfile(const string& path) } file_info["type"] = string(1, inode_type); - metadata << "type: " << inode_type << "\n"; dict_output(metadata, file_info); metadata << "\n"; // Break apart metadata listing if it becomes too large. - if (metadata.str().size() > 4096) + if (metadata.str().size() > LBS_METADATA_BLOCK_SIZE) metadata_flush(); // If we hit a directory, now that we've written the directory itself, -- 2.20.1