[PATCH] Fixs to work on ARM and PARIC platforms.
Hello all,
I spend the last couple days tracking down why FUSE would not work on the ARM and PARISC platform ... With the hints from James Bottomley in the "Example filesystems fail to init on parisc" thread and a fair amount of persistence I was got a patch that works.
The patch really fixes two bugs:
1. The rwlock tree_lock in struct fuse was not properly initialized using pthread_rwlock_init(). This normally works on other archs (besides PARISC) since the lock can be initialized to 0 values, this is not true on the PARISC platform ... these locks must be initialized properly to work on PARISC.
2. I had to add an additional cache flush in the fuse_copy_do function. On both ARM and PARISC, the data was corrupted unless cache is flushed first. Unfortunately I hit it with a very big hammer (flush_cache_all) ... I am hoping someone more familiar with the caches will suggest a better flush function to use. I tried to use the flush_kernel_dcache_page and flush_dcache_page functions without any luck :(
Hopefully this work will enable FUSE to work on these architectures in the near future.
Thanks,
- Ryan
--- fuse-2.6.0-pre2/kernel/dev.c.orig 2006-04-01 00:40:28.000000000 -0800
+++ fuse-2.6.0-pre2/kernel/dev.c 2006-04-01 00:40:43.000000000 -0800
@@ -522,6 +522,7 @@
{
unsigned ncpy = min(*size, cs->len);
if (val) {
+ flush_cache_all();
if (cs->write)
memcpy(cs->buf, *val, ncpy);
else
--- fuse-2.6.0-pre2/lib/fuse.c.orig 2006-04-01 00:54:32.000000000 -0800
+++ fuse-2.6.0-pre2/lib/fuse.c 2006-04-01 00:47:48.000000000 -0800
@@ -2068,6 +2068,7 @@
}
mutex_init(&f->lock);
+ pthread_rwlock_init(&f->tree_lock, PTHREAD_RWLOCK_PREFER_READER_NP);
memcpy(&f->op, op, op_size);
f->compat = compat;
RSS Feed