From 2e785baf29a68349e430a00c6844bb59f5c28961 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Wed, 24 Dec 2008 17:45:20 +0000 Subject: [PATCH] Branch b1_8 b=17153 i=adilger, tappro Remove 2.4 compatibility from build process. --- lustre/autoconf/lustre-core.m4 | 94 +----------------------- lustre/llite/autoMakefile.am | 2 +- lustre/llite/rw24.c | 161 ----------------------------------------- lustre/lvfs/Makefile.in | 2 - lustre/obdclass/Makefile.in | 14 ---- lustre/ptlrpc/Makefile.in | 4 - 6 files changed, 2 insertions(+), 275 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 9b684da..631d084 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -83,43 +83,6 @@ $2 ]) # -# LC_STRUCT_KIOBUF -# -# rh 2.4.18 has iobuf->dovary, but other kernels do not -# -AC_DEFUN([LC_STRUCT_KIOBUF], -[AC_MSG_CHECKING([if struct kiobuf has a dovary field]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct kiobuf iobuf; - iobuf.dovary = 1; -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# LC_FUNC_COND_RESCHED -# -# cond_resched() was introduced in 2.4.20 -# -AC_DEFUN([LC_FUNC_COND_RESCHED], -[AC_MSG_CHECKING([if kernel offers cond_resched]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - cond_resched(); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found]) -],[ - AC_MSG_RESULT([no]) -]) -]) # # LC_FUNC_RELEASEPAGE_WITH_GFP @@ -140,40 +103,6 @@ else fi ]) - -# -# LC_FUNC_ZAP_PAGE_RANGE -# -# if zap_page_range() takes a vma arg -# -AC_DEFUN([LC_FUNC_ZAP_PAGE_RANGE], -[AC_MSG_CHECKING([if zap_page_range with vma parameter]) -ZAP_PAGE_RANGE_VMA="`grep -c 'zap_page_range.*struct vm_area_struct' $LINUX/include/linux/mm.h`" -if test "$ZAP_PAGE_RANGE_VMA" != 0 ; then - AC_DEFINE(ZAP_PAGE_RANGE_VMA, 1, [zap_page_range with vma parameter]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi -]) - -# -# LC_FUNC_PDE -# -# if proc_fs.h defines PDE() -# -AC_DEFUN([LC_FUNC_PDE], -[AC_MSG_CHECKING([if kernel defines PDE]) -HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`" -if test "$HAVE_PDE" != 0 ; then - AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi -]) - -# # LC_FUNC_FILEMAP_FDATASYNC # # if filemap_fdatasync() exists @@ -193,22 +122,6 @@ LB_LINUX_TRY_COMPILE([ ]) # -# LC_FUNC_DIRECT_IO -# -# if direct_IO takes a struct file argument -# -AC_DEFUN([LC_FUNC_DIRECT_IO], -[AC_MSG_CHECKING([if kernel passes struct file to direct_IO]) -HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`" -if test "$HAVE_DIO_FILE" != 0 ; then - AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO]) - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi -]) - -# # LC_HEADER_MM_INLINE # # RHEL kernels define page_count in mm_inline.h @@ -355,7 +268,7 @@ BACKINGFS="ldiskfs" if test x$with_ldiskfs = xno ; then BACKINGFS="ext3" - if test x$linux25$enable_server = xyesyes ; then + if test x$enable_server = xyes ; then AC_MSG_ERROR([ldiskfs is required for 2.6-based servers.]) fi @@ -1400,12 +1313,7 @@ AC_DEFUN([LC_PROG_LINUX], LC_EXPORT___D_MOVE LC_EXPORT_NODE_TO_CPUMASK - LC_STRUCT_KIOBUF - LC_FUNC_COND_RESCHED LC_FUNC_RELEASEPAGE_WITH_GFP - LC_FUNC_ZAP_PAGE_RANGE - LC_FUNC_PDE - LC_FUNC_DIRECT_IO LC_HEADER_MM_INLINE LC_STRUCT_INODE LC_FUNC_REGISTER_CACHE diff --git a/lustre/llite/autoMakefile.am b/lustre/llite/autoMakefile.am index 5dcc0cd..e92fd19 100644 --- a/lustre/llite/autoMakefile.am +++ b/lustre/llite/autoMakefile.am @@ -38,6 +38,6 @@ if MODULES modulefs_DATA = lustre$(KMODEXT) llite_lloop$(KMODEXT) endif -DIST_SOURCES := $(lustre-objs:.o=.c) llite_internal.h rw24.c super.c rw26.c super25.c +DIST_SOURCES := $(lustre-objs:.o=.c) llite_internal.h super.c rw26.c super25.c DIST_SOURCES += $(llite_lloop-objs:.o=.c) MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ diff --git a/lustre/llite/rw24.c b/lustre/llite/rw24.c index 4652d5f..e69de29 100644 --- a/lustre/llite/rw24.c +++ b/lustre/llite/rw24.c @@ -1,161 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * 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.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. 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. - * - * lustre/llite/rw24.c - * - * Lustre Lite I/O page cache for the 2.4 kernel version - */ - -#ifndef AUTOCONF_INCLUDED -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#define DEBUG_SUBSYSTEM S_LLITE - -#include -#include "llite_internal.h" -#include - -static int ll_direct_IO_24(int rw, -#ifdef HAVE_DIO_FILE - struct file *file, -#else - struct inode *inode, -#endif - struct kiobuf *iobuf, unsigned long blocknr, - int blocksize) -{ -#ifdef HAVE_DIO_FILE - struct inode *inode = file->f_dentry->d_inode; -#endif - struct ll_inode_info *lli = ll_i2info(inode); - struct lov_stripe_md *lsm = lli->lli_smd; - struct brw_page *pga; - struct obdo oa; - int length, i, flags, rc = 0; - loff_t offset, offset_orig; - ENTRY; - - if (!lsm || !lsm->lsm_object_id) - RETURN(-EBADF); - - offset = ((obd_off)blocknr << inode->i_blkbits); - offset_orig = offset; - CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), size="LPSZ - ", offset=%lld=%llx, pages %u\n", - inode->i_ino, inode->i_generation, inode, iobuf->length, - offset, offset, iobuf->nr_pages); - - /* FIXME: io smaller than CFS_PAGE_SIZE is broken on ia64 */ - if ((iobuf->offset & (~CFS_PAGE_MASK)) || - (iobuf->length & (~CFS_PAGE_MASK))) - RETURN(-EINVAL); - - OBD_ALLOC(pga, sizeof(*pga) * iobuf->nr_pages); - if (!pga) - RETURN(-ENOMEM); - - flags = 0 /* | OBD_BRW_DIRECTIO */; - length = iobuf->length; - rw = rw ? OBD_BRW_WRITE : OBD_BRW_READ; - - for (i = 0, length = iobuf->length; length > 0; - length -= pga[i].count, offset += pga[i].count, i++) { /*i last!*/ - pga[i].pg = iobuf->maplist[i]; - pga[i].off = offset; - /* To the end of the page, or the length, whatever is less */ - pga[i].count = min_t(int, CFS_PAGE_SIZE - (offset & ~CFS_PAGE_MASK), - length); - pga[i].flag = flags; - if (rw == OBD_BRW_READ) - POISON_PAGE(iobuf->maplist[i], 0x0d); - } - - ll_inode_fill_obdo(inode, rw, &oa); - - if (rw == OBD_BRW_WRITE) - ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_DIRECT_WRITE, iobuf->length); - else - ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_DIRECT_READ, iobuf->length); - rc = obd_brw_rqset(rw, ll_i2obdexp(inode), &oa, lsm, iobuf->nr_pages, - pga, NULL); - if ((rc > 0) && (rw == OBD_BRW_WRITE)) { - lov_stripe_lock(lsm); - obd_adjust_kms(ll_i2obdexp(inode), lsm, offset_orig + rc, 0); - lov_stripe_unlock(lsm); - } - - OBD_FREE(pga, sizeof(*pga) * iobuf->nr_pages); - RETURN(rc); -} - -#ifdef KERNEL_HAS_AS_MAX_READAHEAD -static int ll_max_readahead(struct inode *inode) -{ - return 0; -} -#endif - -struct address_space_operations ll_aops = { - .readpage = ll_readpage, - .direct_IO = ll_direct_IO_24, - .writepage = ll_writepage, - .prepare_write = ll_prepare_write, - .commit_write = ll_commit_write, - .removepage = ll_removepage, - .sync_page = NULL, - .bmap = NULL, -#ifdef KERNEL_HAS_AS_MAX_READAHEAD - .max_readahead = ll_max_readahead, -#endif -}; diff --git a/lustre/lvfs/Makefile.in b/lustre/lvfs/Makefile.in index de72dbd..40f61bc 100644 --- a/lustre/lvfs/Makefile.in +++ b/lustre/lvfs/Makefile.in @@ -7,12 +7,10 @@ lvfs-objs := lvfs_common.o lvfs_linux.o fsfilt.o upcall_cache.o prng.o lvfs_lib. @QUOTA_TRUE@quotafmt-objs := quotafmt_test.o -ifeq ($(PATCHLEVEL),6) fsfilt_@BACKINGFS@-objs := fsfilt-@BACKINGFS@.o $(obj)/fsfilt-%.c: $(obj)/fsfilt_%.c ln -s $< $@ -endif # for on 2.6 EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LDISKFS_DIR@ -I@LDISKFS_DIR@/ldiskfs diff --git a/lustre/obdclass/Makefile.in b/lustre/obdclass/Makefile.in index 05c5881..6b908ef9 100644 --- a/lustre/obdclass/Makefile.in +++ b/lustre/obdclass/Makefile.in @@ -1,23 +1,11 @@ MODULES := obdclass llog_test obdclass-linux-objs := linux-module.o linux-obdo.o linux-sysctl.o -ifeq ($(PATCHLEVEL),6) obdclass-linux-objs := $(addprefix linux/,$(obdclass-linux-objs)) -endif default: all -ifeq (@linux25@,no) sources: - @for i in $(obdclass-linux-objs:%.o=%.c) ; do \ - echo "ln -s @srcdir@/linux/$$i ." ; \ - ln -sf @srcdir@/linux/$$i . || exit 1 ; \ - done - -else -sources: - -endif obdclass-all-objs := llog.o llog_cat.o llog_lvfs.o llog_obd.o llog_swab.o obdclass-all-objs += class_obd.o class_hash.o target.o @@ -27,11 +15,9 @@ obdclass-all-objs += statfs_pack.o obdo.o obd_config.o obd_mount.o obdclass-objs := $(obdclass-linux-objs) $(obdclass-all-objs) -ifeq ($(PATCHLEVEL),6) llog_test-objs := llog-test.o $(obj)/llog-test.c: $(obj)/llog_test.c ln -sf $< $@ -endif @INCLUDE_RULES@ diff --git a/lustre/ptlrpc/Makefile.in b/lustre/ptlrpc/Makefile.in index 535acac..ff519cd 100644 --- a/lustre/ptlrpc/Makefile.in +++ b/lustre/ptlrpc/Makefile.in @@ -1,9 +1,5 @@ MODULES := ptlrpc -ifeq ($(PATCHLEVEL),6) LDLM := @top_srcdir@/lustre/ldlm/ -else -LDLM := -endif ldlm_objs := $(LDLM)l_lock.o $(LDLM)ldlm_lock.o ldlm_objs += $(LDLM)ldlm_resource.o $(LDLM)ldlm_lib.o ldlm_objs += $(LDLM)ldlm_plain.o $(LDLM)ldlm_extent.o -- 1.8.3.1