/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, * 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 version 2 for more details (a copy is included * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see * http://www.gnu.org/licenses/gpl-2.0.html * * GPL HEADER END */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * Copyright (c) 2011, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. */ #ifndef __LIBCFS_LINUX_UUID_H__ #define __LIBCFS_LINUX_UUID_H__ #include #define UUID_SIZE 16 /* * The original linux UUID code had uuid_be and uuid_le. * Later uuid_le was changed to guid_t and uuid_be * to uuid_t. See for details kernel commit: * * f9727a17db9bab71ddae91f74f11a8a2f9a0ece6 */ #ifndef HAVE_UUID_T typedef struct { __u8 b[UUID_SIZE]; } uuid_t; static inline void uuid_copy(uuid_t *dst, uuid_t *src) { memcpy(dst, src, sizeof(uuid_t)); } static inline bool uuid_equal(const uuid_t *u1, const uuid_t *u2) { return memcmp(u1, u2, sizeof(uuid_t)) == 0; } #endif #endif /* __LIBCFS_LINUX_UUID_H__ */