]) # LIBCFS_CPUS_READ_LOCK
#
-# Kernel version 4.12-rc3 f9727a17db9bab71ddae91f74f11a8a2f9a0ece6
-# renamed uuid_be to uuid_t
-#
-AC_DEFUN([LIBCFS_SRC_UUID_T], [
- LB2_LINUX_TEST_SRC([uuid_t], [
- #include <linux/uuid.h>
- ],[
- uuid_t uuid;
-
- memset(uuid.b, 0, 16);
- ])
-])
-AC_DEFUN([LIBCFS_UUID_T], [
- AC_MSG_CHECKING([if 'uuid_t' exist])
- LB2_LINUX_TEST_RESULT([uuid_t], [
- AC_DEFINE(HAVE_UUID_T, 1, ['uuid_t' exist])
- ])
-]) # LIBCFS_UUID_T
-
-#
# Kernel version 4.12-rc3 commit fd851a3cdc196bfc1d229b5f22369069af532bf8
# introduce processor.h
#
LIBCFS_SRC_RHT_BUCKET_VAR
# 4.12
LIBCFS_SRC_CPUS_READ_LOCK
- LIBCFS_SRC_UUID_T
LIBCFS_SRC_WAIT_QUEUE_TASK_LIST_RENAME
LIBCFS_SRC_WAIT_BIT_QUEUE_ENTRY_EXISTS
LIBCFS_SRC_MEMALLOC_NORECLAIM
LIBCFS_RHT_BUCKET_VAR
# 4.12
LIBCFS_CPUS_READ_LOCK
- LIBCFS_UUID_T
LIBCFS_WAIT_QUEUE_TASK_LIST_RENAME
LIBCFS_WAIT_BIT_QUEUE_ENTRY_EXISTS
LIBCFS_MEMALLOC_NORECLAIM
EXTRA_DIST = linux-misc.h linux-fs.h linux-mem.h linux-time.h linux-cpu.h \
- linux-list.h linux-hash.h linux-uuid.h linux-wait.h linux-net.h \
+ linux-list.h linux-hash.h linux-wait.h linux-net.h \
generic-radix-tree.h glob.h refcount.h processor.h xarray.h \
linux-fortify-string.h
+++ /dev/null
-/*
- * 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/
- */
-
-#ifndef __LIBCFS_LINUX_UUID_H__
-#define __LIBCFS_LINUX_UUID_H__
-
-#include <linux/uuid.h>
-
-#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__ */
]) # LC_HAVE_GET_INODE_USAGE
#
-# Kernel version 4.12-rc3 85787090a21eb749d8b347eaf9ff1a455637473c
-# changed struct super_block s_uuid into a proper uuid_t
-#
-AC_DEFUN([LC_SRC_SUPER_BLOCK_S_UUID], [
- LB2_LINUX_TEST_SRC([super_block_s_uuid], [
- #include <linux/fs.h>
- ],[
- struct super_block sb;
-
- uuid_parse(NULL, &sb.s_uuid);
- ])
-])
-AC_DEFUN([LC_SUPER_BLOCK_S_UUID], [
- AC_MSG_CHECKING([if 'struct super_block' s_uuid is uuid_t])
- LB2_LINUX_TEST_RESULT([super_block_s_uuid], [
- AC_DEFINE(HAVE_S_UUID_AS_UUID_T, 1, ['s_uuid' is an uuid_t])
- ])
-]) # LC_SUPER_BLOCK_S_UUID
-
-#
# LC_SUPER_SETUP_BDI_NAME
#
# Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
# 4.12
LC_SRC_CURRENT_TIME
- LC_SRC_SUPER_BLOCK_S_UUID
LC_SRC_SUPER_SETUP_BDI_NAME
LC_SRC_BI_STATUS
# 4.12
LC_CURRENT_TIME
- LC_SUPER_BLOCK_S_UUID
LC_SUPER_SETUP_BDI_NAME
LC_BI_STATUS
#ifndef _LUSTRE_SCRUB_H
# define _LUSTRE_SCRUB_H
-#include <libcfs/linux/linux-uuid.h>
+#include <linux/uuid.h>
#include <dt_object.h>
#include <lustre_net.h>
struct scrub_file {
/* 128-bit uuid for volume. */
- uuid_t sf_uuid;
+ guid_t sf_uuid;
/* See 'enum scrub_flags'. */
__u64 sf_flags;
char liru_name[0];
};
-void scrub_file_init(struct lustre_scrub *scrub, uuid_t uuid);
-void scrub_file_reset(struct lustre_scrub *scrub, uuid_t uuid, u64 flags);
+void scrub_file_init(struct lustre_scrub *scrub, guid_t uuid);
+void scrub_file_reset(struct lustre_scrub *scrub, guid_t uuid, u64 flags);
int scrub_file_load(const struct lu_env *env, struct lustre_scrub *scrub);
int scrub_file_store(const struct lu_env *env, struct lustre_scrub *scrub);
bool scrub_needs_check(struct lustre_scrub *scrub, const struct lu_fid *fid,
u64 index);
int scrub_checkpoint(const struct lu_env *env, struct lustre_scrub *scrub);
int scrub_thread_prep(const struct lu_env *env, struct lustre_scrub *scrub,
- uuid_t uuid, u64 start);
+ guid_t uuid, u64 start);
int scrub_thread_post(const struct lu_env *env, struct lustre_scrub *scrub,
int result);
int scrub_start(int (*threadfn)(void *data), struct lustre_scrub *scrub,
#include <linux/time.h>
#include <linux/file.h>
#include <linux/types.h>
-#include <libcfs/linux/linux-uuid.h>
+#include <linux/uuid.h>
#include <linux/version.h>
#include <linux/mm.h>
#include <linux/user_namespace.h>
#define D_MOUNT (D_SUPER|D_CONFIG/*|D_WARNING */)
#define PRINT_CMD CDEBUG
-#include <obd.h>
-#include <obd_class.h>
#include <linux/random.h>
-#include <libcfs/linux/linux-uuid.h>
+#include <linux/uuid.h>
#include <linux/version.h>
+
+#include <obd.h>
+#include <obd_class.h>
+#include <lustre_crypto.h>
#include <lustre_log.h>
#include <lustre_disk.h>
#include <uapi/linux/lustre/lustre_param.h>
-#include <lustre_crypto.h>
/**************** config llog ********************/
static void scrub_file_to_cpu(struct scrub_file *des, struct scrub_file *src)
{
- uuid_copy(&des->sf_uuid, &src->sf_uuid);
+ guid_copy(&des->sf_uuid, &src->sf_uuid);
des->sf_flags = le64_to_cpu(src->sf_flags);
des->sf_magic = le32_to_cpu(src->sf_magic);
des->sf_status = le16_to_cpu(src->sf_status);
static void scrub_file_to_le(struct scrub_file *des, struct scrub_file *src)
{
- uuid_copy(&des->sf_uuid, &src->sf_uuid);
+ guid_copy(&des->sf_uuid, &src->sf_uuid);
des->sf_flags = cpu_to_le64(src->sf_flags);
des->sf_magic = cpu_to_le32(src->sf_magic);
des->sf_status = cpu_to_le16(src->sf_status);
memcpy(des->sf_oi_bitmap, src->sf_oi_bitmap, SCRUB_OI_BITMAP_SIZE);
}
-void scrub_file_init(struct lustre_scrub *scrub, uuid_t uuid)
+void scrub_file_init(struct lustre_scrub *scrub, guid_t uuid)
{
struct scrub_file *sf = &scrub->os_file;
memset(sf, 0, sizeof(*sf));
- uuid_copy(&sf->sf_uuid, &uuid);
+ guid_copy(&sf->sf_uuid, &uuid);
sf->sf_magic = SCRUB_MAGIC_V2;
sf->sf_status = SS_INIT;
}
EXPORT_SYMBOL(scrub_file_init);
-void scrub_file_reset(struct lustre_scrub *scrub, uuid_t uuid, u64 flags)
+void scrub_file_reset(struct lustre_scrub *scrub, guid_t uuid, u64 flags)
{
struct scrub_file *sf = &scrub->os_file;
"%#llx, add flags = %#llx\n",
scrub->os_name, sf->sf_flags, flags);
- uuid_copy(&sf->sf_uuid, &uuid);
+ guid_copy(&sf->sf_uuid, &uuid);
sf->sf_magic = SCRUB_MAGIC_V2;
sf->sf_status = SS_INIT;
sf->sf_flags |= flags;
EXPORT_SYMBOL(scrub_checkpoint);
int scrub_thread_prep(const struct lu_env *env, struct lustre_scrub *scrub,
- uuid_t uuid, u64 start)
+ guid_t uuid, u64 start)
{
struct scrub_file *sf = &scrub->os_file;
u32 flags = scrub->os_start_flags;
atomic_t od_r_in_flight;
atomic_t od_w_in_flight;
- struct mutex od_otable_mutex;
- struct osd_otable_it *od_otable_it;
- struct osd_scrub od_scrub;
- struct list_head od_ios_list;
+ struct mutex od_otable_mutex;
+ struct osd_otable_it *od_otable_it;
+ struct osd_scrub od_scrub;
+ struct list_head od_ios_list;
/* service name associated with the osd device */
- char od_svname[MAX_OBD_NAME];
- char od_mntdev[MAX_OBD_NAME];
- uuid_t od_uuid;
+ char od_svname[MAX_OBD_NAME];
+ char od_mntdev[MAX_OBD_NAME];
+ guid_t od_uuid;
/* quota slave instance for inode */
- struct qsd_instance *od_quota_slave_md;
+ struct qsd_instance *od_quota_slave_md;
/* quota slave instance for block */
- struct qsd_instance *od_quota_slave_dt;
+ struct qsd_instance *od_quota_slave_dt;
/* osd seq instance */
struct lu_client_seq *od_cl_seq;
if (IS_ERR_OR_NULL(obj))
RETURN(obj ? PTR_ERR(obj) : -ENOENT);
-#ifndef HAVE_S_UUID_AS_UUID_T
- memcpy(dev->od_uuid.b, sb->s_uuid, sizeof(dev->od_uuid));
-#else
- uuid_copy(&dev->od_uuid, &sb->s_uuid);
-#endif
+ guid_copy(&dev->od_uuid, (guid_t *)&sb->s_uuid);
scrub->os_obj = obj;
rc = scrub_file_load(env, scrub);
if (rc == -ENOENT || rc == -EFAULT) {
} else if (rc < 0) {
GOTO(cleanup_obj, rc);
} else {
- if (!uuid_equal(&sf->sf_uuid, &dev->od_uuid)) {
+ if (!guid_equal(&sf->sf_uuid, &dev->od_uuid)) {
CDEBUG(D_LFSCK,
"%s: UUID has been changed from %pU to %pU\n",
osd_dev2name(dev), &sf->sf_uuid, &dev->od_uuid);
enum lustre_index_backup_policy od_index_backup_policy;
char od_mntdev[128];
char od_svname[128];
- uuid_t od_uuid;
+ guid_t od_uuid;
int od_connects;
int od_index;
} else if (rc < 0) {
GOTO(cleanup_obj, rc);
} else {
- if (!uuid_equal(&sf->sf_uuid, &dev->od_uuid)) {
+ if (!guid_equal(&sf->sf_uuid, &dev->od_uuid)) {
CDEBUG(D_LFSCK,
"%s: UUID has been changed from %pU to %pU\n",
osd_name(dev), &sf->sf_uuid, &dev->od_uuid);