lib/core: introduce two new object types for split xattrs
This adds two new object types for storing xattrs separately from content objects. `.file-xattrs` are regular files storing xattrs content, encoded as GVariant. Each object is keyed by the checksum of its content, allowing for multiple references. `.file-xattrs-link` are hardlinks which are associated to file objects. Each object is keyed by the same checksum of the corresponding file object. The target of the hardlink is an existing file-xattrs object. In case of reaching the limit of too many links, this object could be a plain file too.
This commit is contained in:
parent
6ad4a3457f
commit
2c60f302f9
|
|
@ -1228,6 +1228,10 @@ ostree_object_type_to_string (OstreeObjectType objtype)
|
|||
return "commitmeta";
|
||||
case OSTREE_OBJECT_TYPE_PAYLOAD_LINK:
|
||||
return "payload-link";
|
||||
case OSTREE_OBJECT_TYPE_FILE_XATTRS:
|
||||
return "file-xattrs";
|
||||
case OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK:
|
||||
return "file-xattrs-link";
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
|
|
@ -1257,6 +1261,10 @@ ostree_object_type_from_string (const char *str)
|
|||
return OSTREE_OBJECT_TYPE_COMMIT_META;
|
||||
else if (!strcmp (str, "payload-link"))
|
||||
return OSTREE_OBJECT_TYPE_PAYLOAD_LINK;
|
||||
else if (!strcmp (str, "file-xattrs"))
|
||||
return OSTREE_OBJECT_TYPE_FILE_XATTRS;
|
||||
else if (!strcmp (str, "file-xattrs-link"))
|
||||
return OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK;
|
||||
g_assert_not_reached ();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2141,6 +2149,8 @@ _ostree_validate_structureof_metadata (OstreeObjectType objtype,
|
|||
/* TODO */
|
||||
break;
|
||||
case OSTREE_OBJECT_TYPE_FILE:
|
||||
case OSTREE_OBJECT_TYPE_FILE_XATTRS:
|
||||
case OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ G_BEGIN_DECLS
|
|||
* @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.
|
||||
* @OSTREE_OBJECT_TYPE_FILE_XATTRS: Detached xattrs content, for 'bare-split-xattrs' mode.
|
||||
* @OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK: Hardlink to a .file-xattrs given the checksum of its .file object.
|
||||
*
|
||||
* Enumeration for core object types; %OSTREE_OBJECT_TYPE_FILE is for
|
||||
* content, the other types are metadata.
|
||||
|
|
@ -79,6 +81,8 @@ typedef enum {
|
|||
OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT = 5, /* .commit-tombstone */
|
||||
OSTREE_OBJECT_TYPE_COMMIT_META = 6, /* .commitmeta */
|
||||
OSTREE_OBJECT_TYPE_PAYLOAD_LINK = 7, /* .payload-link */
|
||||
OSTREE_OBJECT_TYPE_FILE_XATTRS = 8, /* .file-xattrs */
|
||||
OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK = 9, /* .file-xattrs-link */
|
||||
} OstreeObjectType;
|
||||
|
||||
/**
|
||||
|
|
@ -94,7 +98,7 @@ typedef enum {
|
|||
*
|
||||
* Last valid object type; use this to validate ranges.
|
||||
*/
|
||||
#define OSTREE_OBJECT_TYPE_LAST OSTREE_OBJECT_TYPE_PAYLOAD_LINK
|
||||
#define OSTREE_OBJECT_TYPE_LAST OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK
|
||||
|
||||
/**
|
||||
* OSTREE_DIRMETA_GVARIANT_FORMAT:
|
||||
|
|
|
|||
Loading…
Reference in New Issue