aboutsummaryrefslogtreecommitdiff
path: root/lib/uuid.c
AgeCommit message (Collapse)AuthorFilesLines
2020-03-23uuid: Provide a GUID generator for raw bufferAndy Shevchenko1-0/+10
In some cases we would like to generate a GUID and export it. Though it would require either casting to internal kernel types or an intermediate buffer. Instead we may achieve this by supplying a pointer to raw buffer and make a complimentary API to existing one for UUIDs. Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: David Sterba <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174Thomas Gleixner1-9/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-12-11Documentation: add UUID/GUID to kernel-apiRandy Dunlap1-17/+17
Update kernel-doc notation in lib/uuid.c and then add UUID/GUID function interfaces to kernel-api. Signed-off-by: Randy Dunlap <[email protected]> [jc: tweaked the uuid_is_valid() kerneldoc] Signed-off-by: Jonathan Corbet <[email protected]>
2017-06-05uuid: hoist uuid_is_null() helper from libnvdimmChristoph Hellwig1-0/+5
Hoist the libnvdimm helper as an inline helper to linux/uuid.h using an auxiliary const variable uuid_null in lib/uuid.c. [hch: also add the guid variant. Both do the same but I'd like to keep casts to a minimum] The common helper uses the new abstract type uuid_t * instead of u8 *. Suggested-by: Christoph Hellwig <[email protected]> Signed-off-by: Amir Goldstein <[email protected]> [hch: added guid_is_null] Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Dan Williams <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-06-05uuid: don't export guid_index and uuid_indexChristoph Hellwig1-2/+0
These are only used in uuid.c and vsprintf.c and aren't something modules should use directly. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Amir Goldstein <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-06-05uuid: rename uuid typesChristoph Hellwig1-15/+15
Our "little endian" UUID really is a Wintel GUID, so rename it and its helpers such (guid_t). The big endian UUID is the only true one, so give it the name uuid_t. The uuid_le and uuid_be names are retained for now, but will hopefully go away soon. The exception to that are the _cmp helpers that will be replaced by better primitives ASAP and thus don't get the new names. Also the _to_bin helpers are named to match the better named uuid_parse routine in userspace. Also remove the existing typedef in XFS that's now been superceeded by the generic type name. Signed-off-by: Christoph Hellwig <[email protected]> [andy: also update the UUID_LE/UUID_BE macros including fallout] Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Amir Goldstein <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2016-05-30lib/uuid.c: use correct offset in uuid parserBjørn Mork1-2/+2
Use '+ 0' and '+ 1' as offsets, like they were intended, instead of adding to the result. Fixes: 2b1b0d66704a ("lib/uuid.c: introduce a few more generic helpers") Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2016-05-20lib/uuid.c: remove FSF addressAndy Shevchenko1-5/+1
There is no point in keeping an address in the file since it's subject to change. While here, update Intel Copyright years. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Matt Fleming <[email protected]> Cc: Dmitry Kasatkin <[email protected]> Cc: Mimi Zohar <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Al Viro <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2016-05-20lib/uuid.c: introduce a few more generic helpersAndy Shevchenko1-0/+65
There are new helpers in this patch: uuid_is_valid checks if a UUID is valid uuid_be_to_bin converts from string to binary (big endian) uuid_le_to_bin converts from string to binary (little endian) They will be used in future, i.e. in the following patches in the series. This also moves the indices arrays to lib/uuid.c to be shared accross modules. [[email protected]: fix typo] Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Matt Fleming <[email protected]> Cc: Dmitry Kasatkin <[email protected]> Cc: Mimi Zohar <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Al Viro <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2016-05-20lib/uuid.c: move generate_random_uuid() to uuid.cAndy Shevchenko1-0/+20
Let's gather the UUID related functions under one hood. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Matt Fleming <[email protected]> Cc: Dmitry Kasatkin <[email protected]> Cc: Mimi Zohar <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Al Viro <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-04-29uuid: use prandom_bytes()Akinobu Mita1-7/+1
Use prandom_bytes() to generate 16 bytes of pseudo-random bytes. Signed-off-by: Akinobu Mita <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Huang Ying <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-03-07lib: reduce the use of module.h wherever possiblePaul Gortmaker1-1/+1
For files only using THIS_MODULE and/or EXPORT_SYMBOL, map them onto including export.h -- or if the file isn't even using those, then just delete the include. Fix up any implicit include dependencies that were being masked by module.h along the way. Signed-off-by: Paul Gortmaker <[email protected]>
2010-05-19Unified UUID/GUID definitionHuang Ying1-0/+53
There are many different UUID/GUID definitions in kernel, such as that in EFI, many file systems, some drivers, etc. Every kernel components need UUID/GUID has its own definition. This patch provides a unified definition for UUID/GUID. UUID is defined via typedef. This makes that UUID appears more like a preliminary type, and makes the data type explicit (comparing with implicit "u8 uuid[16]"). The binary representation of UUID/GUID can be little-endian (used by EFI, etc) or big-endian (defined by RFC4122), so both is defined. Signed-off-by: Huang Ying <[email protected]> Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Len Brown <[email protected]>