Exemple #1
0
void btrfs_print_key(struct btrfs_disk_key *disk_key)
{
	u64 objectid = btrfs_disk_key_objectid(disk_key);
	u8 type = btrfs_disk_key_type(disk_key);
	u64 offset = btrfs_disk_key_offset(disk_key);

	printf("key (");
	print_objectid(objectid, type);
	printf(" ");
	print_key_type(objectid, type);
	switch (type) {
	case BTRFS_QGROUP_RELATION_KEY:
	case BTRFS_QGROUP_INFO_KEY:
	case BTRFS_QGROUP_LIMIT_KEY:
		printf(" %llu/%llu)", (unsigned long long)(offset >> 48),
			(unsigned long long)(offset & ((1ll << 48) - 1)));
		break;
	default:
		if (offset == (u64)-1)
			printf(" -1)");
		else
			printf(" %llu)", (unsigned long long)offset);
		break;
	}
}
Exemple #2
0
void btrfs_print_key(struct btrfs_disk_key *disk_key)
{
	u64 objectid = btrfs_disk_key_objectid(disk_key);
	u8 type = btrfs_disk_key_type(disk_key);
	u64 offset = btrfs_disk_key_offset(disk_key);

	printf("key (");
	print_objectid(objectid, type);
	printf(" ");
	print_key_type(objectid, type);
	switch (type) {
	case BTRFS_QGROUP_RELATION_KEY:
	case BTRFS_QGROUP_INFO_KEY:
	case BTRFS_QGROUP_LIMIT_KEY:
		printf(" %llu/%llu)", btrfs_qgroup_level(offset),
		       btrfs_qgroup_subvid(offset));
		break;
	case BTRFS_UUID_KEY_SUBVOL:
	case BTRFS_UUID_KEY_RECEIVED_SUBVOL:
		printf(" 0x%016llx)", (unsigned long long)offset);
		break;
	default:
		if (offset == (u64)-1)
			printf(" -1)");
		else
			printf(" %llu)", (unsigned long long)offset);
		break;
	}
}
static void
smpi_encryption_key_refresh_complete(const void * cif,
                                     twicSmReasonCode_t reason,
                                     const uint8_t key_type,
                                     const uint8_t encryption_key_size)
{
  twicTrace();
  print_reasoncode(reason);
  print_key_type(key_type);
  twicUtPrintVal("Eencryption key size", 1, &encryption_key_size);
}
Exemple #4
0
void btrfs_print_key(struct btrfs_disk_key *disk_key)
{
	u8 type;
	printf("key (");
	type = btrfs_disk_key_type(disk_key);
	print_objectid((unsigned long long)btrfs_disk_key_objectid(disk_key),
		type);
	printf(" ");
	print_key_type(type);
	printf(" %llu)", (unsigned long long)btrfs_disk_key_offset(disk_key));
}
static void smpi_encryption_change(const void * const cif,
                                   const twicSmReasonCode_t reason,
                                   const uint8_t key_type,
                                   const bool encryption_enable,
                                   const uint8_t encryption_key_size)
{
  twicTrace();
  print_reasoncode(reason);
  print_key_type(key_type);
  print_encryption(encryption_enable);
  twicUtPrintVal("Eencryption key size", 1, &encryption_key_size);
  twicUtSmpFlags.encryption_done = encryption_enable;
}