The following commit has been merged in the master branch:
commit f2da7f817f95b00c92f0584780bb0164f7bd4550
Author: Patrick Winnertz <[EMAIL PROTECTED]>
Date:   Wed Nov 26 12:21:18 2008 +0100

    Add configure part of the patchless support stuff
    Something is still missing: The old patch patches much more files than 
these two together

diff --git a/debian/patches/00list b/debian/patches/00list
index 81f12d7..c690f7e 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -11,6 +11,7 @@ remove-set_tunables.dpatch
 libsysio.dpatch
 bug12769-ql-fix.dpatch
 patchless_support_2.6.24_lnet_part.dpatch
+patchless_support_2.6.24_configure_part.dpatch
 # Debian patches
 bash_completion.dpatch
 lustre_manpage.dpatch
diff --git a/debian/patches/patchless_support_2.6.24_configure_part.dpatch 
b/debian/patches/patchless_support_2.6.24_configure_part.dpatch
new file mode 100644
index 0000000..fae813b
--- /dev/null
+++ b/debian/patches/patchless_support_2.6.24_configure_part.dpatch
@@ -0,0 +1,417 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## posix_acl.patch by Patrick Winnertz <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch which will enable 2.6.24 patchless support for lustre, taken from 
#14250
+
[EMAIL PROTECTED]@
+Index: lustre/autoconf/lustre-core.m4
+===================================================================
+RCS file: /cvsroot/cfs/lustre-core/autoconf/lustre-core.m4,v
+retrieving revision 1.23.2.31.2.5.2.19
+diff -u -p -r1.23.2.31.2.5.2.19 lustre-core.m4
+--- ./lustre/autoconf/lustre-core.m4   13 Nov 2008 08:09:17 -0000      
1.23.2.31.2.5.2.19
++++ ./lustre/autoconf/lustre-core.m4   25 Nov 2008 09:20:00 -0000
+@@ -1151,15 +1151,20 @@ LB_LINUX_TRY_COMPILE([
+ AC_DEFUN([LC_PAGE_CHECKED],
+ [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
+ LB_LINUX_TRY_COMPILE([
+-        #include <linux/mm.h>
+-        #include <linux/page-flags.h>
+-],[
+-        #ifndef PageChecked
+-        #error PageChecked not defined in kernel
+-        #endif
+-        #ifndef SetPageChecked
+-        #error SetPageChecked not defined in kernel
+-        #endif
++        #include <linux/autoconf.h>
++#ifdef HAVE_LINUX_MMTYPES_H
++        #include <linux/mm_types.h>
++#endif
++      #include <linux/page-flags.h>
++],[
++      struct page *p;
++
++        /* before 2.6.26 this define*/
++        #ifndef PageChecked   
++      /* 2.6.26 use function instead of define for it */
++      SetPageChecked(p);
++      PageChecked(p);
++      #endif
+ ],[
+         AC_MSG_RESULT(yes)
+         AC_DEFINE(HAVE_PAGE_CHECKED, 1,
+@@ -1365,11 +1370,149 @@ LB_LINUX_TRY_COMPILE([
+ 
+ # 2.6.23 extract nfs export related data into exportfs.h
+ AC_DEFUN([LC_HAVE_EXPORTFS_H],
+-[
+-tmpfl="$CFLAGS"
+-CFLAGS="$CFLAGS -I$LINUX_OBJ/include"
+-AC_CHECK_HEADERS([linux/exportfs.h])
+-CFLAGS="$tmpfl"
++[LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
++        AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
++                [kernel has include/exportfs.h])
++],[
++        AC_MSG_RESULT([no])
++])
++])
++
++# 2.6.23 have new page fault handling API
++AC_DEFUN([LC_VM_OP_FAULT],
++[AC_MSG_CHECKING([if kernel has .fault in vm_operation_struct])
++LB_LINUX_TRY_COMPILE([
++        #include <linux/mm.h>
++],[
++        struct vm_operations_struct op;
++
++        op.fault = NULL;
++], [
++        AC_MSG_RESULT([yes])
++        AC_DEFINE(HAVE_VM_OP_FAULT, 1,
++                [if kernel has .fault in vm_operation_struct])
++],[
++        AC_MSG_RESULT([no])
++])
++])
++
++#2.6.23 has new shrinker API
++AC_DEFUN([LC_REGISTER_SHRINKER],
++[AC_MSG_CHECKING([if kernel has register_shrinker])
++LB_LINUX_TRY_COMPILE([
++        #include <linux/mm.h>
++],[
++        register_shrinker(NULL);
++], [
++        AC_MSG_RESULT([yes])
++        AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
++                [if kernel has register_shrinker])
++],[
++        AC_MSG_RESULT([no])
++])
++])
++
++# 2.6.24 has bio_endio with 2 args
++AC_DEFUN([LC_BIO_ENDIO_2ARG],
++[AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
++LB_LINUX_TRY_COMPILE([
++        #include <linux/bio.h>
++],[
++        bio_endio(NULL, 0);
++], [
++        AC_MSG_RESULT([yes])
++        AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
++                [if kernel has bio_endio with 2 args])
++],[
++        AC_MSG_RESULT([no])
++])
++])
++
++# 2.6.24 has new members in exports struct.
++AC_DEFUN([LC_FH_TO_DENTRY],
++[AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations 
struct])
++LB_LINUX_TRY_COMPILE([
++#ifdef HAVE_LINUX_EXPORTFS_H
++        #include <linux/exportfs.h>
++#else
++        #include <linux/fs.h>
++#endif
++],[
++        struct export_operations exp;
++
++        exp.fh_to_dentry   = NULL;
++], [
++        AC_MSG_RESULT([yes])
++        AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
++                [kernel has .fh_to_dentry member in export_operations struct])
++],[
++        AC_MSG_RESULT([no])
++])
++])
++
++# 2.6.24 need linux/mm_types.h included
++AC_DEFUN([LC_HAVE_MMTYPES_H],
++[LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
++        AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
++                [kernel has include/mm_types.h])
++],[
++        AC_MSG_RESULT([no])
++])
++])
++
++# 2.6.24 remove long aged procfs entry -> deleted member
++AC_DEFUN([LC_PROCFS_DELETED],
++[AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
++LB_LINUX_TRY_COMPILE([
++      #include <linux/proc_fs.h>
++],[
++        struct proc_dir_entry pde;
++
++        pde.deleted   = NULL;
++], [
++        AC_MSG_RESULT([yes])
++        AC_DEFINE(HAVE_PROCFS_DELETED, 1,
++                [kernel has deleted member in procfs entry struct])
++],[
++        AC_MSG_RESULT([no])
++])
++])
++
++# 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
++AC_DEFUN([LC_FS_STRUCT_USE_PATH],
++[AC_MSG_CHECKING([fs_struct use path structure])
++LB_LINUX_TRY_COMPILE([
++        #include <asm/atomic.h>
++        #include <linux/spinlock.h>
++        #include <linux/fs_struct.h>
++],[
++        struct path path;
++        struct fs_struct fs;
++
++        fs.pwd = path;
++], [
++        AC_MSG_RESULT([yes])
++        AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
++                [fs_struct use path structure])
++],[
++        AC_MSG_RESULT([no])
++])
++])
++
++# 2.6.26 remove path_release and use path_put instead
++AC_DEFUN([LC_PATH_RELEASE],
++[AC_MSG_CHECKING([if path_release exist])
++LB_LINUX_TRY_COMPILE([
++    #include <linux/dcache.h>
++    #include <linux/namei.h>
++],[
++    path_release(NULL);
++],[
++    AC_DEFINE(HAVE_PATH_RELEASE, 1, [path_release exist])
++    AC_MSG_RESULT([yes])
++],[
++    AC_MSG_RESULT([no]) 
++])
+ ])
+ 
+ #
+@@ -1480,6 +1623,19 @@ AC_DEFUN([LC_PROG_LINUX],
+           LC_UNREGISTER_BLKDEV_RETURN_INT
+           LC_KERNEL_SPLICE_READ
+           LC_HAVE_EXPORTFS_H
++          LC_VM_OP_FAULT
++          LC_REGISTER_SHRINKER
++ 
++        # 2.6.24
++        LC_HAVE_MMTYPES_H
++          LC_BIO_ENDIO_2ARG
++          LC_FH_TO_DENTRY
++          LC_PROCFS_DELETED
++ 
++          # 2.6.26
++          LC_FS_STRUCT_USE_PATH
++          LC_RCU_LIST_SAFE
++          LC_PATH_RELEASE
+ ])
+ 
+ #
+@@ -1712,6 +1868,7 @@ LB_LINUX_TRY_COMPILE([
+         ],[
+                 AC_MSG_RESULT([no]) 
+         ])
++
+ ],[
+         AC_MSG_RESULT([no])
+ ])
+Index: lustre/include/linux/lustre_compat25.h
+===================================================================
+RCS file: /cvsroot/cfs/lustre-core/include/linux/lustre_compat25.h,v
+retrieving revision 1.31.16.7.4.2.2.10
+diff -u -p -r1.31.16.7.4.2.2.10 lustre_compat25.h
+--- ./lustre/include/linux/lustre_compat25.h   11 Nov 2008 07:43:23 -0000      
1.31.16.7.4.2.2.10
++++ ./lustre/include/linux/lustre_compat25.h   25 Nov 2008 09:20:00 -0000
+@@ -57,6 +57,28 @@ struct ll_iattr_struct {
+ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14) */
+ 
+ #ifndef HAVE_SET_FS_PWD
++
++#ifdef HAVE_FS_STRUCT_USE_PATH
++static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
++                struct dentry *dentry)
++{
++        struct path path;
++      struct path old_pwd;
++
++        path.mnt = mnt;
++        path.dentry = dentry;
++        write_lock(&fs->lock);
++        old_pwd = fs->pwd;
++        path_get(&path);
++        fs->pwd = path;
++        write_unlock(&fs->lock);
++
++      if (old_pwd.dentry)
++              path_put(&old_pwd);
++}
++
++#else
++
+ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
+                 struct dentry *dentry)
+ {
+@@ -75,6 +97,7 @@ static inline void ll_set_fs_pwd(struct 
+                 mntput(old_pwdmnt);
+         }
+ }
++#endif
+ #else
+ #define ll_set_fs_pwd set_fs_pwd
+ #endif /* HAVE_SET_FS_PWD */
+@@ -445,6 +468,57 @@ int ll_unregister_blkdev(unsigned int de
+ #define cpu_to_node(cpu)         0
+ #endif
+ 
++#ifdef HAVE_REGISTER_SHRINKER
++typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask);
++
++static inline
++struct shrinker *set_shrinker(int seek, shrinker_t func)
++{
++        struct shrinker *s;
++
++        s = kmalloc(sizeof(*s), GFP_KERNEL);
++        if (s == NULL)
++                return (NULL);
++
++        s->shrink = func;
++        s->seeks = seek;
++
++        register_shrinker(s);
++
++        return s;
++}
++
++static inline
++void remove_shrinker(struct shrinker *shrinker) 
++{
++        if (shrinker == NULL)
++                return;
++
++        unregister_shrinker(shrinker);
++        kfree(shrinker);
++}
++#endif
++
++#ifdef HAVE_BIO_ENDIO_2ARG
++#define cfs_bio_io_error(a,b)   bio_io_error((a))
++#define cfs_bio_endio(a,b,c)    bio_endio((a),(c))
++#else
++#define cfs_bio_io_error(a,b)   bio_io_error((a),(b))
++#define cfs_bio_endio(a,b,c)    bio_endio((a),(b),(c))
++#endif
++
++#ifdef HAVE_FS_STRUCT_USE_PATH
++#define cfs_fs_pwd(fs)       ((fs)->pwd.dentry)
++#define cfs_fs_mnt(fs)       ((fs)->pwd.mnt)
++#else
++#define cfs_fs_pwd(fs)       ((fs)->pwd)
++#define cfs_fs_mnt(fs)       ((fs)->pwdmnt)
++#endif
++
++#ifndef list_for_each_safe_rcu
++#define list_for_each_safe_rcu(a,b,c) list_for_each_rcu(b, c)
++#endif
++
+ #ifndef abs
+ static inline int abs(int x)
+ {
+Index: lustre/llite/symlink.c
+===================================================================
+RCS file: /cvsroot/cfs/lustre-core/llite/symlink.c,v
+retrieving revision 1.41.34.4.14.7
+diff -u -p -r1.41.34.4.14.7 symlink.c
+--- ./lustre/llite/symlink.c   25 Nov 2008 03:12:50 -0000      1.41.34.4.14.7
++++ ./lustre/llite/symlink.c   25 Nov 2008 09:20:00 -0000
+@@ -177,8 +177,12 @@ static LL_FOLLOW_LINK_RETURN_TYPE ll_fol
+                 up(&lli->lli_size_sem);
+         }
+         if (rc) {
++#ifdef HAVE_PATH_RELEASE
+                 path_release(nd); /* Kernel assumes that ->follow_link()
+                                      releases nameidata on error */
++#else
++                path_put(&nd->path);
++#endif
+                 GOTO(out, rc);
+         }
+ 
+Index: lustre/lvfs/lvfs_linux.c
+===================================================================
+RCS file: /cvsroot/cfs/lustre-core/lvfs/lvfs_linux.c,v
+retrieving revision 1.30.18.2.14.4
+diff -u -p -r1.30.18.2.14.4 lvfs_linux.c
+--- ./lustre/lvfs/lvfs_linux.c 9 Oct 2008 11:45:23 -0000       1.30.18.2.14.4
++++ ./lustre/lvfs/lvfs_linux.c 25 Nov 2008 09:20:00 -0000
+@@ -148,10 +148,10 @@ void push_ctxt(struct lvfs_run_ctxt *sav
+         */
+ 
+         save->fs = get_fs();
+-        LASSERT(atomic_read(&current->fs->pwd->d_count));
++        LASSERT(atomic_read(&cfs_fs_pwd(current->fs)->d_count));
+         LASSERT(atomic_read(&new_ctx->pwd->d_count));
+-        save->pwd = dget(current->fs->pwd);
+-        save->pwdmnt = mntget(current->fs->pwdmnt);
++        save->pwd = dget(cfs_fs_pwd(current->fs));
++        save->pwdmnt = mntget(cfs_fs_mnt(current->fs));
+         save->luc.luc_umask = current->fs->umask;
+ 
+         LASSERT(save->pwd);
+@@ -205,10 +205,10 @@ void pop_ctxt(struct lvfs_run_ctxt *save
+                atomic_read(&current->fs->pwdmnt->mnt_count));
+         */
+ 
+-        LASSERTF(current->fs->pwd == new_ctx->pwd, "%p != %p\n",
+-                 current->fs->pwd, new_ctx->pwd);
+-        LASSERTF(current->fs->pwdmnt == new_ctx->pwdmnt, "%p != %p\n",
+-                 current->fs->pwdmnt, new_ctx->pwdmnt);
++        LASSERTF(cfs_fs_pwd(current->fs) == new_ctx->pwd, "%p != %p\n",
++                 cfs_fs_pwd(current->fs), new_ctx->pwd);
++        LASSERTF(cfs_fs_mnt(current->fs) == new_ctx->pwdmnt, "%p != %p\n",
++                 cfs_fs_mnt(current->fs), new_ctx->pwdmnt);
+ 
+         set_fs(saved->fs);
+         ll_set_fs_pwd(current->fs, saved->pwdmnt, saved->pwd);
+Index: lustre/mgc/mgc_request.c
+===================================================================
+RCS file: /cvsroot/cfs/lustre-core/mgc/mgc_request.c,v
+retrieving revision 1.5.6.14.4.2.2.9
+diff -u -p -r1.5.6.14.4.2.2.9 mgc_request.c
+--- ./lustre/mgc/mgc_request.c 11 Nov 2008 07:44:16 -0000      1.5.6.14.4.2.2.9
++++ ./lustre/mgc/mgc_request.c 25 Nov 2008 09:20:00 -0000
+@@ -415,7 +415,7 @@ static int mgc_fs_setup(struct obd_devic
+         obd->obd_lvfs_ctxt.fs = get_ds();
+ 
+         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+-        dentry = lookup_one_len(MOUNT_CONFIGS_DIR, current->fs->pwd,
++        dentry = lookup_one_len(MOUNT_CONFIGS_DIR, cfs_fs_pwd(current->fs),
+                                 strlen(MOUNT_CONFIGS_DIR));
+         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+         if (IS_ERR(dentry)) {
+Index: lustre/ptlrpc/service.c
+===================================================================
+RCS file: /cvsroot/cfs/lustre-core/ptlrpc/service.c,v
+retrieving revision 1.114.30.25.2.1.2.17
+diff -u -p -r1.114.30.25.2.1.2.17 service.c
+--- ./lustre/ptlrpc/service.c  24 Nov 2008 13:34:41 -0000      
1.114.30.25.2.1.2.17
++++ ./lustre/ptlrpc/service.c  25 Nov 2008 09:20:00 -0000
+@@ -1501,7 +1501,7 @@ void ptlrpc_daemonize(char *name)
+         cfs_daemonize(name);
+         exit_fs(cfs_current());
+         current->fs = fs;
+-        ll_set_fs_pwd(current->fs, init_task.fs->pwdmnt, init_task.fs->pwd);
++        ll_set_fs_pwd(current->fs, cfs_fs_mnt(init_task.fs), 
cfs_fs_pwd(init_task.fs));
+ }
+ 
+ static void

-- 
Lustre Debian Packaging 

_______________________________________________
Pkg-lustre-svn-commit mailing list
Pkg-lustre-svn-commit@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-lustre-svn-commit

Reply via email to