Commit Graph

228 Commits

Author SHA1 Message Date
Colin Walters 193f5c16f2 core: Convert some functions to new code style
Not doing the whole file since it's big, these are some simple ones to keep
momentum up.

Closes: #753
Approved by: jlebon
2017-03-23 19:45:33 +00:00
Colin Walters 4cf210b128 Bump libglnx, port a few callers to new error API
Testing out the waters here. I think we should roll this into any future code
cleanup reworking we do.

Closes: #747
Approved by: jlebon
2017-03-22 16:04:58 +00:00
Colin Walters df5cbc9be9 core: Support building with OpenSSL for checksums
Add an OpenSSL backend to the checksum input stream, which is where we do a lot
of checksumming (object commit, static deltas).

The raw OpenSSL performance is
[approximately double](https://gist.github.com/cgwalters/169349fd1c06fd4fb4d3a7ce33303222) on
my laptop; not only does OpenSSL have e.g. hand-tuned x86_64 assembly, the
current implementation uses the
[Intel SHA extensions](https://en.wikipedia.org/wiki/Intel_SHA_extensions).

Another reason to do this is I was idly thinking about adding
[Curve25519](https://en.wikipedia.org/wiki/Curve25519) signatures (like e.g.
Alpine does) instead of/in addition to GPG.  The rationale for that is
that GPG is pretty heavyweight, both in code footprint and the simple
fact that EC keys are way smaller.

I didn't benchmark ostree with this; we have bigger performance problems
really like the fact we just malloc way too much.  But, it's a step
in the right direction I think in combination with the libcurl work
where we're linking to openssl anyways.

Closes: #738
Approved by: jlebon
2017-03-20 18:32:40 +00:00
Colin Walters 46001f4a5b core: Add runtime ostree_check_version()
[Previously](https://github.com/ostreedev/ostree/pull/728) we added compile-time
checking for versions, but there are use cases for runtime checking as well,
because in a number of API calls we use `GVariant` as an API extension
mechanism.

Closes: #735
Approved by: jlebon
2017-03-13 14:29:02 +00:00
Philip Withnall 574c3ea6f9 libostree: Allow compression level to be set for archive-z2 stream
Add a ostree_raw_file_to_archive_z2_stream_with_options() variant of
ostree_raw_file_to_archive_z2_stream(), to allow a compression-level
option to be passed in and passed through to zlib.

This is useful when building archive-z2 files on the fly for
transmission over a non-bandwidth-limited channel, such as a local
network. In this case, CPU time is more valuable than bandwidth, so we
want a low compression level.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #721
Approved by: cgwalters
2017-03-06 18:19:45 +00:00
Colin Walters 3d38f03e4f repo: Add archive/zlib-level option, drop default compression to 6
The gzip default is 6.  When I was writing this code, I chose 9 under
the assumption that for long-term archival, the extra compression was
worth it.

Turns out level 9 is really, really not worth it.  Here's run at level 9
compressing the current Fedora Atomic Host into archive:

```
ostree --repo=repo pull-local repo-build fedora-atomic/25/x86_64/docker-host
real    2m38.115s
user    2m31.210s
sys     0m3.114s
617M    repo
```

And here's the new default level of 6:

```
ostree --repo=repo pull-local repo-build fedora-atomic/25/x86_64/docker-host
real    0m53.712s
user    0m43.727s
sys     0m3.601s
619M    repo
619M    total
```

As you can see, we run almost *three times* faster, and we take up *less
than one percent* more space.

Conclusion: Using level 9 is dumb.  And here's a run at compression level 1:

```
ostree --repo=repo pull-local repo-build fedora-atomic/25/x86_64/docker-host
real    0m24.073s
user    0m17.574s
sys     0m2.636s
643M    repo
643M    total
```

I would argue actually many people would prefer even this for "devel" repos.
For production repos, you want static deltas anyways.  (However, perhaps
we should support a model where generating a delta involves re-compressing
fallback objects with a bit stronger compression level).

Anyways, let's make everyone's life better and switch the default to 6.

Closes: #671
Approved by: jlebon
2017-02-07 17:01:09 +00:00
Jonathan Lebon 12e916466c static-delta: add some error handling
We make _ostree_parse_delta_name() a bit more defensive since it handles
user input.

Closes: #504

Closes: #505
Approved by: cgwalters
2016-09-09 19:06:11 +00:00
Colin Walters 6ffcb24d22 deltas: Handle untrusted checksums faster and more robustly
When reworking the ostree core [to use O_TMPFILE](https://github.com/ostreedev/ostree/pull/369),
I hit an issue in the way the untrusted delta codepath ends up trying
to re-open the file to checksum it.  That's not possible with
`O_TMPFILE` since the fd (which we opened `O_WRONLY`) is the only
accessible reference to the content.

Fix this by changing the delta processing code to update a checksum as
we're doing writes, which is also faster, and ends up simplifying the
code as well.

What would be an even larger simplification here is if we e.g. used a
separate thread calling `write_object()` or something like that; the
main issue I see there is somehow bridging the fact that function
wants a `GInputStream*` but the delta code is generating stream of
writes.

Closes: #392
Approved by: jlebon
2016-07-29 16:03:28 +00:00
Dan Nicholson db974b0596 core: Add allocating b64 checksum functions
The checksum_b64_inplace variants can't be used in bindings. Provide
versions that allocate and return the output rather than working on a
passed in buffer. These can then be used in GI bindings to get the
ostree modified base64 encodings.

Closes: #398
Approved by: cgwalters
2016-07-15 02:18:27 +00:00
Mathnerd314 23049bbd01 core: Add OSTREE_OBJECT_TYPE_COMMIT_META
This is cleaner than the loose_path_with_suffix approach

Closes: #359
Approved by: cgwalters
2016-06-22 16:10:01 +00:00
Mathnerd314 4cb77c51db core: Use OSTREE_SHA256_STRING_LEN instead of 64
Closes: #359
Approved by: cgwalters
2016-06-22 16:10:01 +00:00
Krzesimir Nowak 91ccaff197 core: Fix wrong return value docs
ostree_commit_get_parent() returns a string form of a checksum, not a
binary form.

Closes: #360
Approved by: cgwalters
2016-06-22 12:45:12 +00:00
Mathnerd314 1b88dc7f90 docs: Get API docs working again
This changes around a few things that didn't work for me:
* Section names seem to be ostree-* instead of libostree-*
* Also XML files are ostree-* (they didn't show up at all)
- gtk-doc doesn't seem to parse const _OSTREE_PUBLIC correctly
* pull documentation is now on the actual functions rather than stubs
* Update gitignore with some more files

And there some changes to make gtk-doc give fewer warnings (not finished)

Closes: #327
Approved by: cgwalters
2016-06-09 18:15:49 +00:00
Colin Walters 24cb0ffc6a core: Port to new libglnx tempname API
Drops another libgsystem use, and as bonus we malloc less too.

Closes: #311
Approved by: jlebon
2016-05-31 18:08:46 +00:00
Krzesimir Nowak 569e43c280 core: Add a function creating an archive-z2 content stream
It is quite similar to the already existing
ostree_raw_file_to_content_stream function, so I factored the common
part to a separate function. The difference is that we cannot report
the size of the resulting stream.

Can be useful for serving a "bare" repository as a faked "archive-z2"
repository.

Closes: #308
Approved by: cgwalters
2016-05-26 16:53:08 +00:00
Alexander Larsson d368624798 Build on older versions of glib
Various places need to include libglnx.h for the autoptr backport
fallbacks to be there before ostree-autocleanups.h is included.

This fixes the build on centos7·

Closes: #309
Approved by: giuseppe
2016-05-25 14:01:39 +00:00
Colin Walters 6724519080 libglnx porting: Migrate to glnx_stream_fstat()
I ended up deciding to move this one into libglnx, seems like
something other libglnx-using software might want to do, even though
xdg-app doesn't right now.

Closes: #282
Approved by: jlebon
2016-05-06 14:29:59 +00:00
Colin Walters c58ad36840 libglnx porting: gs_transfer_out_value -> g_steal_pointer
It's a bit more verbose but...eh.
2016-03-18 12:08:19 -04:00
Colin Walters b67f5364ac libglnx porting: xattr calls
These are straightforward as the libgsystem versions were already just
equivalent shims.
2016-03-18 12:08:19 -04:00
Colin Walters fa9e547e09 lib: Add a #define OSTREE_SHA256_DIGEST_LEN 32
And use it internally.  This way it's a bit less magical.
2016-01-28 15:24:16 -05:00
Giuseppe Scrivano 76c5cc07db pull: add support for tombstone commits
Add a new object type: OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT that is
used when a commit was intentionally removed.

If the remote repository doesn't use tombstone commits, do not fail on
a missing commit (change 0b795785dd).

When the remote repository uses tombstones, if a commit cannot be
found, check if the tombstone file is present and fail if it is not
present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-03 09:53:38 +01:00
Giuseppe Scrivano 048c27588a core: use OSTREE_OBJECT_TYPE_LAST instead of OSTREE_OBJECT_TYPE_COMMIT
OSTREE_OBJECT_TYPE_LAST holds the value of the last element in the enum.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-03 09:53:38 +01:00
Matthew Barnes f2ddf10d4e core: Add _ostree_get_default_sysroot_path()
Returns a GFile for the default system root, which is usually the root
directory unless overridden by the OSTREE_SYSROOT environment variable
(which is mainly intended for testing).
2015-07-16 12:48:11 -04:00
Giuseppe Scrivano e3a3e2b618 syntax-check: add syntactic rule to prohibit gs_strfreev
and fix an instance.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-13 10:02:47 +02:00
Giuseppe Scrivano ae672c3c9f core: new function _ostree_parse_delta_name
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Matthew Barnes 4ef0280941 Remove unnecessary #include "libgsystem.h" 2015-05-06 22:07:11 -04:00
Matthew Barnes cca69b3f55 Use g_autoptr(GVariantBuilder) instead of gs_unref_variant_builder 2015-05-06 22:07:11 -04:00
Matthew Barnes c2c322efa9 Use g_autoptr(GVariant) instead of gs_unref_variant 2015-05-06 22:07:10 -04:00
Matthew Barnes bb231fdf74 Use g_autoptr(GPtrArray) instead of gs_unref_ptrarray 2015-05-06 22:07:10 -04:00
Matthew Barnes 4ee1acd981 Use g_autoptr() for GIO object types
GLib 2.44 supplies all the necessary autocleanup macros for GIO types,
and libglnx backports the relevant macros for ostree.
2015-05-06 21:51:19 -04:00
Matthew Barnes 7a62d64968 Use g_autofree instead of gs_free 2015-05-06 21:50:17 -04:00
Matthew Barnes f2b2d7c3f2 core: Actually allow none in ostree_parse_refspec()
Both 'out_remote' and 'out_ref' parameters already have the (allow-none)
annotation but that wasn't actually true.
2015-04-06 12:08:27 -04:00
Matthew Barnes c107561171 core: Fix duplication bug in _ostree_detached_metadata_append_gpg_sig()
g_variant_builder_add() does not replace identical keys in a VARDICT
variant, so signing a commit multiple times results in multiple copies
of "ostree.gpgsigs" in the metadata.  And since g_variant_lookup_value()
stops on the first match, subsequent signatures have no net effect.

Instead of GVariantBuilder use GVariantDict, which behaves more like a
hash table.
2015-03-02 15:13:49 -05:00
Matthew Barnes c04f9f47e3 core: Add definitions for GPG signature metadata
_OSTREE_METADATA_GPGSIGS_NAME
_OSTREE_METADATA_GPGSIGS_TYPE
2015-03-02 15:12:06 -05:00
Colin Walters 965a304a17 Use libglnx
Starting down the path of not using libgsystem.  The main win here
will be code sharing between ostree/rpm-ostree as well as going down
the path of not using GFile * for local files.
2015-02-22 21:02:27 -05:00
Colin Walters 08476ce254 deltas: Prune deltas when the corresponding "to" commit vanishes
We want prune to actually give you back disk space when using deltas.
2015-02-16 10:10:35 -05:00
Colin Walters 92cc3b5968 deltas: Use base64 for csums, add version to parts 2015-02-16 10:10:35 -05:00
Giuseppe Scrivano 6a3959c895 syntax-check: Remove empty lines at the end of file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-02-02 15:07:56 +01:00
Colin Walters a7300a828d core: Add an API to parse a content file using dirfd relative lookup
This will be used for a later change to use openat() for the fetching
code.  Note that we drop the code to use mmap() - it was an attempt to
avoid keeping a fd open, but we do correctly close anyways.
2015-01-14 22:03:02 -05:00
Alexander Larsson 5b721a5b08 Allow creating and pulling static deltas starting from "empty"
You create these with something like:
  ostree static-delta generate --empty --to=master

These will be automatically used during pull if no previous revision
exists in the target repo.

These work very much like the normal static deltas except they
are named just by the "to" revision. I.e:

deltas/94/f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d

for a from-scratch to 94f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d delta.

https://bugzilla.gnome.org/show_bug.cgi?id=721799
2015-01-14 14:43:32 +01:00
Colin Walters 1bcc7a8e3a Merge branch 'giuseppe/staticdeltas' of https://github.com/giuseppe/ostree 2014-12-19 16:31:31 -05:00
Colin Walters 125889fd7e Enforce 'rdev' (device file major/minor) is 0
Historically OSTree supported device files, but it wasn't useful, and
added attack surface.  Support was removed in

https://git.gnome.org/browse/ostree/commit/?id=62a896350bd54bff5a9413d2ee0fad7ff4364f9a

Perform a further cleanup by enforcing internally that the device
major/minor must be 0.

Conflicts:
	src/libostree/ostree-core.c
2014-12-19 10:20:05 -05:00
Colin Walters c4efbf6718 core: Deduplicate code converting struct stat -> GFileInfo
We were doing the same thing in a number of places, make a helper
function.
2014-12-19 10:18:59 -05:00
Colin Walters ca678224be Static deltas support
https://bugzilla.gnome.org/show_bug.cgi?id=721799
2014-12-18 12:48:47 +01:00
Colin Walters f2e0162846 upgrade: Refuse chronologically older commits unless --allow-downgrade
We don't want to allow MITM attackers to intercept upgrade requests
and provide clients with older OS versions vulnerable to security
flaws.

Only "ostree admin upgrade" gets this behavior for now - whether we
want to do it for "ostree admin switch" is another question.
2014-02-20 18:25:56 -05:00
Colin Walters 2d6374822b Initial basic static delta code drop
This has a very basic level of functionality (deltas can be generated,
and applied offline).  There is only some stubbed out pull code to
fetch them via HTTP.

But, better to commit this now and improve it from a known starting
point, rather than have it languish in a branch.
2014-02-04 10:31:44 -05:00
Colin Walters a24afd68f0 Move xattr handling into libgsystem, fix sysroot to handle directory ownership/perms
This large patch moves the core xattr logic down into libgsystem,
which allows the gs_shutil_cp_a() API to copy them.  In turn, this
allows us to just use that API instead of rolling our own recursive
copy here.

As noted in the new comment though, one case that we are explicitly
regressing is where the new /etc removes a parent directory that's
needed by a modified file.  This seems unlikely for most vendors now,
but let's do that as a separate bug.

https://bugzilla.gnome.org/show_bug.cgi?id=711058
2013-11-28 23:28:13 -05:00
Jasper St. Pierre 3b31f2b4d1 Update libgsystem 2013-10-09 16:17:38 -04:00
Colin Walters 8592922c2c core: Make ostree_get_relative_object_path() private
I plan to rename all of these APIs to use the term 'loose', so that it
makes more sense after pack files are introduced.  External users
should not use them; instead use _load_variant() or _read_commit().
2013-09-29 20:17:18 -04:00
Colin Walters 33e589c018 core: Use at-relative functions for checking out tree copies too
For the cases where we can't hardlink, use at-relative walking of the
path where possible.  We still don't have lsetxattrat, so we also need
to deal with pathnames, but that is now only for symlinks.

Again, the advantages of this are a lot less malloc() of pathnames in
ostree, and much less time spent traversing paths inside the kernel.

https://bugzilla.gnome.org/show_bug.cgi?id=707733
2013-09-08 14:42:50 -04:00
Colin Walters 0c2ea54e68 core: Make ostree_set_xattrs() private
Nothing external uses it.  We keep ostree_get_xattrs_for_file() public
because it's convenient for external consumers to get xattrs in
exactly the format we desire.

https://bugzilla.gnome.org/show_bug.cgi?id=707733
2013-09-08 14:41:51 -04:00
Colin Walters 9846fb27fd core: Use linkat() for hardlink checkouts too
Clean up how we deal with the uncompressed object cache; we now use
openat()/linkat() and such just like we do for the main objects/.

Use linkat() between the objects and the destination, if possible.

https://bugzilla.gnome.org/show_bug.cgi?id=707733
2013-09-08 14:40:09 -04:00
Colin Walters a7c0992d94 core: Add malloc-free API for objects, use *at functions for storing
This is more efficient; we avoid malloc of a number of pathname +
GFile objects, plus the kernel doesn't have to traverse the repo path
again.
2013-09-07 04:18:41 -04:00
Colin Walters eeb1f9e07b core: Delete unused ostree_create_temp_dir() API
Nothing was using it.  Poof.  Gone!
2013-09-04 08:18:45 -04:00
Colin Walters 36815f52b5 libostree: Move file creation APIs out of core, into checkout.c
Since this was the only user, let's not have generic code to go from
OSTree representation -> filesystem here.  It should live in checkout.
2013-09-04 08:17:42 -04:00
Colin Walters ee2b66ef00 core: Make a helper function private
Nothing was using this, so make it private.
2013-09-04 07:53:02 -04:00
Colin Walters 2534714501 core: Make ostree_write_variant_with_size() private
More work making the file formats and utilities private.
2013-09-04 07:49:41 -04:00
Colin Walters 0d72168961 libostree: Make the format of file objects private
It's now isolated almost entirely to ostree-core.c, except
ostree-repo.c needs to know how to create archive-z2 file headers.  So
give it a private API for that.
2013-09-03 18:43:42 -04:00
Tobias Hunger ed56908ccb Fix warnings about unused variables 2013-08-30 14:23:45 -04:00
Colin Walters 00c352ba67 libostree: Delete some leftover remnant API for archive files 2013-08-17 14:08:04 -04:00
Colin Walters 0f9d7d2179 libostree: More gtk-doc updates for ostree-core 2013-08-17 10:54:00 -04:00
Colin Walters abe2320039 libostree: Fix many gtk-doc warnings 2013-08-17 08:41:31 -04:00
Colin Walters c3121b52bc libostree: Document more core macros 2013-08-17 08:21:04 -04:00
Colin Walters 17560a57bf Add gtk-doc support
Yes, it's really me.  Colin Walters.  Writing documentation.  You
don't need to do a DNA test.
2013-08-16 22:56:12 -04:00
Colin Walters a04bda126c core: Use gs_stream_fstat()
Just a cleanup.
2013-08-15 14:21:26 -04:00
Colin Walters 6bb4ea46ab core: Add some more gtk-doc 2013-08-15 11:17:16 -04:00
Colin Walters 1f35655ac1 core: Add some gtk-doc
Just documenting a few functions to get in the habit of things.
2013-08-15 07:04:29 -04:00
Stef Walter 5efb8e86e9 Add ostree_commit_get_parent() to get parent from variant
https://bugzilla.gnome.org/show_bug.cgi?id=705973
2013-08-15 06:52:53 +02:00
Colin Walters d9f59c6fd5 core: Add API to convert checksum -> csum in place
We already have the opposite, and this will be used in some
places to avoid a malloc.

https://bugzilla.gnome.org/show_bug.cgi?id=706031
2013-08-14 19:49:54 -04:00
Colin Walters 76cd7ae4ea libotutil: Add API to create an "ay" GVariant from GBytes
We used to have a version of this, but since I'm trying to use
GBytes more, this became a more common operation, and it's annoying
to type out the whole G_VARIANT_TYPE ("ay") each time, and pass
TRUE for trusted.

https://bugzilla.gnome.org/show_bug.cgi?id=706031
2013-08-14 19:23:33 -04:00
Stef Walter 97947373ee Add some verbose log output when xattr functions fail
If any of the system xattr functions fail, clearly write out the
reason in the verbose log output.

https://bugzilla.gnome.org/show_bug.cgi?id=705893
2013-08-14 07:50:49 +02:00
Stef Walter 3f9c150b77 Don't use XATTR_REPLACE with lsetxattr()
If we pass XATTR_REPLACE then the attribute must already exist, which
is not our intent. Passing zero creates the attribute if necessary,
or replaces it when it already exists.

https://bugzilla.gnome.org/show_bug.cgi?id=705893
2013-08-13 15:42:54 +02:00
Stef Walter c246c4194f Properly separate sorted xattr names
We expect to be handling a string delimited by \0 characters, as
returned by llistxattr(). So stick to that behavior here.

https://bugzilla.gnome.org/show_bug.cgi?id=705893
2013-08-13 15:42:54 +02:00
Colin Walters 71c4ea67f7 core: Clean up temporary file creation
Use new libgsystem API, don't expose the repo's tmpdir.
2013-08-06 23:58:29 +02:00
Colin Walters a5d43bb959 Install a shared library
This required a fair bit of surgery because previously ostree.h
included otutil.h, but that's supposed to be a private library.
2013-07-26 19:25:07 -04:00
Colin Walters 74b2c7aab3 core: Work around libguestfs/FUSE issue with setuid binaries
For some reason, the setuid bits are being stripped.  This
workaround is enough for now.
2013-07-26 14:48:15 -04:00
Colin Walters 67823beb1f core: Don't strip setuid bits when creating files
This ugly regression occurred because I overlooked the fact that our
chown() invocation would strip off setuid.
2013-07-18 14:23:55 -04:00
Colin Walters 62a896350b Drop support for fifos and devices
While the first was useful way back in the day when we were importing
Debian bits and /sbin/init was expecting to find /dev/.initctl as a
named pipe, that's no longer an issue with systemd since it uses
dynamic Unix sockets.

Likewise, character and block devices in /dev are now dynamically
created by the devtmpfs from the kernel.

Less complexity and code here if we just support directories, regular
files, and symbolic links.
2013-07-16 09:35:44 -04:00
Colin Walters 444234e7db core: Use gsystem API for generating temporary names
Drops duplicated code.
2013-07-16 08:51:53 -04:00
Colin Walters acdf1ca4fe core: Use gs_file_create()
This allows us to drop a chmod() invocation, since the regular file
path was the only thing that didn't handle mode.
2013-07-16 08:51:53 -04:00
Colin Walters 124416d832 Use AC_USE_SYSTEM_EXTENSIONS instead of #define _GNU_SOURCE
It's less copy/paste, works everywhere, etc.

Also fix some missing #include "config.h".
2013-07-10 13:25:35 -04:00
Colin Walters 4b170d656c Switch to libgsystem local allocation macros
And drop our compatibility wrapper.
2013-07-07 12:27:44 -04:00
Colin Walters e8cba55a34 core: Allow '.' in refspecs too
For version numbers.
2013-07-05 16:51:47 -04:00
Colin Walters 1ba852ebaa core: Add "refspec" which is remote:refname
This allows an unambiguous reference; otherwise, it was too easy to
have confusion between local heads and remotes.
2013-06-29 12:51:29 -04:00
Colin Walters a821420711 core: Add API to convert csum -> checksum without malloc()
Just doing some profiling, this was in the top malloc() callers.
2013-02-23 11:02:56 -05:00
Colin Walters 90ccc7b2d2 core: Pick better names for tmpfiles if no prefix given
Just makes it easier to track down where files came from.
2012-12-21 11:30:58 -05:00
Colin Walters ad956ff9e2 core: Allow creating tempfile without associated output stream
Just slightly more efficient, and we'll use this for spawning curl to
a tempfile.
2012-12-20 21:14:27 -05:00
Colin Walters a97211e3d0 core: Clean up tmpfile creation code
I have been seeing random failures here...not entirely sure why yet,
but this code is cleaner.
2012-12-13 15:12:51 -05:00
Colin Walters fc7f05940c core: Use mmap() with O_NOATIME if merely reading archive-z2 entries
Previously we'd open(path, O_NOATIME) and do a series of small read()
calls to just parse the header.  I think this will trigger kernel readahead
into the compressed portion, but we don't care about that.

This should be more efficient.
2012-12-02 15:20:17 -05:00
Colin Walters 5761733218 Drop some bits from libotutil that are now merged in libgsystem 2012-11-29 16:24:49 -05:00
Colin Walters 0d04738801 core: Rework archive-z mode to have header be uncompressed
This is an incompatible change to archive-z, thus it is now renamed to
archive-z2 and ostree will no longer parse archive-z.

I noticed in perf that we were spending some time zlib-decompressing
file headers, which is just inefficient.  Rather than do this, keep
the headers uncompressed, and just zlib-compress content.
2012-10-14 17:10:57 -04:00
Colin Walters 26e487bacf core: use open(..., O_NOATIME) for reading loose objects
More efficient, and atime shouldn't matter for these.
2012-09-24 07:36:42 -04:00
Colin Walters 40ce43036f Add an archive-z repository mode
This is where loose content objects are stored as one compressed file,
instead of the two separate ones for regular archive mode.  This mode
would be suitable for HTTP servers, beause only one HTTP request is
necessary, and the result would be compressed.
2012-09-23 19:23:45 -04:00
Colin Walters 2a0601efc7 core: Drop packfiles as they are now
They're not a large efficiency win at the moment, because we don't
do any delta compression.

At the moment, they simply served to compress data, but we will change
the archive mode to do that by default.
2012-09-23 16:02:03 -04:00
Colin Walters a310eb861b core: Add context when we fail to chmod()/chown()
This helps make things less confusing when we try to create a file not
owned by our uid, such as running ostree-pull as non-root on a
repository owned by root.
2012-07-19 11:01:39 -04:00
Colin Walters 2ced4abf11 core: Drop ot_clear_gvariant() in favor of g_clear_pointer 2012-07-17 08:14:33 -04:00
Colin Walters 57fcafd1ab core: Remove ot_clear_checksum() in favor of g_clear_pointer() 2012-07-17 08:08:57 -04:00
Colin Walters a14ff0aeab core: Fix mkdtemp invocation 2012-06-06 10:03:15 -04:00
Colin Walters df54408e5d core: Fix memory leak 2012-06-05 22:32:03 -04:00
Colin Walters cbd4ade053 core: Switch to using mkdtemp() so we only depend on GLib 2.28
We claim to build against 2.28, let's actually make it work.
2012-05-29 22:34:11 -04:00