lib/pull: Change fetcher to return O_TMPFILE
A lot of the libostree code is honestly too complex for its own good (this is mostly my fault). The way we do HTTP writes is still one of those. The way the fetcher writes tempfiles, then reads them back in is definitely one of those. Now that we've dropped the "partial object" bits in: https://github.com/ostreedev/ostree/pull/1176 i.e. commit https://github.com/ostreedev/ostree/commit/0488b4870e80ef575d8b0edf6f2a9e5ad54bf4df we can simplify things a lot more by having the fetcher return an `O_TMPFILE` rather than a filename. For trusted archive mirroring, we need to enable linking in the tmpfiles directly. Otherwise for at least content objects they're compressed, so we couldn't link them in. For metadata, we need to do similar logic to what we have around `mmap()` to only grab a tmpfile if the size is large enough. Closes: #1252 Approved by: jlebon
This commit is contained in:
1 parent
7f6af94c5a
commit
2e3889a4eb
5 files changed
+86
-107
No files matched your search
@@ -55,7 +55,8 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
OSTREE_FETCHER_REQUEST_NUL_TERMINATION = (1 << 0),
|
||||
OSTREE_FETCHER_REQUEST_OPTIONAL_CONTENT = (1 << 1)
|
||||
OSTREE_FETCHER_REQUEST_OPTIONAL_CONTENT = (1 << 1),
|
||||
OSTREE_FETCHER_REQUEST_LINKABLE = (1 << 2),
|
||||
} OstreeFetcherRequestFlags;
|
||||
|
||||
void
|
||||
@@ -124,7 +125,7 @@ void _ostree_fetcher_request_to_tmpfile (OstreeFetcher *self,
|
||||
|
||||
gboolean _ostree_fetcher_request_to_tmpfile_finish (OstreeFetcher *self,
|
||||
GAsyncResult *result,
|
||||
char **out_filename,
|
||||
GLnxTmpfile *out_tmpf,
|
||||
GError **error);
|
||||
|
||||
void _ostree_fetcher_request_to_membuf (OstreeFetcher *self,
|
||||
|
||||
Reference in new issue
Block a user