diff options
author | Christian Zoffoli <xmerlin@gentoo.org> | 2008-03-21 02:21:05 +0000 |
---|---|---|
committer | Christian Zoffoli <xmerlin@gentoo.org> | 2008-03-21 02:21:05 +0000 |
commit | c342cc1953d79a808ea6ccbf488f37119ddc6e43 (patch) | |
tree | 2e5c6ad97f819f41a65321dd764b9526bcc4c8fa /sys-cluster | |
parent | Move wxaddons module into version-specific directories to fix bug #213819. (diff) | |
download | gentoo-2-c342cc1953d79a808ea6ccbf488f37119ddc6e43.tar.gz gentoo-2-c342cc1953d79a808ea6ccbf488f37119ddc6e43.tar.bz2 gentoo-2-c342cc1953d79a808ea6ccbf488f37119ddc6e43.zip |
Patched gfs to compile also with kernel >= 2.6.20.
(Portage version: 2.1.4.4)
Diffstat (limited to 'sys-cluster')
4 files changed, 553 insertions, 2 deletions
diff --git a/sys-cluster/gfs-kernel/ChangeLog b/sys-cluster/gfs-kernel/ChangeLog index 453e5e57a747..57732cf54bd0 100644 --- a/sys-cluster/gfs-kernel/ChangeLog +++ b/sys-cluster/gfs-kernel/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-cluster/gfs-kernel # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gfs-kernel/ChangeLog,v 1.29 2008/03/21 01:08:29 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gfs-kernel/ChangeLog,v 1.30 2008/03/21 02:21:04 xmerlin Exp $ + + 21 Mar 2008; Christian Zoffoli <xmerlin@gentoo.org> + +files/gfs-kernel-2.02.00-before-2.6.23.diff, + +files/gfs-kernel-2.02.00-before-2.6.24.diff, gfs-kernel-2.02.00.ebuild: + Patched gfs to compile also with kernel >= 2.6.20. 21 Mar 2008; Christian Zoffoli <xmerlin@gentoo.org> +files/gfs-kernel-locking-symbol.patch: diff --git a/sys-cluster/gfs-kernel/files/gfs-kernel-2.02.00-before-2.6.23.diff b/sys-cluster/gfs-kernel/files/gfs-kernel-2.02.00-before-2.6.23.diff new file mode 100644 index 000000000000..57159fcf33f1 --- /dev/null +++ b/sys-cluster/gfs-kernel/files/gfs-kernel-2.02.00-before-2.6.23.diff @@ -0,0 +1,353 @@ +diff -uNr cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/main.c cluster-2.02.00-2.6.20/gfs-kernel/src/gfs/main.c +--- cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/main.c 2008-02-26 16:37:43.000000000 +0100 ++++ cluster-2.02.00-2.6.20/gfs-kernel/src/gfs/main.c 2008-03-21 03:01:47.000000000 +0100 +@@ -53,7 +53,7 @@ + + gfs_glock_cachep = kmem_cache_create("gfs_glock", sizeof(struct gfs_glock), + 0, 0, +- NULL); ++ NULL, NULL); + gfs_inode_cachep = NULL; + gfs_bufdata_cachep = NULL; + gfs_mhc_cachep = NULL; +@@ -63,19 +63,19 @@ + + gfs_inode_cachep = kmem_cache_create("gfs_inode", sizeof(struct gfs_inode), + 0, 0, +- NULL); ++ NULL, NULL); + if (!gfs_inode_cachep) + goto fail1; + + gfs_bufdata_cachep = kmem_cache_create("gfs_bufdata", sizeof(struct gfs_bufdata), + 0, 0, +- NULL); ++ NULL, NULL); + if (!gfs_bufdata_cachep) + goto fail1; + + gfs_mhc_cachep = kmem_cache_create("gfs_meta_header_cache", sizeof(struct gfs_meta_header_cache), + 0, 0, +- NULL); ++ NULL, NULL); + if (!gfs_mhc_cachep) + goto fail; + +diff -uNr cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/main.c.orig cluster-2.02.00-2.6.20/gfs-kernel/src/gfs/main.c.orig +--- cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/main.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ cluster-2.02.00-2.6.20/gfs-kernel/src/gfs/main.c.orig 2008-02-26 16:37:43.000000000 +0100 +@@ -0,0 +1,137 @@ ++/****************************************************************************** ++******************************************************************************* ++** ++** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. ++** Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. ++** ++** This copyrighted material is made available to anyone wishing to use, ++** modify, copy, or redistribute it subject to the terms and conditions ++** of the GNU General Public License v.2. ++** ++******************************************************************************* ++******************************************************************************/ ++ ++#include <linux/sched.h> ++#include <linux/slab.h> ++#include <linux/smp_lock.h> ++#include <linux/spinlock.h> ++#include <asm/semaphore.h> ++#include <linux/completion.h> ++#include <linux/buffer_head.h> ++#include <linux/proc_fs.h> ++#include <linux/module.h> ++#include <linux/init.h> ++#include <linux/time.h> ++ ++#include "gfs.h" ++#include "ops_fstype.h" ++#include "sys.h" ++#include "proc.h" ++ ++/** ++ * init_gfs_fs - Register GFS as a filesystem ++ * ++ * Returns: 0 on success, error code on failure ++ */ ++ ++int __init init_gfs_fs(void) ++{ ++ int error; ++ struct timespec tv; ++ ++/* gfs2_init_lmh(); gfs2 should do this for us*/ ++ ++ error = gfs_sys_init(); ++ if (error) ++ return error; ++ error = gfs_proc_init(); ++ if (error) ++ goto fail; ++ ++ getnstimeofday(&tv); ++ gfs_random_number = tv.tv_nsec; ++ ++ gfs_glock_cachep = kmem_cache_create("gfs_glock", sizeof(struct gfs_glock), ++ 0, 0, ++ NULL); ++ gfs_inode_cachep = NULL; ++ gfs_bufdata_cachep = NULL; ++ gfs_mhc_cachep = NULL; ++ error = -ENOMEM; ++ if (!gfs_glock_cachep) ++ goto fail1; ++ ++ gfs_inode_cachep = kmem_cache_create("gfs_inode", sizeof(struct gfs_inode), ++ 0, 0, ++ NULL); ++ if (!gfs_inode_cachep) ++ goto fail1; ++ ++ gfs_bufdata_cachep = kmem_cache_create("gfs_bufdata", sizeof(struct gfs_bufdata), ++ 0, 0, ++ NULL); ++ if (!gfs_bufdata_cachep) ++ goto fail1; ++ ++ gfs_mhc_cachep = kmem_cache_create("gfs_meta_header_cache", sizeof(struct gfs_meta_header_cache), ++ 0, 0, ++ NULL); ++ if (!gfs_mhc_cachep) ++ goto fail; ++ ++ error = register_filesystem(&gfs_fs_type); ++ if (error) ++ goto fail; ++ ++ printk("GFS %s (built %s %s) installed\n", ++ RELEASE_VERSION, __DATE__, __TIME__); ++ ++ return 0; ++ ++ fail1: ++ if (gfs_mhc_cachep) ++ kmem_cache_destroy(gfs_mhc_cachep); ++ ++ if (gfs_bufdata_cachep) ++ kmem_cache_destroy(gfs_bufdata_cachep); ++ ++ if (gfs_inode_cachep) ++ kmem_cache_destroy(gfs_inode_cachep); ++ ++ if (gfs_glock_cachep) ++ kmem_cache_destroy(gfs_glock_cachep); ++ ++ gfs_proc_uninit(); ++ ++ fail: ++ gfs_sys_uninit(); ++ ++ return error; ++} ++ ++/** ++ * exit_gfs_fs - Unregister the file system ++ * ++ */ ++ ++void __exit ++exit_gfs_fs(void) ++{ ++ unregister_filesystem(&gfs_fs_type); ++ ++ kmem_cache_destroy(gfs_mhc_cachep); ++ kmem_cache_destroy(gfs_bufdata_cachep); ++ kmem_cache_destroy(gfs_inode_cachep); ++ kmem_cache_destroy(gfs_glock_cachep); ++ ++ gfs_proc_uninit(); ++ gfs_sys_uninit(); ++} ++ ++MODULE_DESCRIPTION("Global File System " RELEASE_VERSION); ++MODULE_AUTHOR("Red Hat, Inc."); ++MODULE_LICENSE("GPL"); ++ ++module_init(init_gfs_fs); ++module_exit(exit_gfs_fs); ++ +diff -uNr cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.c cluster-2.02.00-2.6.20/gfs-kernel/src/gfs/ops_export.c +--- cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.c 2008-03-21 03:01:29.000000000 +0100 ++++ cluster-2.02.00-2.6.20/gfs-kernel/src/gfs/ops_export.c 2008-03-21 03:01:47.000000000 +0100 +@@ -18,7 +18,6 @@ + #include <asm/semaphore.h> + #include <linux/completion.h> + #include <linux/buffer_head.h> +-#include <linux/exportfs.h> + + #include "gfs.h" + #include "dio.h" +diff -uNr cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_vm.c cluster-2.02.00-2.6.20/gfs-kernel/src/gfs/ops_vm.c +--- cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_vm.c 2008-03-21 03:01:29.000000000 +0100 ++++ cluster-2.02.00-2.6.20/gfs-kernel/src/gfs/ops_vm.c 2008-03-21 03:01:47.000000000 +0100 +@@ -13,6 +13,7 @@ + + #include <linux/sched.h> + #include <linux/slab.h> ++#include <linux/smp_lock.h> + #include <linux/spinlock.h> + #include <asm/semaphore.h> + #include <linux/completion.h> +@@ -52,7 +53,7 @@ + } + + /** +- * gfs_private_fault - ++ * gfs_private_nopage - + * @area: + * @address: + * @type: +@@ -60,29 +61,31 @@ + * Returns: the page + */ + +-static int gfs_private_fault(struct vm_area_struct *vma, struct vm_fault *vmf) ++static struct page * ++gfs_private_nopage(struct vm_area_struct *area, ++ unsigned long address, int *type) + { +- struct gfs_inode *ip = get_v2ip(vma->vm_file->f_mapping->host); ++ struct gfs_inode *ip = get_v2ip(area->vm_file->f_mapping->host); + struct gfs_holder i_gh; ++ struct page *result; + int error; +- int ret = 0; + + atomic_inc(&ip->i_sbd->sd_ops_vm); + + error = gfs_glock_nq_init(ip->i_gl, LM_ST_SHARED, 0, &i_gh); + if (error) +- goto out; ++ return NULL; + + set_bit(GIF_PAGED, &ip->i_flags); + +- ret = filemap_fault(vma, vmf); ++ result = filemap_nopage(area, address, type); + +- if (ret && ret != VM_FAULT_OOM) ++ if (result && result != NOPAGE_OOM) + pfault_be_greedy(ip); + + gfs_glock_dq_uninit(&i_gh); +- out: +- return ret; ++ ++ return result; + } + + /** +@@ -167,7 +170,7 @@ + } + + /** +- * gfs_sharewrite_fault - ++ * gfs_sharewrite_nopage - + * @area: + * @address: + * @type: +@@ -175,72 +178,61 @@ + * Returns: the page + */ + +-static int gfs_sharewrite_fault(struct vm_area_struct *vma, +- struct vm_fault *vmf) ++static struct page * ++gfs_sharewrite_nopage(struct vm_area_struct *area, ++ unsigned long address, int *type) + { +- struct file *file = vma->vm_file; +- struct gfs_file *gf = file->private_data; +- struct gfs_inode *ip = get_v2ip(vma->vm_file->f_mapping->host); ++ struct gfs_inode *ip = get_v2ip(area->vm_file->f_mapping->host); + struct gfs_holder i_gh; ++ struct page *result = NULL; ++ unsigned long index = ((address - area->vm_start) >> PAGE_CACHE_SHIFT) + area->vm_pgoff; + int alloc_required; + int error; +- int ret = 0; + + atomic_inc(&ip->i_sbd->sd_ops_vm); + + error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh); + if (error) +- goto out; ++ return NULL; + + if (gfs_is_jdata(ip)) +- goto out_unlock; ++ goto out; + + set_bit(GIF_PAGED, &ip->i_flags); + set_bit(GIF_SW_PAGED, &ip->i_flags); + +- error = gfs_write_alloc_required(ip, +- (u64)vmf->pgoff << PAGE_CACHE_SHIFT, ++ error = gfs_write_alloc_required(ip, (uint64_t)index << PAGE_CACHE_SHIFT, + PAGE_CACHE_SIZE, &alloc_required); +- if (error) { +- ret = VM_FAULT_OOM; /* XXX: are these right? */ +- goto out_unlock; +- } ++ if (error) ++ goto out; + +- ret = filemap_fault(vma, vmf); +- if (ret & VM_FAULT_ERROR) +- goto out_unlock; ++ result = filemap_nopage(area, address, type); ++ if (!result || result == NOPAGE_OOM) ++ goto out; + + if (alloc_required) { +- /* XXX: do we need to drop page lock around alloc_page_backing?*/ +- error = alloc_page_backing(ip, vmf->page); ++ error = alloc_page_backing(ip, index); + if (error) { +- /* +- * VM_FAULT_LOCKED should always be the case for +- * filemap_fault, but it may not be in a future +- * implementation. +- */ +- if (ret & VM_FAULT_LOCKED) +- unlock_page(vmf->page); +- page_cache_release(vmf->page); +- ret = VM_FAULT_OOM; +- goto out_unlock; ++ page_cache_release(result); ++ result = NULL; ++ goto out; + } +- set_page_dirty(vmf->page); ++ set_page_dirty(result); + } + + pfault_be_greedy(ip); + +- out_unlock: +- gfs_glock_dq_uninit(&i_gh); + out: +- return ret; ++ gfs_glock_dq_uninit(&i_gh); ++ ++ return result; + } + + struct vm_operations_struct gfs_vm_ops_private = { +- .fault = gfs_private_fault, ++ .nopage = gfs_private_nopage, + }; + + struct vm_operations_struct gfs_vm_ops_sharewrite = { +- .fault = gfs_sharewrite_fault, ++ .nopage = gfs_sharewrite_nopage, + }; + diff --git a/sys-cluster/gfs-kernel/files/gfs-kernel-2.02.00-before-2.6.24.diff b/sys-cluster/gfs-kernel/files/gfs-kernel-2.02.00-before-2.6.24.diff new file mode 100644 index 000000000000..c77113a3dcee --- /dev/null +++ b/sys-cluster/gfs-kernel/files/gfs-kernel-2.02.00-before-2.6.24.diff @@ -0,0 +1,179 @@ +diff -uNr cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_export.c cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.c +--- cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_export.c 2008-02-26 16:37:43.000000000 +0100 ++++ cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.c 2008-03-21 03:01:29.000000000 +0100 +@@ -44,6 +44,49 @@ + }; + + /** ++ * gfs_decode_fh - ++ * @param1: description ++ * @param2: description ++ * @param3: description ++ * ++ * Function description ++ * ++ * Returns: what is returned ++ */ ++ ++struct dentry * ++gfs_decode_fh(struct super_block *sb, __u32 *fh, int fh_len, int fh_type, ++ int (*acceptable)(void *context, struct dentry *dentry), ++ void *context) ++{ ++ struct inode_cookie this, parent; ++ ++ atomic_inc(&get_v2sdp(sb)->sd_ops_export); ++ ++ memset(&parent, 0, sizeof(struct inode_cookie)); ++ ++ switch (fh_type) { ++ case 6: ++ parent.gen_valid = TRUE; ++ parent.gen = gfs32_to_cpu(fh[5]); ++ case 5: ++ parent.formal_ino = ((uint64_t)gfs32_to_cpu(fh[3])) << 32; ++ parent.formal_ino |= (uint64_t)gfs32_to_cpu(fh[4]); ++ case 3: ++ this.gen_valid = TRUE; ++ this.gen = gfs32_to_cpu(fh[2]); ++ this.formal_ino = ((uint64_t)gfs32_to_cpu(fh[0])) << 32; ++ this.formal_ino |= (uint64_t)gfs32_to_cpu(fh[1]); ++ break; ++ default: ++ return NULL; ++ } ++ ++ return gfs_export_ops.find_exported_dentry(sb, &this, &parent, ++ acceptable, context); ++} ++ ++/** + * gfs_encode_fh - + * @param1: description + * @param2: description +@@ -247,9 +290,10 @@ + */ + + struct dentry * +-gfs_get_dentry(struct super_block *sb, struct inode_cookie *cookie) ++gfs_get_dentry(struct super_block *sb, void *inump) + { + struct gfs_sbd *sdp = get_v2sdp(sb); ++ struct inode_cookie *cookie = (struct inode_cookie *)inump; + struct gfs_inum inum; + struct gfs_holder i_gh, ri_gh, rgd_gh; + struct gfs_rgrpd *rgd; +@@ -362,55 +406,11 @@ + return ERR_PTR(error); + } + +-static struct dentry *gfs_fh_to_dentry(struct super_block *sb, struct fid *fid, +- int fh_len, int fh_type) +-{ +- struct inode_cookie this; +- __u32 *fh = fid->raw; +- +- atomic_inc(&get_v2sdp(sb)->sd_ops_export); +- +- switch (fh_type) { +- case 6: +- case 5: +- case 3: +- this.gen_valid = TRUE; +- this.gen = gfs32_to_cpu(fh[2]); +- this.formal_ino = ((uint64_t)gfs32_to_cpu(fh[0])) << 32; +- this.formal_ino |= (uint64_t)gfs32_to_cpu(fh[1]); +- return gfs_get_dentry(sb, &this); +- default: +- return NULL; +- } +-} +- +-static struct dentry *gfs_fh_to_parent(struct super_block *sb, struct fid *fid, +- int fh_len, int fh_type) +-{ +- struct inode_cookie parent; +- __u32 *fh = fid->raw; +- +- atomic_inc(&get_v2sdp(sb)->sd_ops_export); +- +- switch (fh_type) { +- case 6: +- parent.gen_valid = TRUE; +- parent.gen = gfs32_to_cpu(fh[5]); +- case 5: +- parent.formal_ino = ((uint64_t)gfs32_to_cpu(fh[3])) << 32; +- parent.formal_ino |= (uint64_t)gfs32_to_cpu(fh[4]); +- default: +- return NULL; +- } +- +- return gfs_get_dentry(sb, &parent); +-} +- +-const struct export_operations gfs_export_ops = { ++struct export_operations gfs_export_ops = { ++ .decode_fh = gfs_decode_fh, + .encode_fh = gfs_encode_fh, +- .fh_to_dentry = gfs_fh_to_dentry, +- .fh_to_parent = gfs_fh_to_parent, + .get_name = gfs_get_name, + .get_parent = gfs_get_parent, ++ .get_dentry = gfs_get_dentry, + }; + +diff -uNr cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_export.h cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.h +--- cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_export.h 2008-02-26 16:37:43.000000000 +0100 ++++ cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.h 2008-03-21 03:01:29.000000000 +0100 +@@ -14,6 +14,6 @@ + #ifndef __OPS_EXPORT_DOT_H__ + #define __OPS_EXPORT_DOT_H__ + +-extern const struct export_operations gfs_export_ops; ++extern struct export_operations gfs_export_ops; + + #endif /* __OPS_EXPORT_DOT_H__ */ +diff -uNr cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_vm.c cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_vm.c +--- cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_vm.c 2008-02-26 16:37:43.000000000 +0100 ++++ cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_vm.c 2008-03-21 03:01:29.000000000 +0100 +@@ -94,10 +94,9 @@ + */ + + static int +-alloc_page_backing(struct gfs_inode *ip, struct page *page) ++alloc_page_backing(struct gfs_inode *ip, unsigned long index) + { + struct gfs_sbd *sdp = ip->i_sbd; +- unsigned long index = page->index; + uint64_t lblock = index << (PAGE_CACHE_SHIFT - sdp->sd_sb.sb_bsize_shift); + unsigned int blocks = PAGE_CACHE_SIZE >> sdp->sd_sb.sb_bsize_shift; + struct gfs_alloc *al; +@@ -180,7 +179,8 @@ + struct vm_fault *vmf) + { + struct file *file = vma->vm_file; +- struct gfs_inode *ip = get_v2ip(file->f_mapping->host); ++ struct gfs_file *gf = file->private_data; ++ struct gfs_inode *ip = get_v2ip(vma->vm_file->f_mapping->host); + struct gfs_holder i_gh; + int alloc_required; + int error; +diff -uNr cluster-2.02.00.orig/gfs-kernel/src/gfs/sys.c cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/sys.c +--- cluster-2.02.00.orig/gfs-kernel/src/gfs/sys.c 2008-02-26 16:37:43.000000000 +0100 ++++ cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/sys.c 2008-03-21 03:01:29.000000000 +0100 +@@ -86,6 +86,7 @@ + }; + + static struct kset gfs_kset = { ++ .kobj = {.name = "gfs",}, + .ktype = &gfs_ktype, + }; + +@@ -119,7 +120,6 @@ + { + gfs_sys_margs = NULL; + spin_lock_init(&gfs_sys_margs_lock); +- kobject_set_name(&gfs_kset.kobj, "gfs"); + kobj_set_kset_s(&gfs_kset, fs_subsys); + return kset_register(&gfs_kset); + } diff --git a/sys-cluster/gfs-kernel/gfs-kernel-2.02.00.ebuild b/sys-cluster/gfs-kernel/gfs-kernel-2.02.00.ebuild index 9326a8f8d2d0..9bcf3dea424c 100644 --- a/sys-cluster/gfs-kernel/gfs-kernel-2.02.00.ebuild +++ b/sys-cluster/gfs-kernel/gfs-kernel-2.02.00.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gfs-kernel/gfs-kernel-2.02.00.ebuild,v 1.1 2008/03/17 17:23:01 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gfs-kernel/gfs-kernel-2.02.00.ebuild,v 1.2 2008/03/21 02:21:04 xmerlin Exp $ inherit eutils linux-mod linux-info versionator @@ -32,6 +32,20 @@ pkg_setup() { esac } +src_unpack() { + unpack ${A} + cd "${S}" + + if kernel_is 2 6; then + if [ "$KV_PATCH" -lt "24" ] ; then + epatch "${FILESDIR}"/${P}-before-2.6.24.diff || die + fi + if [ "$KV_PATCH" -lt "23" ] ; then + epatch "${FILESDIR}"/${P}-before-2.6.23.diff || die + fi + fi +} + src_compile() { set_arch_to_kernel |