Whamcloud - gitweb
LU-12477 kernel: eliminate lustre_patchless_compat.h 39/35539/7
authorJames Simmons <jsimmons@infradead.org>
Tue, 30 Jul 2019 00:30:39 +0000 (20:30 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Aug 2019 07:54:27 +0000 (07:54 +0000)
Now that kernels earlier than RHEL7 3.11 series are no longer
support we can remove the wrapper related to the header
lustre_patchless_compat.h. With that gone the header can also
be removed.

Change-Id: I496983d3065fdd0718871548aeed6bf50fd0747b
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/35539
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/include/Makefile.am
lustre/include/lustre_compat.h
lustre/include/lustre_patchless_compat.h [deleted file]
lustre/mdc/mdc_request.c

index 4bd7e78..870b928 100644 (file)
@@ -182,25 +182,6 @@ Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
 ]) # LC_QUOTA_CONFIG
 
 #
-# LC_EXPORT_TRUNCATE_COMPLETE_PAGE
-#
-# truncate_complete_page() has never been exported from an upstream kernel
-# remove_from_page_cache() was exported between 2.6.35 and 2.6.38
-# delete_from_page_cache() is exported from 2.6.39
-#
-AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE], [
-LB_CHECK_EXPORT([truncate_complete_page], [mm/truncate.c],
-       [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
-               [kernel export truncate_complete_page])])
-LB_CHECK_EXPORT([remove_from_page_cache], [mm/filemap.c],
-       [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
-               [kernel export remove_from_page_cache])])
-LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
-       [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
-               [kernel export delete_from_page_cache])])
-]) # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
-
-#
 # LC_CONFIG_GSS_KEYRING
 #
 # default 'auto', tests for dependencies, if found, enables;
@@ -1786,23 +1767,6 @@ bdi_cap_map_copy, [
 ]) # LC_HAVE_BDI_CAP_MAP_COPY
 
 #
-# LC_CANCEL_DIRTY_PAGE
-#
-# 4.0.0 kernel removed cancel_dirty_page
-#
-AC_DEFUN([LC_CANCEL_DIRTY_PAGE], [
-LB_CHECK_COMPILE([if cancel_dirty_page still exist],
-cancel_dirty_page, [
-       #include <linux/mm.h>
-],[
-       cancel_dirty_page(NULL, PAGE_SIZE);
-],[
-       AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
-               [cancel_dirty_page is still available])
-])
-]) # LC_CANCEL_DIRTY_PAGE
-
-#
 # LC_IOV_ITER_RW
 #
 # 4.1 kernel has iov_iter_rw
@@ -1855,23 +1819,6 @@ have___bi_cnt, [
 ]) # LC_HAVE___BI_CNT
 
 #
-# LC_NEW_CANCEL_DIRTY_PAGE
-#
-# 4.2 kernel has new cancel_dirty_page
-#
-AC_DEFUN([LC_NEW_CANCEL_DIRTY_PAGE], [
-LB_CHECK_COMPILE([if cancel_dirty_page with one argument exist],
-new_cancel_dirty_page, [
-       #include <linux/mm.h>
-],[
-       cancel_dirty_page(NULL);
-],[
-       AC_DEFINE(HAVE_NEW_CANCEL_DIRTY_PAGE, 1,
-               [cancel_dirty_page with one arguement is available])
-])
-]) # LC_NEW_CANCEL_DIRTY_PAGE
-
-#
 # LC_SYMLINK_OPS_USE_NAMEIDATA
 #
 # For the 4.2+ kernels the file system internal symlink api no
@@ -2878,9 +2825,6 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_OPENSSL_SSK
        LC_OPENSSL_GETSEPOL
 
-       # 2.6.35, 3.0.0
-       LC_EXPORT_TRUNCATE_COMPLETE_PAGE
-
        # 2.6.39
        LC_HAVE_FHANDLE_SYSCALLS
        LC_HAVE_FSTYPE_MOUNT
@@ -2998,16 +2942,12 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_BACKING_DEV_INFO_REMOVAL
        LC_HAVE_BDI_CAP_MAP_COPY
 
-       # 4.0.0
-       LC_CANCEL_DIRTY_PAGE
-
        # 4.1.0
        LC_IOV_ITER_RW
        LC_HAVE_SYNC_READ_WRITE
        LC_HAVE___BI_CNT
 
        # 4.2
-       LC_NEW_CANCEL_DIRTY_PAGE
        LC_BIO_ENDIO_USES_ONE_ARG
        LC_SYMLINK_OPS_USE_NAMEIDATA
 
@@ -3096,7 +3036,6 @@ AC_DEFUN([LC_PROG_LINUX], [
        #
        AS_IF([test "x$enable_server" != xno], [
                LC_STACK_SIZE
-               LC_QUOTA64
                LC_QUOTA_CONFIG
        ])
 ]) # LC_PROG_LINUX
index c7e945a..0dcd3c2 100644 (file)
@@ -78,7 +78,6 @@ EXTRA_DIST = \
        lustre_nrs_orr.h \
        lustre_nrs_tbf.h \
        lustre_obdo.h \
-       lustre_patchless_compat.h \
        lustre_quota.h \
        lustre_req_layout.h \
        lustre_scrub.h \
index 5553521..b8cfb06 100644 (file)
@@ -45,7 +45,6 @@
 #include <linux/slab.h>
 
 #include <libcfs/linux/linux-fs.h>
-#include <lustre_patchless_compat.h>
 #include <obd_support.h>
 
 #define current_ngroups current_cred()->group_info->ngroups
@@ -727,6 +726,16 @@ static inline bool bdev_integrity_enabled(struct block_device *bdev, int rw)
 #define ll_pagevec_init(pvec, n) pagevec_init(pvec, n)
 #endif
 
+#ifdef HAVE_D_COUNT
+#  define ll_d_count(d)                d_count(d)
+#else
+#  define ll_d_count(d)                ((d)->d_count)
+#endif /* HAVE_D_COUNT */
+
+#ifndef HAVE_IN_COMPAT_SYSCALL
+#define in_compat_syscall      is_compat_task
+#endif
+
 #ifdef HAVE_I_PAGES
 #define page_tree i_pages
 #else
diff --git a/lustre/include/lustre_patchless_compat.h b/lustre/include/lustre_patchless_compat.h
deleted file mode 100644 (file)
index 41d589b..0000000
+++ /dev/null
@@ -1,115 +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) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2011, 2014, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef LUSTRE_PATCHLESS_COMPAT_H
-#define LUSTRE_PATCHLESS_COMPAT_H
-
-#include <linux/fs.h>
-#include <linux/mm.h>
-#ifndef HAVE_TRUNCATE_COMPLETE_PAGE
-#include <linux/list.h>
-#include <linux/hash.h>
-
-#ifndef HAVE_DELETE_FROM_PAGE_CACHE /* 2.6.39 */
-#ifndef HAVE_REMOVE_FROM_PAGE_CACHE /* 2.6.35 - 2.6.38 */
-
-/* XXX copy & paste from 2.6.15 kernel */
-static inline void ll_remove_from_page_cache(struct page *page)
-{
-       struct address_space *mapping = page->mapping;
-
-       BUG_ON(!PageLocked(page));
-
-       spin_lock_irq(&mapping->tree_lock);
-       radix_tree_delete(&mapping->page_tree, page->index);
-       page->mapping = NULL;
-       mapping->nrpages--;
-       __dec_zone_page_state(page, NR_FILE_PAGES);
-
-       spin_unlock_irq(&mapping->tree_lock);
-}
-#else /* HAVE_REMOVE_FROM_PAGE_CACHE */
-#define ll_remove_from_page_cache(page) remove_from_page_cache(page)
-#endif /* !HAVE_REMOVE_FROM_PAGE_CACHE */
-
-static inline void ll_delete_from_page_cache(struct page *page)
-{
-        ll_remove_from_page_cache(page);
-       put_page(page);
-}
-#else /* HAVE_DELETE_FROM_PAGE_CACHE */
-#define ll_delete_from_page_cache(page) delete_from_page_cache(page)
-#endif /* !HAVE_DELETE_FROM_PAGE_CACHE */
-
-static inline void
-ll_cancel_dirty_page(struct address_space *mapping, struct page *page)
-{
-#ifdef HAVE_NEW_CANCEL_DIRTY_PAGE
-       cancel_dirty_page(page);
-#elif defined(HAVE_CANCEL_DIRTY_PAGE)
-       cancel_dirty_page(page, PAGE_SIZE);
-#else
-       if (TestClearPageDirty(page))
-               account_page_cleaned(page, mapping);
-#endif /* HAVE_NEW_CANCEL_DIRTY_PAGE */
-}
-
-static inline void
-truncate_complete_page(struct address_space *mapping, struct page *page)
-{
-       if (page->mapping != mapping)
-               return;
-
-       if (PagePrivate(page))
-#ifdef HAVE_INVALIDATE_RANGE
-               page->mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE);
-#else
-               page->mapping->a_ops->invalidatepage(page, 0);
-#endif
-
-       ll_cancel_dirty_page(mapping, page);
-       ClearPageMappedToDisk(page);
-       ll_delete_from_page_cache(page);
-}
-#endif /* !HAVE_TRUNCATE_COMPLETE_PAGE */
-
-#ifdef HAVE_D_COUNT
-#  define ll_d_count(d)                        d_count(d)
-#else
-#  define ll_d_count(d)                        ((d)->d_count)
-#endif /* HAVE_D_COUNT */
-
-#ifndef HAVE_IN_COMPAT_SYSCALL
-#define in_compat_syscall      is_compat_task
-#endif
-
-#endif /* LUSTRE_PATCHLESS_COMPAT_H */
index ad1327c..d6d978d 100644 (file)
@@ -1308,14 +1308,6 @@ struct readpage_param {
        struct md_callback      *rp_cb;
 };
 
-#ifndef HAVE_DELETE_FROM_PAGE_CACHE
-static inline void delete_from_page_cache(struct page *page)
-{
-       remove_from_page_cache(page);
-       put_page(page);
-}
-#endif
-
 /**
  * Read pages from server.
  *