rpms/staging-kmod/F-17 declare_zsmalloc_license_and_init_exit_functions.patch, NONE, 1.1 staging-kmod.spec, 1.45, 1.46

Thorsten Leemhuis thl at rpmfusion.org
Tue Jul 31 21:06:18 CEST 2012


Author: thl

Update of /cvs/free/rpms/staging-kmod/F-17
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv24678

Modified Files:
	staging-kmod.spec 
Added Files:
	declare_zsmalloc_license_and_init_exit_functions.patch 
Log Message:
* Tue Jul 31 2012 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 3.5-2.1
- Fix zram


declare_zsmalloc_license_and_init_exit_functions.patch:
 zsmalloc-main.c |   29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

--- NEW FILE declare_zsmalloc_license_and_init_exit_functions.patch ---
diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/drivers/staging/zsmalloc/zsmalloc-main.c
index fb54a9b94c33..4ba1911f97ff 100644
--- a/drivers/staging/zsmalloc/zsmalloc-main.c
+++ b/drivers/staging/zsmalloc/zsmalloc-main.c
@@ -471,13 +471,7 @@ static struct page *find_get_zspage(struct size_class *class)
 }
 
 
-/*
- * If this becomes a separate module, register zs_init() with
- * module_init(), zs_exit with module_exit(), and remove zs_initialized
-*/
-static int zs_initialized;
-
-static int zs_cpu_notifier(struct notifier_block *nb, unsigned long action,
+static int zs_cpu_notifier(struct notifier_block *nb, unsigned long action,
 				void *pcpu)
 {
 	int cpu = (long)pcpu;
@@ -508,7 +502,7 @@ static struct notifier_block zs_cpu_nb = {
 	.notifier_call = zs_cpu_notifier
 };
 
-static void zs_exit(void)
+static void __exit zs_exit(void)
 {
 	int cpu;
 
@@ -517,7 +511,7 @@ static void zs_exit(void)
 	unregister_cpu_notifier(&zs_cpu_nb);
 }
 
-static int zs_init(void)
+static int __init zs_init(void)
 {
 	int cpu, ret;
 
@@ -562,17 +556,6 @@ struct zs_pool *zs_create_pool(const char *name, gfp_t flags)
 
 	}
 
-	/*
-	 * If this becomes a separate module, register zs_init with
-	 * module_init, and remove this block
-	*/
-	if (!zs_initialized) {
-		error = zs_init();
-		if (error)
-			goto cleanup;
-		zs_initialized = 1;
-	}
-
 	pool->flags = flags;
 	pool->name = name;
 
@@ -799,3 +782,9 @@ u64 zs_get_total_size_bytes(struct zs_pool *pool)
 	return npages << PAGE_SHIFT;
 }
 EXPORT_SYMBOL_GPL(zs_get_total_size_bytes);
+
+MODULE_AUTHOR("Nitin Gupta <ngupta at vflare.org>");
+MODULE_LICENSE("Dual BSD/GPL");
+
+module_init(zs_init);
+module_exit(zs_exit);


Index: staging-kmod.spec
===================================================================
RCS file: /cvs/free/rpms/staging-kmod/F-17/staging-kmod.spec,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- staging-kmod.spec	31 Jul 2012 18:52:55 -0000	1.45
+++ staging-kmod.spec	31 Jul 2012 19:06:18 -0000	1.46
@@ -28,6 +28,8 @@
 URL:           http://www.kernel.org/
 # a script to create this archive is part of staging-kmod-addons
 Source0:       linux-staging-%{version}%{?prever:-%{prever}}.tar.bz2
+# taken from http://driverdev.linuxdriverproject.org/pipermail/devel/2012-June/027381.html
+Patch1:        declare_zsmalloc_license_and_init_exit_functions.patch
 
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: %{_bindir}/kmodtool
@@ -52,6 +54,10 @@
 # disable drivers that are enabled in Fedora's kernel, as those otherweise would get build
 sed -i 's|.*DABUSB.*||; s|.*SE401.*||;  s|.*VICAM.*||; s|.CRYSTALH||; s|.*LIRC.*||; s|.*R8712U.*||;' $(find linux-staging-%{version}%{?prever:-%{prever}}/drivers/staging/ -name 'Makefile')
 
+cd linux-staging-%{version}%{?prever:-%{prever}}
+%patch1  -p1
+cd -
+
 # seperate directories for each kernel variant (PAE, non-PAE, ...) we build the modules for
 for kernel_version in %{?kernel_versions} ; do
  cp -a linux-staging-%{version}%{?prever:-%{prever}}/ _kmod_build_${kernel_version%%___*}
@@ -136,6 +142,9 @@
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Tue Jul 31 2012 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 3.5-2.1
+- Fix zram
+
 * Tue Jul 31 2012 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 3.5-1.1
 - Update to 3.5
 - Disable Mei, now a proper driver


More information about the rpmfusion-commits mailing list