Whamcloud - gitweb
update patchless client for support 2.6.20, 2.6.21 and RHEL5 kernels.
authorshadow <shadow>
Thu, 17 May 2007 06:47:09 +0000 (06:47 +0000)
committershadow <shadow>
Thu, 17 May 2007 06:47:09 +0000 (06:47 +0000)
b=11647
i=green
i=adilger

13 files changed:
lustre/ChangeLog
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_patchless_compat.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/rw.c
lustre/llite/super25.c
lustre/lov/lov_ea.c
lustre/obdclass/genops.c
lustre/obdclass/linux/linux-sysctl.c
lustre/obdfilter/filter.c
lustre/quota/quota_context.c
lustre/quota/quota_master.c

index 9d94e01..5760b93 100644 (file)
@@ -140,6 +140,10 @@ Details    : ll_revalidate_it should uses de_inode instead of op_data.fid2
             to check whether it is stale, because sometimes, we want the 
             enqueue happened anyway, and op_data.fid2 will not be initialized.
      
+Severity   : enhancement
+Bugzilla   : 11647
+Description: update patchless client
+Details    : Add support for patchless client with 2.6.20, 2.6.21 and RHEL 5
 
 --------------------------------------------------------------------------------
 
index b1efd2a..3a5f84b 100644 (file)
@@ -1,4 +1,5 @@
 #* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+#* vim:expandtab:shiftwidth=8:tabstop=8:
 #
 # LC_CONFIG_SRCDIR
 #
@@ -7,7 +8,7 @@
 AC_DEFUN([LC_CONFIG_SRCDIR],
 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
 ])
-
+                           
 #
 # LC_PATH_DEFAULTS
 #
@@ -1039,22 +1040,38 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
-# LC_WB_RANGE_START
-# 2.6.20 rename struct writeback fields
-AC_DEFUN([LC_WB_RANGE_START],
-[AC_MSG_CHECKING([kernel has range_start in struct writeback_control])
+# LC_CANCEL_DIRTY_PAGE
+# 2.6.20 introduse cancel_dirty_page instead of 
+# clear_page_dirty.
+AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
+[AC_MSG_CHECKING([kernel has cancel_dirty_page])
 LB_LINUX_TRY_COMPILE([
-        #include <linux/fs.h>
-        #include <linux/sched.h>
-        #include <linux/writeback.h>
+        #include <linux/page-flags.h>
 ],[
-        struct writeback_control wb;
+        cancel_dirty_page(NULL, 0);
+],[
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
+                  [kernel has cancel_dirty_page instead of clear_page_dirty])
+],[
+        AC_MSG_RESULT(NO)
+])
+])
 
-        wb.range_start = 0;
+# RHEL5 in FS-cache patch rename PG_checked flag
+# into PG_fs_misc
+AC_DEFUN([LC_PG_FS_MISC],
+[AC_MSG_CHECKING([kernel has PG_fs_misc])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/page-flags.h>
+],[
+        #ifndef PG_fs_misc
+        #error PG_fs_misc not defined in kernel
+        #endif
 ],[
         AC_MSG_RESULT(yes)
-        AC_DEFINE(HAVE_WB_RANGE_START, 1,
-                  [writeback control has range_start field])
+        AC_DEFINE(HAVE_PG_FS_MISC, 1,
+                  [is kernel have PG_fs_misc])
 ],[
         AC_MSG_RESULT(NO)
 ])
@@ -1068,7 +1085,7 @@ LB_LINUX_TRY_COMPILE([
 AC_DEFUN([LC_PROG_LINUX],
 [ LC_LUSTRE_VERSION_H
 if test x$enable_server = xyes ; then
-       LC_CONFIG_BACKINGFS
+        LC_CONFIG_BACKINGFS
 fi
 LC_CONFIG_PINGER
 LC_CONFIG_LIBLUSTRE_RECOVERY
@@ -1117,13 +1134,18 @@ LC_STATFS_DENTRY_PARAM
 LC_VFS_KERN_MOUNT
 LC_INVALIDATEPAGE_RETURN_INT
 LC_UMOUNTBEGIN_HAS_VFSMOUNT
-LC_WB_RANGE_START
+
+#2.6.18 + RHEL5 (fc6)
+LC_PG_FS_MISC
 
 # 2.6.19
 LC_INODE_BLKSIZE
 LC_VFS_READDIR_U64_INO
 LC_GENERIC_FILE_READ
 LC_GENERIC_FILE_WRITE
+
+# 2.6.20
+LC_CANCEL_DIRTY_PAGE
 ])
 
 #
index 6199c61..61c9ee7 100644 (file)
@@ -1,3 +1,25 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ *  Copyright (C) 2002, 2003 Cluster File Systems, Inc.
+ *
+ *   This file is part of Lustre, http://www.lustre.org.
+ *
+ *   Lustre is free software; you can redistribute it and/or
+ *   modify it under the terms of version 2 of the GNU General Public
+ *   License as published by the Free Software Foundation.
+ *
+ *   Lustre 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 for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with Lustre; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
 #ifndef LUSTRE_PATCHLESS_COMPAT_H
 #define LUSTRE_PATCHLESS_COMPAT_H
 
@@ -46,7 +68,11 @@ truncate_complete_page(struct address_space *mapping, struct page *page)
         if (PagePrivate(page))
                 page->mapping->a_ops->invalidatepage(page, 0);
 
+#ifdef HAVE_CANCEL_DIRTY_PAGE
+        cancel_dirty_page(page, PAGE_SIZE);
+#else
         clear_page_dirty(page);
+#endif
         ClearPageUptodate(page);
         ClearPageMappedToDisk(page);
         ll_remove_from_page_cache(page);
@@ -67,7 +93,7 @@ static inline void d_rehash_cond(struct dentry * entry, int lock)
 }
 
 #define __d_rehash(dentry, lock) d_rehash_cond(dentry, lock)
-       
+
 #define LUSTRE_PATCHLESS
 
 #ifndef ATTR_FROM_OPEN
index df73032..a6895d7 100644 (file)
 
 typedef struct ext2_dir_entry_2 ext2_dirent;
 
-#define PageChecked(page)        test_bit(PG_checked, &(page)->flags)
-#define SetPageChecked(page)     set_bit(PG_checked, &(page)->flags)
+#ifdef HAVE_PG_FS_MISC
+#define PageChecked(page)        test_bit(PG_fs_misc, &(page)->flags)
+#define SetPageChecked(page)     set_bit(PG_fs_misc, &(page)->flags)
+#endif
 
 /* returns the page unlocked, but with a reference */
 static int ll_dir_readpage(struct file *file, struct page *page)
index 947654f..45a74f3 100644 (file)
@@ -37,7 +37,7 @@ struct ll_file_data *ll_file_data_get(void)
 {
         struct ll_file_data *fd;
 
-        OBD_SLAB_ALLOC(fd, ll_file_data_slab, SLAB_KERNEL, sizeof *fd);
+        OBD_SLAB_ALLOC(fd, ll_file_data_slab, GFP_KERNEL, sizeof *fd);
         return fd;
 }
 
index 588bfeb..aefff58 100644 (file)
@@ -593,7 +593,7 @@ static struct ll_async_page *llap_from_page(struct page *page, unsigned origin)
         if (sbi->ll_async_page_count >= sbi->ll_async_page_max)
                 llap_shrink_cache(sbi, 0);
 
-        OBD_SLAB_ALLOC(llap, ll_async_page_slab, SLAB_KERNEL,
+        OBD_SLAB_ALLOC(llap, ll_async_page_slab, GFP_KERNEL,
                        ll_async_page_slab_size);
         if (llap == NULL)
                 RETURN(ERR_PTR(-ENOMEM));
index e56d773..14c191e 100644 (file)
@@ -41,7 +41,7 @@ static struct inode *ll_alloc_inode(struct super_block *sb)
 {
         struct ll_inode_info *lli;
         lprocfs_counter_incr((ll_s2sbi(sb))->ll_stats, LPROC_LL_ALLOC_INODE);
-        OBD_SLAB_ALLOC(lli, ll_inode_cachep, SLAB_KERNEL, sizeof *lli);
+        OBD_SLAB_ALLOC(lli, ll_inode_cachep, GFP_KERNEL, sizeof *lli);
         if (lli == NULL)
                 return NULL;
 
index 07936e3..7392d83 100755 (executable)
@@ -95,7 +95,7 @@ struct lov_stripe_md *lsm_alloc_plain(int stripe_count, int *size)
                 return NULL;;
 
         for (i = 0; i < stripe_count; i++) {
-                OBD_SLAB_ALLOC(loi, lov_oinfo_slab, SLAB_NOFS, sizeof(*loi));
+                OBD_SLAB_ALLOC(loi, lov_oinfo_slab, GFP_NOFS, sizeof(*loi));
                 if (loi == NULL)
                         goto err;
                 lsm->lsm_oinfo[i] = loi;
index 34b137c..f9ebae6 100644 (file)
@@ -58,7 +58,7 @@ static struct obd_device *obd_device_alloc(void)
 {
         struct obd_device *obd;
 
-        OBD_SLAB_ALLOC(obd, obd_device_cachep, SLAB_KERNEL, sizeof(*obd));
+        OBD_SLAB_ALLOC(obd, obd_device_cachep, GFP_KERNEL, sizeof(*obd));
         if (obd != NULL) {
                 obd->obd_magic = OBD_DEVICE_MAGIC;
         }
index f8e4800..fcbd13a 100644 (file)
@@ -110,7 +110,7 @@ void obd_sysctl_init (void)
 {
 #ifdef CONFIG_SYSCTL
         if ( !obd_table_header )
-                obd_table_header = register_sysctl_table(parent_table, 0);
+                obd_table_header = cfs_register_sysctl_table(parent_table, 0);
 #endif
 }
 
@@ -118,7 +118,7 @@ void obd_sysctl_clean (void)
 {
 #ifdef CONFIG_SYSCTL
         if ( obd_table_header )
-                unregister_sysctl_table(obd_table_header);
+                cfs_unregister_sysctl_table(obd_table_header);
         obd_table_header = NULL;
 #endif
 }
index 13f3f5c..eaacf9d 100644 (file)
@@ -474,7 +474,7 @@ struct filter_mod_data *filter_fmd_get(struct obd_export *exp,
         struct filter_export_data *fed = &exp->exp_filter_data;
         struct filter_mod_data *found = NULL, *fmd_new = NULL;
 
-        OBD_SLAB_ALLOC(fmd_new, ll_fmd_cachep, SLAB_NOFS, sizeof(*fmd_new));
+        OBD_SLAB_ALLOC(fmd_new, ll_fmd_cachep, GFP_NOFS, sizeof(*fmd_new));
 
         spin_lock(&fed->fed_lock);
         found = filter_fmd_find_nolock(&exp->exp_obd->u.filter,fed,objid,group);
index f6340b3..84e413d 100644 (file)
@@ -293,7 +293,7 @@ static struct lustre_qunit *alloc_qunit(struct lustre_quota_ctxt *qctxt,
         struct lustre_qunit *qunit = NULL;
         ENTRY;
 
-        OBD_SLAB_ALLOC(qunit, qunit_cachep, SLAB_NOFS, sizeof(*qunit));
+        OBD_SLAB_ALLOC(qunit, qunit_cachep, GFP_NOFS, sizeof(*qunit));
         if (qunit == NULL)
                 RETURN(NULL);
 
index 86f4b72..b435225 100644 (file)
@@ -116,7 +116,7 @@ static struct lustre_dquot *alloc_dquot(struct lustre_quota_info *lqi,
         struct lustre_dquot *dquot = NULL;
         ENTRY;
 
-        OBD_SLAB_ALLOC(dquot, lustre_dquot_cachep, SLAB_NOFS, sizeof(*dquot));
+        OBD_SLAB_ALLOC(dquot, lustre_dquot_cachep, GFP_NOFS, sizeof(*dquot));
         if (dquot == NULL)
                 RETURN(NULL);