File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -920,23 +920,16 @@ char *nvmf_hostnqn_generate()
920920 char * hostnqn ;
921921 int ret ;
922922 char uuid_str [UUID_SIZE ];
923- #ifdef CONFIG_LIBUUID
924923 uuid_t uuid ;
925- #endif
926924
927925 ret = uuid_from_dmi (uuid_str );
928926 if (ret < 0 ) {
929927 ret = uuid_from_device_tree (uuid_str );
930928 }
931- #ifdef CONFIG_LIBUUID
932929 if (ret < 0 ) {
933930 uuid_generate_random (uuid );
934931 uuid_unparse_lower (uuid , uuid_str );
935- ret = 0 ;
936932 }
937- #endif
938- if (ret < 0 )
939- return NULL ;
940933
941934 if (asprintf (& hostnqn , "nqn.2014-08.org.nvmexpress:uuid:%s" , uuid_str ) < 0 )
942935 return NULL ;
Original file line number Diff line number Diff line change 1313
1414#include "fabrics.h"
1515
16- #ifdef CONFIG_LIBUUID
1716#include <uuid/uuid.h>
18- #endif
1917
2018
2119extern const char * nvme_ctrl_sysfs_dir ;
@@ -56,11 +54,7 @@ struct nvme_ns {
5654
5755 uint8_t eui64 [8 ];
5856 uint8_t nguid [16 ];
59- #ifdef CONFIG_LIBUUID
6057 uuid_t uuid ;
61- #else
62- uint8_t uuid [16 ];
63- #endif
6458 enum nvme_csi csi ;
6559};
6660
Original file line number Diff line number Diff line change @@ -1464,17 +1464,10 @@ const uint8_t *nvme_ns_get_nguid(nvme_ns_t n)
14641464 return n -> nguid ;
14651465}
14661466
1467- #ifdef CONFIG_LIBUUID
14681467void nvme_ns_get_uuid (nvme_ns_t n , uuid_t out )
14691468{
14701469 uuid_copy (out , n -> uuid );
14711470}
1472- #else
1473- void nvme_ns_get_uuid (nvme_ns_t n , uint8_t * out )
1474- {
1475- memcpy (out , n , 16 );
1476- }
1477- #endif
14781471
14791472int nvme_ns_identify (nvme_ns_t n , struct nvme_id_ns * ns )
14801473{
Original file line number Diff line number Diff line change 1515#include <stddef.h>
1616
1717#include <sys/types.h>
18- #ifdef CONFIG_LIBUUID
1918#include <uuid/uuid.h>
20- #endif
19+
2120#include "ioctl.h"
2221#include "util.h"
2322
@@ -484,11 +483,7 @@ const uint8_t *nvme_ns_get_nguid(nvme_ns_t n);
484483 *
485484 * Copies the namespace's uuid into @out
486485 */
487- #ifdef CONFIG_LIBUUID
488486void nvme_ns_get_uuid (nvme_ns_t n , uuid_t out );
489- #else
490- void nvme_ns_get_uuid (nvme_ns_t n , uint8_t * out );
491- #endif
492487
493488/**
494489 * nvme_ns_get_sysfs_dir() - sysfs directory of an nvme_ns_t object
Original file line number Diff line number Diff line change 1919#include <string.h>
2020#include <stdbool.h>
2121#include <inttypes.h>
22- #ifdef CONFIG_LIBUUID
2322#include <uuid/uuid.h>
24- #endif
2523#include <libnvme.h>
2624
2725#include <ccan/endian/endian.h>
@@ -368,10 +366,8 @@ int main(int argc, char **argv)
368366 nvme_ctrl_get_state (c ));
369367
370368 nvme_ctrl_for_each_ns (c , n ) {
371- #ifdef CONFIG_LIBUUID
372369 char uuid_str [40 ];
373370 uuid_t uuid ;
374- #endif
375371 printf (" `- %s lba size:%d lba max:%" PRIu64 "\n" ,
376372 nvme_ns_get_name (n ),
377373 nvme_ns_get_lba_size (n ),
@@ -380,12 +376,10 @@ int main(int argc, char **argv)
380376 print_hex (nvme_ns_get_eui64 (n ), 8 );
381377 printf (" nguid:" );
382378 print_hex (nvme_ns_get_nguid (n ), 16 );
383- #ifdef CONFIG_LIBUUID
384379 nvme_ns_get_uuid (n , uuid );
385380 uuid_unparse_lower (uuid , uuid_str );
386381 printf (" uuid:%s csi:%d\n" , uuid_str ,
387382 nvme_ns_get_csi (n ));
388- #endif
389383 }
390384
391385 nvme_ctrl_for_each_path (c , p )
You can’t perform that action at this time.
0 commit comments