[Yaffs] [Fwd: Exporting jffs2 by nfs with kernel 2.6]

Top Page
Attachments:
Message as email
+ (text/plain)
+ jffs2_exported_by_nfs.patch (text/x-patch)
+ (text/plain)
Delete this message
Reply to this message
Author: Nick Bane
Date:  
To: Yaffs@Stoneboat.Aleph1.Co.Uk
Subject: [Yaffs] [Fwd: Exporting jffs2 by nfs with kernel 2.6]
Is any of this relevant to yaffs? It looks likely.
Nick
-------- Original Message --------
Subject: Exporting jffs2 by nfs with kernel 2.6
Date: Wed, 6 Sep 2006 17:38:49 +0200
From: Gregory CLEMENT <>
To:

Hi all,

On 2.4.18 we managed to export a jffs2 filesystem by nfs.
Now on 2.6.16 we can't.
I found 2 problems for it:
First, changed was made in nfs, and now they test if
s_export_op is not a void pointer. By dding a pointer on
this structure (even this structure is void) makes nfs happy.
If the structure is void nfs use generic function, so for this part
I think it's ok

Second, nfs need to identify the filesystem to export. It is done
either by the device of the filesystem or by a "fsid". I didfn't see any
filesystem use a "fsid" and I don't know how to use it. So identification
is made if FS_REQUIRES_DEV is set. The problem was in kernel 2.5.7,
this flag was removed because "We never really used the block device anyway".
Do you mind setting this flag again? Or have you a better idea?

I joined my patch which make jffs2 exportable by nfs:

--
Gregory CLEMENT
Adeneo

Index: linux-2.6.16/fs/jffs2/super.c
===================================================================
diff -u -r1.1 -r1.2
--- linux-2.6.16/fs/jffs2/super.c    6 Jun 2006 16:18:24 -0000    1.1
+++ linux-2.6.16/fs/jffs2/super.c    6 Sep 2006 14:14:37 -0000    1.2
@@ -80,6 +80,10 @@
     .sync_fs =    jffs2_sync_fs,
 };


+/* Just declare a void structure as A NULL value implies the default */
+static struct export_operations jffs2_export_ops;
+
+
 static int jffs2_sb_compare(struct super_block *sb, void *data)
 {
     struct jffs2_sb_info *p = data;
@@ -150,6 +154,7 @@
     spin_lock_init(&c->inocache_lock);


     sb->s_op = &jffs2_super_operations;
+    sb->s_export_op = &jffs2_export_ops;
     sb->s_flags = flags | MS_NOATIME;


     ret = jffs2_do_fill_super(sb, data, (flags&MS_VERBOSE)?1:0);
@@ -314,6 +319,7 @@
     .name =        "jffs2",
     .get_sb =    jffs2_get_sb,
     .kill_sb =    jffs2_kill_sb,
+    .fs_flags = FS_REQUIRES_DEV,
 };


static int __init init_jffs2_fs(void)
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/438 - Release Date: 05/09/2006