]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jffs2/fs.c
[JFFS2] Teach JFFS2 about Sibley flash
[linux-2.6-omap-h63xx.git] / fs / jffs2 / fs.c
index c91c66e5e869fa9bc1d3f31361ccdfc9d8d21c86..79b4bdc76f7acbbebcd11c472e44f98df1a3b698 100644 (file)
@@ -7,11 +7,10 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: fs.c,v 1.53 2005/02/09 09:23:53 pavlov Exp $
+ * $Id: fs.c,v 1.62 2005/08/06 04:51:30 nico Exp $
  *
  */
 
-#include <linux/version.h>
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -148,7 +147,7 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
        old_metadata = f->metadata;
 
        if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size)
-               jffs2_truncate_fraglist (c, &f->fragtree, iattr->ia_size);
+               jffs2_truncate_fragtree (c, &f->fragtree, iattr->ia_size);
 
        if (ivalid & ATTR_SIZE && inode->i_size < iattr->ia_size) {
                jffs2_add_full_dnode_to_inode(c, f, new_metadata);
@@ -195,19 +194,15 @@ int jffs2_statfs(struct super_block *sb, struct kstatfs *buf)
        buf->f_namelen = JFFS2_MAX_NAME_LEN;
 
        spin_lock(&c->erase_completion_lock);
-
        avail = c->dirty_size + c->free_size;
        if (avail > c->sector_size * c->resv_blocks_write)
                avail -= c->sector_size * c->resv_blocks_write;
        else
                avail = 0;
+       spin_unlock(&c->erase_completion_lock);
 
        buf->f_bavail = buf->f_bfree = avail >> PAGE_SHIFT;
 
-       D2(jffs2_dump_block_lists(c));
-
-       spin_unlock(&c->erase_completion_lock);
-
        return 0;
 }
 
@@ -518,7 +513,7 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
        root_i = iget(sb, 1);
        if (is_bad_inode(root_i)) {
                D1(printk(KERN_WARNING "get root inode failed\n"));
-               goto out_nodes;
+               goto out_root_i;
        }
 
        D1(printk(KERN_DEBUG "jffs2_do_fill_super(): d_alloc_root()\n"));
@@ -526,9 +521,7 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
        if (!sb->s_root)
                goto out_root_i;
 
-#if LINUX_VERSION_CODE >= 0x20403
        sb->s_maxbytes = 0xFFFFFFFF;
-#endif
        sb->s_blocksize = PAGE_CACHE_SIZE;
        sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
        sb->s_magic = JFFS2_SUPER_MAGIC;
@@ -538,7 +531,6 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
 
  out_root_i:
        iput(root_i);
- out_nodes:
        jffs2_free_ino_caches(c);
        jffs2_free_raw_node_refs(c);
        if (c->mtd->flags & MTD_NO_VIRTBLOCKS)
@@ -672,7 +664,14 @@ static int jffs2_flash_setup(struct jffs2_sb_info *c) {
                if (ret)
                        return ret;
        }
-       
+
+       /* and Intel "Sibley" flash */
+       if (jffs2_nor_wbuf_flash(c)) {
+               ret = jffs2_nor_wbuf_flash_setup(c);
+               if (ret)
+                       return ret;
+       }
+
        return ret;
 }
 
@@ -691,4 +690,9 @@ void jffs2_flash_cleanup(struct jffs2_sb_info *c) {
        if (jffs2_dataflash(c)) {
                jffs2_dataflash_cleanup(c);
        }
+
+       /* and Intel "Sibley" flash */
+       if (jffs2_nor_wbuf_flash(c)) {
+               jffs2_nor_wbuf_flash_cleanup(c);
+       }
 }