Whamcloud - gitweb
LU-9859 libcfs: discard libcfs_prim.h 73/38673/2
authorMr. NeilBrown <neilb@suse.de>
Wed, 20 May 2020 11:43:42 +0000 (07:43 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 2 Jun 2020 04:42:43 +0000 (04:42 +0000)
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 <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-on: https://review.whamcloud.com/38673
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Gian-Carlo DeFazio <defazio1@llnl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/Makefile.am
libcfs/include/libcfs/libcfs.h
libcfs/include/libcfs/libcfs_prim.h [deleted file]
libcfs/include/libcfs/linux/linux-mem.h

index 40b998a..66d1f73 100644 (file)
@@ -15,7 +15,6 @@ EXTRA_DIST = \
        libcfs_fail.h \
        libcfs_hash.h \
        libcfs_heap.h \
        libcfs_fail.h \
        libcfs_hash.h \
        libcfs_heap.h \
-       libcfs_prim.h \
        libcfs_private.h \
        libcfs_string.h \
        libcfs_workitem.h
        libcfs_private.h \
        libcfs_string.h \
        libcfs_workitem.h
index 9b7d3f2..afb748d 100644 (file)
@@ -42,6 +42,7 @@
 #endif
 
 #include <libcfs/linux/linux-misc.h>
 #endif
 
 #include <libcfs/linux/linux-misc.h>
+#include <libcfs/linux/linux-mem.h>
 #include <libcfs/linux/linux-time.h>
 #include <libcfs/linux/linux-wait.h>
 
 #include <libcfs/linux/linux-time.h>
 #include <libcfs/linux/linux-wait.h>
 
@@ -50,7 +51,6 @@
 #include <libcfs/libcfs_private.h>
 #include <libcfs/bitmap.h>
 #include <libcfs/libcfs_cpu.h>
 #include <libcfs/libcfs_private.h>
 #include <libcfs/bitmap.h>
 #include <libcfs/libcfs_cpu.h>
-#include <libcfs/libcfs_prim.h>
 #include <libcfs/libcfs_string.h>
 #include <libcfs/libcfs_workitem.h>
 #include <libcfs/libcfs_hash.h>
 #include <libcfs/libcfs_string.h>
 #include <libcfs/libcfs_workitem.h>
 #include <libcfs/libcfs_hash.h>
 # endif /* !__CHECKER__ */
 #endif /* !__must_hold */
 
 # 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 */
 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));
 
                         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 {                                                                   \
 
 #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 (file)
index c753ab5..0000000
+++ /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 <linux/mm.h>
-#include <linux/sched.h>
-
-/*
- * 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
index 16ff239..1694b80 100644 (file)
 #include <linux/sched/mm.h>
 #endif
 
 #include <linux/sched/mm.h>
 #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)
 {
 #ifndef HAVE_MEMALLOC_RECLAIM
 static inline unsigned int memalloc_noreclaim_save(void)
 {