From e8347675d0649252f74156362a8bd32330dfed45 Mon Sep 17 00:00:00 2001 From: "Mr. NeilBrown" Date: Wed, 20 May 2020 07:43:42 -0400 Subject: [PATCH] LU-9859 libcfs: discard libcfs_prim.h This file no longer contains enough content to justify a separate file. So merge with libcfs.h. Linux-commit: 7673fd6b6af0c234e8ed5ec94c4da083b2f7d354 Change-Id: I4f486f0356f14e564032ed22e2e439fe4e65942c Test-Parameters: trivial Signed-off-by: Mr. NeilBrown Signed-off-by: Greg Kroah-Hartman Reviewed-on: https://review.whamcloud.com/38673 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Gian-Carlo DeFazio Reviewed-by: Oleg Drokin --- libcfs/include/libcfs/Makefile.am | 1 - libcfs/include/libcfs/libcfs.h | 22 +++++++------- libcfs/include/libcfs/libcfs_prim.h | 53 --------------------------------- libcfs/include/libcfs/linux/linux-mem.h | 10 +++++++ 4 files changed, 21 insertions(+), 65 deletions(-) delete mode 100644 libcfs/include/libcfs/libcfs_prim.h diff --git a/libcfs/include/libcfs/Makefile.am b/libcfs/include/libcfs/Makefile.am index 40b998a..66d1f73 100644 --- a/libcfs/include/libcfs/Makefile.am +++ b/libcfs/include/libcfs/Makefile.am @@ -15,7 +15,6 @@ EXTRA_DIST = \ libcfs_fail.h \ libcfs_hash.h \ libcfs_heap.h \ - libcfs_prim.h \ libcfs_private.h \ libcfs_string.h \ libcfs_workitem.h diff --git a/libcfs/include/libcfs/libcfs.h b/libcfs/include/libcfs/libcfs.h index 9b7d3f2..afb748d 100644 --- a/libcfs/include/libcfs/libcfs.h +++ b/libcfs/include/libcfs/libcfs.h @@ -42,6 +42,7 @@ #endif #include +#include #include #include @@ -50,7 +51,6 @@ #include #include #include -#include #include #include #include @@ -72,16 +72,6 @@ # endif /* !__CHECKER__ */ #endif /* !__must_hold */ -#ifdef HAVE_TOTALRAM_PAGES_AS_FUNC - #ifndef cfs_totalram_pages - #define cfs_totalram_pages() totalram_pages() - #endif -#else - #ifndef cfs_totalram_pages - #define cfs_totalram_pages() totalram_pages - #endif -#endif - typedef s32 timeout_t; /* need both kernel and user-land acceptor */ @@ -121,6 +111,16 @@ int lprocfs_call_handler(void *data, int write, loff_t *ppos, int (*handler)(void *data, int write, loff_t pos, void __user *buffer, int len)); +/* + * Memory + */ +#if BITS_PER_LONG == 32 +/* limit to lowmem on 32-bit systems */ +#define NUM_CACHEPAGES \ + min(cfs_totalram_pages(), 1UL << (30 - PAGE_SHIFT) * 3 / 4) +#else +#define NUM_CACHEPAGES cfs_totalram_pages() +#endif #define wait_var_event_warning(var, condition, format, ...) \ do { \ diff --git a/libcfs/include/libcfs/libcfs_prim.h b/libcfs/include/libcfs/libcfs_prim.h deleted file mode 100644 index c753ab5..0000000 --- a/libcfs/include/libcfs/libcfs_prim.h +++ /dev/null @@ -1,53 +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. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * libcfs/include/libcfs/libcfs_prim.h - * - * General primitives. - * - */ - -#ifndef __LIBCFS_PRIM_H__ -#define __LIBCFS_PRIM_H__ - -#include -#include - -/* - * Memory - */ -#if BITS_PER_LONG == 32 -/* limit to lowmem on 32-bit systems */ -# define NUM_CACHEPAGES \ - min(cfs_totalram_pages(), 1UL << (30 - PAGE_SHIFT) * 3 / 4) -#else -# define NUM_CACHEPAGES cfs_totalram_pages() -#endif - -#endif diff --git a/libcfs/include/libcfs/linux/linux-mem.h b/libcfs/include/libcfs/linux/linux-mem.h index 16ff239..1694b80 100644 --- a/libcfs/include/libcfs/linux/linux-mem.h +++ b/libcfs/include/libcfs/linux/linux-mem.h @@ -49,6 +49,16 @@ #include #endif +#ifdef HAVE_TOTALRAM_PAGES_AS_FUNC + #ifndef cfs_totalram_pages + #define cfs_totalram_pages() totalram_pages() + #endif +#else + #ifndef cfs_totalram_pages + #define cfs_totalram_pages() totalram_pages + #endif +#endif + #ifndef HAVE_MEMALLOC_RECLAIM static inline unsigned int memalloc_noreclaim_save(void) { -- 1.8.3.1