]> 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 a6661e8be25a06cf92d7e673faf4fc0d7922b0a7..79b4bdc76f7acbbebcd11c472e44f98df1a3b698 100644 (file)
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: fs.c,v 1.59 2005/07/18 11:21:19 dedekind Exp $
+ * $Id: fs.c,v 1.62 2005/08/06 04:51:30 nico Exp $
  *
  */
 
@@ -147,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);
@@ -194,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;
 
-       jffs2_dbg_dump_block_lists(c);
-
-       spin_unlock(&c->erase_completion_lock);
-
        return 0;
 }
 
@@ -668,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;
 }
 
@@ -687,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);
+       }
 }