Package: unionfs-source
Version: 1.4+debian-4
Severity: important
Tags: patch


I attach a diff file with unionfs patch to compile in 2.6.20 kernel



-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (990, 'testing'), (90, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)

Versions of packages unionfs-source depends on:
ii  bzip2                         1.0.3-6    high-quality block-sorting file co
ii  debhelper                     5.0.42     helper programs for debian/rules
ii  make                          3.81-2     The GNU version of the "make" util
ii  module-assistant              0.10.8     tool to make module package creati

Versions of packages unionfs-source recommends:
ii  unionfs-tools               1.4+debian-4 Tools to manage unionfs filesystem

-- no debconf information
diff -ur -x Module.symvers -x control.backup -x fistdev.mk -x Makefile -x control unionfs.orig/build/lookup.c unionfs/build/lookup.c
--- unionfs.orig/build/lookup.c	2007-04-17 11:09:00.000000000 +0200
+++ unionfs/build/lookup.c	2007-01-29 00:55:07.000000000 +0100
@@ -382,7 +382,7 @@
 }
 
 /* The dentry cache is just so we have properly sized dentries. */
-static struct kmem_cache *unionfs_dentry_cachep;
+static kmem_cache_t *unionfs_dentry_cachep;
 int init_dentry_cache(void)
 {
 	unionfs_dentry_cachep =
@@ -399,10 +399,9 @@
 {
 	if (!unionfs_dentry_cachep)
 		return;
-	kmem_cache_destroy(unionfs_dentry_cachep);
-	/*if (kmem_cache_destroy(unionfs_dentry_cachep))
+	if (kmem_cache_destroy(unionfs_dentry_cachep))
 		printk(KERN_ERR
-		       "unionfs_dentry_cache: not all structures were freed\n");*/
+		       "unionfs_dentry_cache: not all structures were freed\n");
 	return;
 }
 
@@ -421,7 +420,7 @@
 	spin_lock(&dentry->d_lock);
 	if (!dtopd_nocheck(dentry)) {
 		dtopd_lhs(dentry) = (struct unionfs_dentry_info *)
-		    kmem_cache_alloc(unionfs_dentry_cachep, GFP_ATOMIC);
+		    kmem_cache_alloc(unionfs_dentry_cachep, SLAB_ATOMIC);
 		if (!dtopd_nocheck(dentry))
 			goto out;
 		init_MUTEX_LOCKED(&dtopd_nocheck(dentry)->udi_sem);
diff -ur -x Module.symvers -x control.backup -x fistdev.mk -x Makefile -x control unionfs.orig/build/rdstate.c unionfs/build/rdstate.c
--- unionfs.orig/build/rdstate.c	2007-04-17 10:42:50.000000000 +0200
+++ unionfs/build/rdstate.c	2007-01-29 00:55:07.000000000 +0100
@@ -26,11 +26,11 @@
 /* There are two structures here, rdstate which is a hash table
  * of the second structure which is a filldir_node. */
 
-/* This is a kmem_cache for filldir nodes, because we allocate a lot of them
+/* This is a kmem_cache_t for filldir nodes, because we allocate a lot of them
  * and they shouldn't waste memory.  If the node has a small name (as defined
  * by the dentry structure), then we use an inline name to preserve kmalloc
  * space. */
-static struct kmem_cache *unionfs_filldir_cachep;
+static kmem_cache_t *unionfs_filldir_cachep;
 int init_filldir_cache(void)
 {
 	unionfs_filldir_cachep =
@@ -47,11 +47,10 @@
 {
 	if (!unionfs_filldir_cachep)
 		return;
-	kmem_cache_destroy(unionfs_filldir_cachep);
-	/*if (kmem_cache_destroy(unionfs_filldir_cachep)) {
+	if (kmem_cache_destroy(unionfs_filldir_cachep)) {
 		printk(KERN_ERR
 		       "unionfs_filldir_cache: not all structures were freed\n");
-	}*/
+	}
 	return;
 }
 
@@ -254,7 +253,7 @@
 
 	newnode =
 	    (struct filldir_node *)kmem_cache_alloc(unionfs_filldir_cachep,
-						    GFP_KERNEL);
+						    SLAB_KERNEL);
 	if (!newnode)
 		goto out;
 
diff -ur -x Module.symvers -x control.backup -x fistdev.mk -x Makefile -x control unionfs.orig/build/sioq.c unionfs/build/sioq.c
--- unionfs.orig/build/sioq.c	2007-04-17 11:10:04.000000000 +0200
+++ unionfs/build/sioq.c	2007-01-29 00:55:07.000000000 +0100
@@ -41,68 +41,67 @@
 		destroy_workqueue(sioq);
 }
 
-void run_sioq(work_func_t func, struct sioq_args *args)
+void run_sioq(void (*func)(void *arg), struct sioq_args *args)
 {
-	/*DECLARE_WORK(wk, func, &args->comp);*/
-	INIT_WORK(&args->tqueue, func);
+	DECLARE_WORK(wk, func, &args->comp);
 
 	init_completion(&args->comp);
-	while (!queue_work(sioq, &args->tqueue)) {
+	while (!queue_work(sioq, &wk)) {
 		// TODO: do accounting if needed
 		schedule();
 	}
 	wait_for_completion(&args->comp);
 }
 
-void __unionfs_create(struct work_struct *work)
+void __unionfs_create(void *data)
 {
-	struct sioq_args *args = container_of(work, struct sioq_args, tqueue);
+	struct sioq_args *args = data;
 	struct create_args *c = &args->create;
 	args->err = vfs_create(c->parent, c->dentry, c->mode, c->nd);
 	complete(&args->comp);
 }
 
-void __unionfs_mkdir(struct work_struct *work)
+void __unionfs_mkdir(void *data)
 {
-	struct sioq_args *args = container_of(work, struct sioq_args, tqueue);
+	struct sioq_args *args = data;
 	struct mkdir_args *m = &args->mkdir;
 	args->err = vfs_mkdir(m->parent, m->dentry, m->mode);
 	complete(&args->comp);
 }
 
-void __unionfs_mknod(struct work_struct *work)
+void __unionfs_mknod(void *data)
 {
-	struct sioq_args *args = container_of(work, struct sioq_args, tqueue);
+	struct sioq_args *args = data;
 	struct mknod_args *m = &args->mknod;
 	args->err = vfs_mknod(m->parent, m->dentry, m->mode, m->dev);
 	complete(&args->comp);
 }
-void __unionfs_symlink(struct work_struct *work)
+void __unionfs_symlink(void *data)
 {
-	struct sioq_args *args = container_of(work, struct sioq_args, tqueue);
+	struct sioq_args *args = data;
 	struct symlink_args *s = &args->symlink;
 	args->err = vfs_symlink(s->parent, s->dentry, s->symbuf, s->mode);
 	complete(&args->comp);
 }
 
-void __unionfs_unlink(struct work_struct *work)
+void __unionfs_unlink(void *data)
 {
-	struct sioq_args *args = container_of(work, struct sioq_args, tqueue);
+	struct sioq_args *args = data;
 	struct unlink_args *u = &args->unlink;
 	args->err = vfs_unlink(u->parent, u->dentry);
 	complete(&args->comp);
 }
 
-void __delete_whiteouts(struct work_struct *work) {
-	struct sioq_args *args = container_of(work, struct sioq_args, tqueue);
+void __delete_whiteouts(void *data) {
+	struct sioq_args *args = data;
 	struct deletewh_args *d = &args->deletewh;
 	args->err = delete_whiteouts(d->dentry, d->bindex, d->namelist);
 	complete(&args->comp);
 }
 
-void __is_opaque_dir(struct work_struct *work)
+void __is_opaque_dir(void *data)
 {
-	struct sioq_args *args = container_of(work, struct sioq_args, tqueue);
+	struct sioq_args *args = data;
 
 	args->ret = lookup_one_len(UNIONFS_DIR_OPAQUE, args->isopaque.dentry,
 				sizeof(UNIONFS_DIR_OPAQUE) - 1);
diff -ur -x Module.symvers -x control.backup -x fistdev.mk -x Makefile -x control unionfs.orig/build/sioq.h unionfs/build/sioq.h
--- unionfs.orig/build/sioq.h	2007-04-17 11:07:54.000000000 +0200
+++ unionfs/build/sioq.h	2007-01-29 00:55:07.000000000 +0100
@@ -50,8 +50,6 @@
 	int err;
 	void *ret;
 
-	struct work_struct tqueue;
-
 	union {
 		struct deletewh_args deletewh;
 		struct isopaque_args isopaque;
@@ -66,16 +64,16 @@
 extern struct workqueue_struct *sioq;
 int __init init_sioq(void);
 extern void fin_sioq(void);
-extern void run_sioq(work_func_t func, struct sioq_args *args);
+extern void run_sioq(void (*func)(void *arg), struct sioq_args *args);
 
 /* Extern definitions for our privledge escalation helpers */
-extern void __unionfs_create(struct work_struct *work);
-extern void __unionfs_mkdir(struct work_struct *work);
-extern void __unionfs_mknod(struct work_struct *work);
-extern void __unionfs_symlink(struct work_struct *work);
-extern void __unionfs_unlink(struct work_struct *work);
-extern void __delete_whiteouts(struct work_struct *work);
-extern void __is_opaque_dir(struct work_struct *work);
+extern void __unionfs_create(void *data);
+extern void __unionfs_mkdir(void *data);
+extern void __unionfs_mknod(void *data);
+extern void __unionfs_symlink(void *data);
+extern void __unionfs_unlink(void *data);
+extern void __delete_whiteouts(void *data);
+extern void __is_opaque_dir(void *data);
 
 #endif /* _SIOQ_H */
 
diff -ur -x Module.symvers -x control.backup -x fistdev.mk -x Makefile -x control unionfs.orig/build/stale_inode.c unionfs/build/stale_inode.c
--- unionfs.orig/build/stale_inode.c	2007-04-17 10:28:04.000000000 +0200
+++ unionfs/build/stale_inode.c	2007-01-29 00:55:07.000000000 +0100
@@ -10,7 +10,7 @@
  *  $Id: stale_inode.c,v 1.13 2006/03/21 09:22:11 jsipek Exp $
  */
 
-/*#include <linux/config.h>*/
+#include <linux/config.h>
 #include <linux/version.h>
 
 #include <linux/fs.h>
diff -ur -x Module.symvers -x control.backup -x fistdev.mk -x Makefile -x control unionfs.orig/build/super.c unionfs/build/super.c
--- unionfs.orig/build/super.c	2007-04-17 10:41:48.000000000 +0200
+++ unionfs/build/super.c	2007-01-29 00:55:07.000000000 +0100
@@ -24,7 +24,7 @@
 
 /* The inode cache is used with alloc_inode for both our inode info and the
  * vfs inode.  */
-static struct kmem_cache *unionfs_inode_cachep;
+static kmem_cache_t *unionfs_inode_cachep;
 
 static void unionfs_read_inode(struct inode *inode)
 {
@@ -326,7 +326,7 @@
 	print_entry_location();
 
 	c = (struct unionfs_inode_container *)
-	    kmem_cache_alloc(unionfs_inode_cachep, GFP_KERNEL);
+	    kmem_cache_alloc(unionfs_inode_cachep, SLAB_KERNEL);
 	if (!c) {
 		print_exit_pointer(NULL);
 		return NULL;
@@ -346,7 +346,7 @@
 	print_exit_location();
 }
 
-static void init_once(void *v, struct kmem_cache * cachep, unsigned long flags)
+static void init_once(void *v, kmem_cache_t * cachep, unsigned long flags)
 {
 	struct unionfs_inode_container *c = (struct unionfs_inode_container *)v;
 
@@ -380,10 +380,9 @@
 	print_entry_location();
 	if (!unionfs_inode_cachep)
 		goto out;
-	kmem_cache_destroy(unionfs_inode_cachep);
-	/*if (kmem_cache_destroy(unionfs_inode_cachep))
+	if (kmem_cache_destroy(unionfs_inode_cachep))
 		printk(KERN_ERR
-		       "unionfs_inode_cache: not all structures were freed\n");*/
+		       "unionfs_inode_cache: not all structures were freed\n");
       out:
 	print_exit_location();
 	return;
diff -ur -x Module.symvers -x control.backup -x fistdev.mk -x Makefile -x control unionfs.orig/build/unionfs.h unionfs/build/unionfs.h
--- unionfs.orig/build/unionfs.h	2007-04-17 10:27:57.000000000 +0200
+++ unionfs/build/unionfs.h	2007-01-29 00:55:07.000000000 +0100
@@ -3,7 +3,7 @@
 
 #ifdef __KERNEL__
 
-/*#include <linux/config.h>*/
+#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -517,7 +517,7 @@
 	dest->i_atime = src->i_atime;
 	dest->i_mtime = src->i_mtime;
 	dest->i_ctime = src->i_ctime;
-	/*dest->i_blksize = src->i_blksize;*/
+	dest->i_blksize = src->i_blksize;
 	dest->i_blkbits = src->i_blkbits;
 	dest->i_size = src->i_size;
 	dest->i_blocks = src->i_blocks;

Reply via email to