checkout/commit: Use glnx_regfile_copy_bytes() if possible#817
checkout/commit: Use glnx_regfile_copy_bytes() if possible#817cgwalters wants to merge 1 commit intoostreedev:masterfrom
Conversation
|
Couldn't help writing this after I'd been spending some time staring at Before: After: |
|
bot, retest this please |
426ea19 to
aae7945
Compare
Rather than `g_output_stream_splice()`, where the input is a regular file. See GNOME/libglnx#44 for some more information. I didn't try to measure the performance difference, but seeing the read()/write() to/from userspace mixed in with the pointless `poll()` annoyed me when reading strace. As a bonus, we will again start using reflinks (if available) for `/etc`, which is a regression from the ostreedev#797 changes (which before used `glnx_file_copy_at()`). Also, for the first time we'll use reflinks when doing commits from file-backed content. This happens in `rpm-ostree compose tree` today for example. Update submodule: libglnx
|
Interesting; so the problem was that I think rhci was relying on github's auto-merge commit, rather than doing what homu would do via a rebase. A bit of a messy corner case; rhci would have to know that the repo was homu managed. But hopefully we can avoid that by relying on a FF-able PR, let's see. |
|
bot, retest this please |
| if (g_output_stream_splice (output, input, 0, | ||
| cancellable, error) < 0) | ||
| return FALSE; | ||
| if (G_IS_FILE_DESCRIPTOR_BASED (input)) |
There was a problem hiding this comment.
We expose as public API:
gboolean ostree_repo_write_content (OstreeRepo *self,
const char *expected_checksum,
GInputStream *object_input,
guint64 length,
guchar **out_csum,
GCancellable *cancellable,
GError **error);
So we have to support it. In practice using the command line tools, we will go through this code path when pulling from an archive repo to a bare one, since the content objects are zlib-compressed.
| cancellable, error) < 0) | ||
| return FALSE; | ||
| if (fchmod (temp_fd, 0644) < 0) | ||
| if (G_IS_FILE_DESCRIPTOR_BASED (input)) |
There was a problem hiding this comment.
Here too. Seems like they're always fd-based, no? I'm not very familiar with GIO.
|
☀️ Test successful - status-atomicjenkins |
Rather than
g_output_stream_splice(), where the input is a regularfile.
See GNOME/libglnx#44 for some more information.
I didn't try to measure the performance difference, but seeing the
read()/write() to/from userspace mixed in with the pointless
poll()annoyed mewhen reading strace.
As a bonus, we will again start using reflinks (if available) for
/etc,which is a regression from the #797
changes (which before used
glnx_file_copy_at()).Also, for the first time we'll use reflinks when doing commits from file-backed
content. This happens in
rpm-ostree compose treetoday for example.