From 4f4622c417429053bad7943da02b1965ae178a37 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Thu, 29 Sep 2016 17:17:48 -0400 Subject: [PATCH] LU-6245 libcfs: remove last of types abstractions With the complete removal of the types abstraction in the lustre kernel code we can now remove the types.h header in libcfs. Change-Id: I59a4dfbf546db72154d2cb461ee25517c6bd6015 Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/22732 Reviewed-by: Frank Zago Tested-by: Jenkins Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- libcfs/include/libcfs/Makefile.am | 7 +--- libcfs/include/libcfs/libcfs.h | 1 - libcfs/include/libcfs/types.h | 68 --------------------------------------- lustre.spec.in | 1 - lustre/include/lustre_lib.h | 8 +++++ lustre/mdt/mdt_handler.c | 2 +- 6 files changed, 10 insertions(+), 77 deletions(-) delete mode 100644 libcfs/include/libcfs/types.h diff --git a/libcfs/include/libcfs/Makefile.am b/libcfs/include/libcfs/Makefile.am index b9972ad..a9f6866 100644 --- a/libcfs/include/libcfs/Makefile.am +++ b/libcfs/include/libcfs/Makefile.am @@ -3,10 +3,6 @@ DIST_SUBDIRS = linux util libcfsdir = $(includedir)/libcfs -if UTILS -libcfs_HEADERS = types.h -endif - EXTRA_DIST = \ bitmap.h \ curproc.h \ @@ -22,5 +18,4 @@ EXTRA_DIST = \ libcfs_private.h \ libcfs_string.h \ libcfs_time.h \ - libcfs_workitem.h \ - types.h + libcfs_workitem.h diff --git a/libcfs/include/libcfs/libcfs.h b/libcfs/include/libcfs/libcfs.h index b09d8f1..75a6bf1 100644 --- a/libcfs/include/libcfs/libcfs.h +++ b/libcfs/include/libcfs/libcfs.h @@ -39,7 +39,6 @@ #ifdef __KERNEL__ # include -# include # include "curproc.h" #define LIBCFS_VERSION "0.5.0" diff --git a/libcfs/include/libcfs/types.h b/libcfs/include/libcfs/types.h deleted file mode 100644 index 5a80d09..0000000 --- a/libcfs/include/libcfs/types.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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) 2012, 2014, Intel Corporation. - */ -#ifndef _LIBCFS_TYPES_H -#define _LIBCFS_TYPES_H - -#include - -#ifndef __KERNEL__ -# error This include is only for kernel use. -#endif - -#if defined(_ASM_GENERIC_INT_L64_H) -# define LPF64 "l" -#elif defined(_ASM_GENERIC_INT_LL64_H) -# define LPF64 "ll" -#elif !defined(LPF64) -# error "cannot define LPF64" -#endif /* !LPF64 */ - -#define LPU64 "%"LPF64"u" -#define LPD64 "%"LPF64"d" -#define LPX64 "%#"LPF64"x" -#define LPX64i "%"LPF64"x" -#define LPO64 "%#"LPF64"o" - -#define LPLU "%lu" -#define LPLD "%ld" -#define LPLX "%#lx" -#define LPPID "%d" - -#if BITS_PER_LONG == 64 -# define LI_POISON ((int)0x5a5a5a5a5a5a5a5a) -# define LL_POISON ((long)0x5a5a5a5a5a5a5a5a) -# define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a) -#elif BITS_PER_LONG == 32 -# define LI_POISON ((int)0x5a5a5a5a) -# define LL_POISON ((long)0x5a5a5a5a) -# define LP_POISON ((void *)(long)0x5a5a5a5a) -#else /* BITS_PER_LONG == 32 */ -# error "cannot define L{I,L,P}_POISON" -#endif /* BITS_PER_LONG != 32 */ - -#endif /* _LIBCFS_TYPES_H */ diff --git a/lustre.spec.in b/lustre.spec.in index e078822..b8d05bc 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -389,7 +389,6 @@ echo '%{_sbindir}/wiretest' >>lustre-tests.files %{_mandir}/man?/* %endif %{_includedir}/lustre -%{_includedir}/libcfs %endif %{_datadir}/lustre %{_sysconfdir}/udev/rules.d/99-lustre.rules diff --git a/lustre/include/lustre_lib.h b/lustre/include/lustre_lib.h index d765fa2..d2d5f31 100644 --- a/lustre/include/lustre_lib.h +++ b/lustre/include/lustre_lib.h @@ -60,6 +60,14 @@ struct l_wait_info; #include #include +#define LI_POISON 0x5a5a5a5a +#if BITS_PER_LONG > 32 +# define LL_POISON 0x5a5a5a5a5a5a5a5aL +#else +# define LL_POISON 0x5a5a5a5aL +#endif +#define LP_POISON ((void *)LL_POISON) + #ifdef HAVE_SERVER_SUPPORT void target_client_add_cb(struct obd_device *obd, __u64 transno, void *cb_data, int error); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 25a42a7..4f3dacf 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -5726,7 +5726,7 @@ static int mdt_fid2path(struct mdt_thread_info *info, RETURN(-EINVAL); if (!fid_is_namespace_visible(&fp->gf_fid)) { - CDEBUG(D_INFO, "%s: "DFID" is invalid, f_seq should be >= "LPX64 + CDEBUG(D_INFO, "%s: "DFID" is invalid, f_seq should be >= %#llx" ", or f_oid != 0, or f_ver == 0\n", mdt_obd_name(mdt), PFID(&fp->gf_fid), (__u64)FID_SEQ_NORMAL); RETURN(-EINVAL); -- 1.8.3.1