Merge branch 'uuid-types'
Merge branch 'uuid-types' from git://git.infradead.org/users/hch/uuid.git to satisfy dependencies.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include <linux/resource_ext.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/uuid.h>
|
||||
|
||||
#ifndef _LINUX
|
||||
#define _LINUX
|
||||
@@ -457,7 +458,6 @@ struct acpi_osc_context {
|
||||
struct acpi_buffer ret; /* free by caller if success */
|
||||
};
|
||||
|
||||
acpi_status acpi_str_to_uuid(char *str, u8 *uuid);
|
||||
acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
|
||||
|
||||
/* Indexes into _OSC Capabilities Buffer (DWORDs 2 & 3 are device-specific) */
|
||||
@@ -741,7 +741,7 @@ static inline bool acpi_driver_match_device(struct device *dev,
|
||||
}
|
||||
|
||||
static inline union acpi_object *acpi_evaluate_dsm(acpi_handle handle,
|
||||
const u8 *uuid,
|
||||
const guid_t *guid,
|
||||
int rev, int func,
|
||||
union acpi_object *argv4)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ struct cleancache_filekey {
|
||||
|
||||
struct cleancache_ops {
|
||||
int (*init_fs)(size_t);
|
||||
int (*init_shared_fs)(char *uuid, size_t);
|
||||
int (*init_shared_fs)(uuid_t *uuid, size_t);
|
||||
int (*get_page)(int, struct cleancache_filekey,
|
||||
pgoff_t, struct page *);
|
||||
void (*put_page)(int, struct cleancache_filekey,
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <linux/percpu-rwsem.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/delayed_call.h>
|
||||
#include <linux/uuid.h>
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
#include <uapi/linux/fs.h>
|
||||
@@ -1328,8 +1329,8 @@ struct super_block {
|
||||
|
||||
struct sb_writers s_writers;
|
||||
|
||||
char s_id[32]; /* Informational name */
|
||||
u8 s_uuid[16]; /* UUID */
|
||||
char s_id[32]; /* Informational name */
|
||||
uuid_t s_uuid; /* UUID */
|
||||
|
||||
void *s_fs_info; /* Filesystem private info */
|
||||
unsigned int s_max_links;
|
||||
|
||||
@@ -219,12 +219,6 @@ static inline struct gendisk *part_to_disk(struct hd_struct *part)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int blk_part_pack_uuid(const u8 *uuid_str, u8 *to)
|
||||
{
|
||||
uuid_be_to_bin(uuid_str, (uuid_be *)to);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int disk_max_parts(struct gendisk *disk)
|
||||
{
|
||||
if (disk->flags & GENHD_FL_EXT_DEVT)
|
||||
@@ -736,11 +730,6 @@ static inline dev_t blk_lookup_devt(const char *name, int partno)
|
||||
dev_t devt = MKDEV(0, 0);
|
||||
return devt;
|
||||
}
|
||||
|
||||
static inline int blk_part_pack_uuid(const u8 *uuid_str, u8 *to)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif /* CONFIG_BLOCK */
|
||||
|
||||
#endif /* _LINUX_GENHD_H */
|
||||
|
||||
@@ -177,7 +177,6 @@ struct fcnvme_lsdesc_rjt {
|
||||
};
|
||||
|
||||
|
||||
#define FCNVME_ASSOC_HOSTID_LEN 16
|
||||
#define FCNVME_ASSOC_HOSTNQN_LEN 256
|
||||
#define FCNVME_ASSOC_SUBNQN_LEN 256
|
||||
|
||||
@@ -191,7 +190,7 @@ struct fcnvme_lsdesc_cr_assoc_cmd {
|
||||
__be16 cntlid;
|
||||
__be16 sqsize;
|
||||
__be32 rsvd52;
|
||||
u8 hostid[FCNVME_ASSOC_HOSTID_LEN];
|
||||
uuid_t hostid;
|
||||
u8 hostnqn[FCNVME_ASSOC_HOSTNQN_LEN];
|
||||
u8 subnqn[FCNVME_ASSOC_SUBNQN_LEN];
|
||||
u8 rsvd632[384];
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#define _LINUX_NVME_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/uuid.h>
|
||||
|
||||
/* NQN names in commands fields specified one size */
|
||||
#define NVMF_NQN_FIELD_LEN 256
|
||||
@@ -843,7 +844,7 @@ struct nvmf_connect_command {
|
||||
};
|
||||
|
||||
struct nvmf_connect_data {
|
||||
__u8 hostid[16];
|
||||
uuid_t hostid;
|
||||
__le16 cntlid;
|
||||
char resv4[238];
|
||||
char subsysnqn[NVMF_NQN_FIELD_LEN];
|
||||
|
||||
@@ -105,7 +105,7 @@ static inline void acpiphp_remove_slots(struct pci_bus *bus) { }
|
||||
static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { }
|
||||
#endif
|
||||
|
||||
extern const u8 pci_acpi_dsm_uuid[];
|
||||
extern const guid_t pci_acpi_dsm_guid;
|
||||
#define DEVICE_LABEL_DSM 0x07
|
||||
#define RESET_DELAY_DSM 0x08
|
||||
#define FUNCTION_DELAY_DSM 0x09
|
||||
|
||||
@@ -18,29 +18,16 @@
|
||||
|
||||
#include <uapi/linux/uuid.h>
|
||||
|
||||
/*
|
||||
* V1 (time-based) UUID definition [RFC 4122].
|
||||
* - the timestamp is a 60-bit value, split 32/16/12, and goes in 100ns
|
||||
* increments since midnight 15th October 1582
|
||||
* - add AFS_UUID_TO_UNIX_TIME to convert unix time in 100ns units to UUID
|
||||
* time
|
||||
* - the clock sequence is a 14-bit counter to avoid duplicate times
|
||||
*/
|
||||
struct uuid_v1 {
|
||||
__be32 time_low; /* low part of timestamp */
|
||||
__be16 time_mid; /* mid part of timestamp */
|
||||
__be16 time_hi_and_version; /* high part of timestamp and version */
|
||||
#define UUID_TO_UNIX_TIME 0x01b21dd213814000ULL
|
||||
#define UUID_TIMEHI_MASK 0x0fff
|
||||
#define UUID_VERSION_TIME 0x1000 /* time-based UUID */
|
||||
#define UUID_VERSION_NAME 0x3000 /* name-based UUID */
|
||||
#define UUID_VERSION_RANDOM 0x4000 /* (pseudo-)random generated UUID */
|
||||
u8 clock_seq_hi_and_reserved; /* clock seq hi and variant */
|
||||
#define UUID_CLOCKHI_MASK 0x3f
|
||||
#define UUID_VARIANT_STD 0x80
|
||||
u8 clock_seq_low; /* clock seq low */
|
||||
u8 node[6]; /* spatially unique node ID (MAC addr) */
|
||||
};
|
||||
typedef struct {
|
||||
__u8 b[16];
|
||||
} uuid_t;
|
||||
|
||||
#define UUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
|
||||
((uuid_t) \
|
||||
{{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \
|
||||
((b) >> 8) & 0xff, (b) & 0xff, \
|
||||
((c) >> 8) & 0xff, (c) & 0xff, \
|
||||
(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
|
||||
|
||||
/*
|
||||
* The length of a UUID string ("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||
@@ -48,27 +35,73 @@ struct uuid_v1 {
|
||||
*/
|
||||
#define UUID_STRING_LEN 36
|
||||
|
||||
static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
|
||||
extern const guid_t guid_null;
|
||||
extern const uuid_t uuid_null;
|
||||
|
||||
static inline bool guid_equal(const guid_t *u1, const guid_t *u2)
|
||||
{
|
||||
return memcmp(&u1, &u2, sizeof(uuid_le));
|
||||
return memcmp(u1, u2, sizeof(guid_t)) == 0;
|
||||
}
|
||||
|
||||
static inline int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
|
||||
static inline void guid_copy(guid_t *dst, const guid_t *src)
|
||||
{
|
||||
return memcmp(&u1, &u2, sizeof(uuid_be));
|
||||
memcpy(dst, src, sizeof(guid_t));
|
||||
}
|
||||
|
||||
static inline bool guid_is_null(guid_t *guid)
|
||||
{
|
||||
return guid_equal(guid, &guid_null);
|
||||
}
|
||||
|
||||
static inline bool uuid_equal(const uuid_t *u1, const uuid_t *u2)
|
||||
{
|
||||
return memcmp(u1, u2, sizeof(uuid_t)) == 0;
|
||||
}
|
||||
|
||||
static inline void uuid_copy(uuid_t *dst, const uuid_t *src)
|
||||
{
|
||||
memcpy(dst, src, sizeof(uuid_t));
|
||||
}
|
||||
|
||||
static inline bool uuid_is_null(uuid_t *uuid)
|
||||
{
|
||||
return uuid_equal(uuid, &uuid_null);
|
||||
}
|
||||
|
||||
void generate_random_uuid(unsigned char uuid[16]);
|
||||
|
||||
extern void uuid_le_gen(uuid_le *u);
|
||||
extern void uuid_be_gen(uuid_be *u);
|
||||
extern void guid_gen(guid_t *u);
|
||||
extern void uuid_gen(uuid_t *u);
|
||||
|
||||
bool __must_check uuid_is_valid(const char *uuid);
|
||||
|
||||
extern const u8 uuid_le_index[16];
|
||||
extern const u8 uuid_be_index[16];
|
||||
extern const u8 guid_index[16];
|
||||
extern const u8 uuid_index[16];
|
||||
|
||||
int uuid_le_to_bin(const char *uuid, uuid_le *u);
|
||||
int uuid_be_to_bin(const char *uuid, uuid_be *u);
|
||||
int guid_parse(const char *uuid, guid_t *u);
|
||||
int uuid_parse(const char *uuid, uuid_t *u);
|
||||
|
||||
/* backwards compatibility, don't use in new code */
|
||||
typedef uuid_t uuid_be;
|
||||
#define UUID_BE(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
|
||||
UUID_INIT(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7)
|
||||
#define NULL_UUID_BE \
|
||||
UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
|
||||
0x00, 0x00, 0x00, 0x00)
|
||||
|
||||
#define uuid_le_gen(u) guid_gen(u)
|
||||
#define uuid_be_gen(u) uuid_gen(u)
|
||||
#define uuid_le_to_bin(guid, u) guid_parse(guid, u)
|
||||
#define uuid_be_to_bin(uuid, u) uuid_parse(uuid, u)
|
||||
|
||||
static inline int uuid_le_cmp(const guid_t u1, const guid_t u2)
|
||||
{
|
||||
return memcmp(&u1, &u2, sizeof(guid_t));
|
||||
}
|
||||
|
||||
static inline int uuid_be_cmp(const uuid_t u1, const uuid_t u2)
|
||||
{
|
||||
return memcmp(&u1, &u2, sizeof(uuid_t));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user