diff options
author | Sven-Göran Bergh <sgb@systemasis.org> | 2013-01-14 00:50:49 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-01-14 00:52:03 +0100 |
commit | 52185155088d0910d29c7f4fdf5cb3eecaac8965 (patch) | |
tree | c09709e352e3431a0eddb12d5acc7a5c5a7aac63 /util-linux/volume_id/volume_id_internal.h | |
parent | 07b419dbcb34958d0f6050231783bd78f7d0344f (diff) |
volume_id: uuid_format small code shrink
function old new delta
volume_id_set_uuid 318 300 -18
Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/volume_id/volume_id_internal.h')
-rw-r--r-- | util-linux/volume_id/volume_id_internal.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/util-linux/volume_id/volume_id_internal.h b/util-linux/volume_id/volume_id_internal.h index dd62df399..e26ebaab6 100644 --- a/util-linux/volume_id/volume_id_internal.h +++ b/util-linux/volume_id/volume_id_internal.h @@ -136,11 +136,15 @@ void FAST_FUNC free_volume_id(struct volume_id *id); #define cpu_to_be32(x) (x) #endif +/* volume_id_set_uuid(id,buf,fmt) assumes size of uuid buf + * by shifting: 4 << fmt, except for fmt == UUID_DCE_STRING. + * The constants below should match sizes. + */ enum uuid_format { - UUID_DCE_STRING, - UUID_DCE, - UUID_DOS, - UUID_NTFS, + UUID_DOS = 0, /* 4 bytes */ + UUID_NTFS = 1, /* 8 bytes */ + UUID_DCE = 2, /* 16 bytes */ + UUID_DCE_STRING = 3, /* 36 bytes (VOLUME_ID_UUID_SIZE) */ }; enum endian { |