Re: [Yaffs] yaffs with kernel 2.6.26: no put_inode()

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: KOU Hanjun
Date:  
To: 'Bob Dunlop'
CC: yaffs
Subject: Re: [Yaffs] yaffs with kernel 2.6.26: no put_inode()
Sorry. I forgot to CC to the mailing list.
----------------------------------------------------------------------------
Hi, Bob
Thank you very much for your help!
Your patch almost worked except that there is another change in 2.6.26 that
the symbol proc_root is invisible, too. The init_yaffs_fs() and
exit_yaffs_fs() needs slight modifications when creating and removing the
proc entry /proc/yaffs.

I have another patch based on yours:

--- fs/yaffs2/yaffs_fs.c    (revision 79)
+++ fs/yaffs2/yaffs_fs.c    (working copy)
@@ -196,7 +196,9 @@
 static int yaffs_statfs(struct super_block *sb, struct statfs *buf);
 #endif


+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
static void yaffs_put_inode(struct inode *inode);
+#endif
static void yaffs_delete_inode(struct inode *);
static void yaffs_clear_inode(struct inode *);

@@ -301,7 +303,9 @@
 #ifndef YAFFS_USE_OWN_IGET
     .read_inode = yaffs_read_inode,
 #endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
     .put_inode = yaffs_put_inode,
+#endif
     .put_super = yaffs_put_super,
     .delete_inode = yaffs_delete_inode,
     .clear_inode = yaffs_clear_inode,
@@ -445,6 +449,7 @@


}

+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
 /* For now put inode is just for debugging
  * Put inode is called when the inode **structure** is put.
  */
@@ -455,6 +460,7 @@
        atomic_read(&inode->i_count)));


}
+#endif

 /* clear is called to tell the fs to release any per-inode data it holds */
 static void yaffs_clear_inode(struct inode *inode)
@@ -2304,7 +2310,7 @@
     /* Install the proc_fs entry */
     my_proc_entry = create_proc_entry("yaffs",
                            S_IRUGO | S_IFREG,
-                           &proc_root);
+                           NULL);


     if (my_proc_entry) {
         my_proc_entry->write_proc = yaffs_proc_write;
@@ -2350,7 +2356,7 @@
     T(YAFFS_TRACE_ALWAYS, ("yaffs " __DATE__ " " __TIME__
                    " removing. \n"));


-    remove_proc_entry("yaffs", &proc_root);
+    remove_proc_entry("yaffs", NULL);


     fsinst = fs_to_install;




BR,
Hanjun KOU

-----Original Message-----
From: Bob Dunlop [mailto:rdunlop@guralp.com]
Sent: Tuesday, July 22, 2008 4:28 PM
To: KOU Hanjun
Cc:
Subject: Re: [Yaffs] yaffs with kernel 2.6.26: no put_inode()

Hi,

On Tue, Jul 22 at 02:58, KOU Hanjun wrote:
> Hi,
>
> Did anybody spend some time in compiling yaffs for 2.6.26?


Not yet, although I'm sure I'll have that pleasure to come.


> The .put_inode member in struct super_operations has been removed in

2.6.26.
>
> Anybody with a patch?


Since the function is just a debug printf in YAFFS and no longer used in
the kernel I think it would be safe to simply delete it. Untested patch
below, let us know how you get on.


--- yaffs_fs.c-orig     2008-07-22 09:21:20.000000000 +0100
+++ yaffs_fs.c  2008-07-22 09:22:03.000000000 +0100
@@ -183,7 +183,6 @@
 #endif
 static void yaffs_read_inode(struct inode *inode);


-static void yaffs_put_inode(struct inode *inode);
static void yaffs_delete_inode(struct inode *);
static void yaffs_clear_inode(struct inode *);

@@ -285,7 +284,6 @@
 static struct super_operations yaffs_super_ops = {
        .statfs = yaffs_statfs,
        .read_inode = yaffs_read_inode,
-       .put_inode = yaffs_put_inode,
        .put_super = yaffs_put_super,
        .delete_inode = yaffs_delete_inode,
        .clear_inode = yaffs_clear_inode,
@@ -429,17 +427,6 @@


}

-/* For now put inode is just for debugging
- * Put inode is called when the inode **structure** is put.
- */
-static void yaffs_put_inode(struct inode *inode)
-{
-       T(YAFFS_TRACE_OS,
-         ("yaffs_put_inode: ino %d, count %d\n", (int)inode->i_ino,
-          atomic_read(&inode->i_count)));
-
-}
-
 /* clear is called to tell the fs to release any per-inode data it holds */
 static void yaffs_clear_inode(struct inode *inode)
 {



-- 
        Bob Dunlop
        Guralp Systems Limited
        http://www.guralp.com