mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-19 22:50:35 +03:00
ostree: introduce PAYLOAD_LINK object type
It will be used by successive commits to keep track of the payload checksum for objects stored in the repository. The goal is that files having the same payload but different xattrs can take advantage of reflinks where supported. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1443 Approved by: cgwalters
This commit is contained in:
parent
418e4545de
commit
118f1f7e40
@ -1239,6 +1239,8 @@ ostree_object_type_to_string (OstreeObjectType objtype)
|
||||
return "tombstone-commit";
|
||||
case OSTREE_OBJECT_TYPE_COMMIT_META:
|
||||
return "commitmeta";
|
||||
case OSTREE_OBJECT_TYPE_PAYLOAD_LINK:
|
||||
return "payload-link";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
@ -1266,6 +1268,8 @@ ostree_object_type_from_string (const char *str)
|
||||
return OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT;
|
||||
else if (!strcmp (str, "commitmeta"))
|
||||
return OSTREE_OBJECT_TYPE_COMMIT_META;
|
||||
else if (!strcmp (str, "payload-link"))
|
||||
return OSTREE_OBJECT_TYPE_PAYLOAD_LINK;
|
||||
g_assert_not_reached ();
|
||||
return 0;
|
||||
}
|
||||
@ -2122,6 +2126,7 @@ _ostree_validate_structureof_metadata (OstreeObjectType objtype,
|
||||
break;
|
||||
case OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT:
|
||||
case OSTREE_OBJECT_TYPE_COMMIT_META:
|
||||
case OSTREE_OBJECT_TYPE_PAYLOAD_LINK:
|
||||
/* TODO */
|
||||
break;
|
||||
case OSTREE_OBJECT_TYPE_FILE:
|
||||
|
@ -68,6 +68,7 @@ G_BEGIN_DECLS
|
||||
* @OSTREE_OBJECT_TYPE_COMMIT: Toplevel object, refers to tree and dirmeta for root
|
||||
* @OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT: Toplevel object, refers to a deleted commit
|
||||
* @OSTREE_OBJECT_TYPE_COMMIT_META: Detached metadata for a commit
|
||||
* @OSTREE_OBJECT_TYPE_PAYLOAD_LINK: Symlink to a .file given its checksum on the payload only.
|
||||
*
|
||||
* Enumeration for core object types; %OSTREE_OBJECT_TYPE_FILE is for
|
||||
* content, the other types are metadata.
|
||||
@ -79,6 +80,7 @@ typedef enum {
|
||||
OSTREE_OBJECT_TYPE_COMMIT = 4, /* .commit */
|
||||
OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT = 5, /* .commit-tombstone */
|
||||
OSTREE_OBJECT_TYPE_COMMIT_META = 6, /* .commitmeta */
|
||||
OSTREE_OBJECT_TYPE_PAYLOAD_LINK = 7, /* .payload-link */
|
||||
} OstreeObjectType;
|
||||
|
||||
/**
|
||||
@ -94,7 +96,7 @@ typedef enum {
|
||||
*
|
||||
* Last valid object type; use this to validate ranges.
|
||||
*/
|
||||
#define OSTREE_OBJECT_TYPE_LAST OSTREE_OBJECT_TYPE_COMMIT_META
|
||||
#define OSTREE_OBJECT_TYPE_LAST OSTREE_OBJECT_TYPE_PAYLOAD_LINK
|
||||
|
||||
/**
|
||||
* OSTREE_DIRMETA_GVARIANT_FORMAT:
|
||||
|
@ -3278,6 +3278,8 @@ list_loose_objects_at (OstreeRepo *self,
|
||||
objtype = OSTREE_OBJECT_TYPE_DIR_META;
|
||||
else if (strcmp (dot, ".commit") == 0)
|
||||
objtype = OSTREE_OBJECT_TYPE_COMMIT;
|
||||
else if (strcmp (dot, ".payload-link") == 0)
|
||||
objtype = OSTREE_OBJECT_TYPE_PAYLOAD_LINK;
|
||||
else
|
||||
continue;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user