Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

SPL on Gentoo #12

Closed
spielc opened this issue Jun 8, 2010 · 2 comments
Closed

SPL on Gentoo #12

spielc opened this issue Jun 8, 2010 · 2 comments

Comments

@spielc
Copy link

spielc commented Jun 8, 2010

Hi!

I was able to compile SPL on two different Gentoo machines using different versions of gcc and the kernel.

Machine A: GCC-4.4.3 and 2.6.33
Machine B: GCC-4.5.0 and 2.6.34 (yeah i know but i like to live a bit dangerous and i know how to help myself i shoot myself in the foot ;) )

First of all I was waiting for someone to step up and think of a way to get ZFS into my beloved linux. Nothing against (Open-)Solaris but i still prefer linux and to be honest i'm not a big fan of fuse so i really hope that you are able to introduce at least a partial working NATIVE zfs into the linux world.

So now let's get back to business: I was able to compile seriv's fork and patched version of spl (commit d7d332c6fbefa2369ea2) without touching the code with Machine A; on Machine B on the other hand i had to touch the code myself to make it compile the same version with gcc-4.5.0. The kernel itself is not the problem the problem is the stricter error-checking of gcc-4.5.0. This is the unified diff of my changes to the source-code

--- module/splat/splat-rwlock.c.orig    2010-06-08 21:25:57.989580948 +0200
+++ module/splat/splat-rwlock.c 2010-06-08 21:32:15.037148486 +0200
@@ -427,9 +427,13 @@
 splat_rwlock_test4_func(void *arg)
 {
        rw_priv_t *rwp = (rw_priv_t *)arg;
+       krw_t val=RW_NONE;
        ASSERT(rwp->rw_magic == SPLAT_RWLOCK_TEST_MAGIC);
 
-       if (rw_tryenter(&rwp->rw_rwlock, rwp->rw_type)) {
+    if (rwp->rw_type==RW_DRIVER)
+               val=RW_READER;
+
+       if (rw_tryenter(&rwp->rw_rwlock, val)) {
                rwp->rw_rc = 0;
                rw_exit(&rwp->rw_rwlock);
        } else {

Without these changes compilation failed with this error message:

cc1: warnings being treated as errors
/root/zfs/spl/module/splat/splat-rwlock.c: In function 'splat_rwlock_test4_func':
/root/zfs/spl/module/splat/splat-rwlock.c:432:6: error: case value '1' not in enumerated type 'krw_type_t'

After compiling the kernel-modules i tried to load them but i got the following error message on both machines:

Error: Unknown symbol get_zone_counts
SPL: Failed to Load Solaris Porting Layer v0.4.9, rc = -14

I tried to find out how/if i can force spl to export this symbol but i wasn't able to find the correct option to enable it.

Anyway keep up the good work!

@nevenchannyy
Copy link

get_zone_counts are removed from 2.6.27 kernels, but have defenition in header.

I'm sended cleanup patch to Andrew Morton sone time ago.


diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index b4d109e..9ed9c45 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -651,8 +651,6 @@ typedef struct pglist_data {
 #include 
 
 extern struct mutex zonelists_mutex;
-void get_zone_counts(unsigned long *active, unsigned long *inactive,
-                       unsigned long *free);
 void build_all_zonelists(void *data);
 void wakeup_kswapd(struct zone *zone, int order);
 int zone_watermark_ok(struct zone *z, int order, unsigned long mark,

@spielc
Copy link
Author

spielc commented Jul 5, 2010

Closing as things work with commit d466208

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants