1. 25 4月, 2007 2 次提交
    • J
      [JFFS2] Better fix for all-zero node headers · 0dec4c8b
      Joakim Tjernlund 提交于
      No need to check for all-zero header since the header cannot
      be zero due to other checks.
      
      Replace the all-zero header check in readinode.c with a
      check for the magic word.
      Signed-off-by: NJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      0dec4c8b
    • D
      [JFFS2] Improve read_inode memory usage, v2. · df8e96f3
      David Woodhouse 提交于
      We originally used to read every node and allocate a jffs2_tmp_dnode_info
      structure for each, before processing them in (reverse) version order
      and discarding the ones which are obsoleted by later nodes.
      
      With huge logfiles, this behaviour caused memory problems. For example, a
      file involved in OLPC trac #1292 has 1822391 nodes, and would cause the XO
      machine to run out of memory during the first stage of read_inode().
      
      Instead of just inserting nodes into a tree in version order as we find
      them, we now put them into a tree in order of their offset within the
      file, which allows us to immediately discard nodes which are completely
      obsoleted.
      
      We don't use a full tree with 'fragments' pointing to the real data
      structure, as we do in the normal fragtree. We sort only on the start
      address, and add an 'overlapped' flag to the tmp_dnode_info to indicate
      that the node in question is (partially) overlapped by another.
      
      When the scan is complete, we start at the end of the file, adding each
      node to a real fragtree as before. Where the node is non-overlapped, we
      just add it (it doesn't matter that it's not the latest version; there is
      no overlap). When the node at the end of the tree _is_ overlapped, we sort
      it and all its overlapping nodes into version order and then add them to
      the fragtree in that order.
      
      This 'early discard' reduces the peak allocation of tmp_dnode_info
      structures from 1.8M to a mere 62872 (3.5%) in the degenerate case
      referenced above.
      
      This version of the patch also correctly rememembers the highest node
      version# seen for an inode when it's scanned.
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      df8e96f3
  2. 23 4月, 2007 2 次提交
    • D
      [JFFS2] Improve failure mode if inode checking leaves unchecked space. · 44b998e1
      David Woodhouse 提交于
      We should never find the unchecked size is non-zero after we've finished
      checking all inodes. If it happens, used to BUG(), leaving the alloc_sem
      held and deadlocking. Instead, just return -ENOSPC after complaining. The
      GC thread will die, but read-only operation should be able to continue and
      the file system should be unmountable.
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      44b998e1
    • D
      [JFFS2] Fix cross-endian build. · 566865a2
      David Woodhouse 提交于
      When compiling a LE-capable JFFS2 on PowerPC, wbuf.c fails to compile:
      
      fs/jffs2/wbuf.c:973: error: braced-group within expression allowed only inside a function
      fs/jffs2/wbuf.c:973: error: initializer element is not constant
      fs/jffs2/wbuf.c:973: error: (near initialization for ‘oob_cleanmarker.magic’)
      fs/jffs2/wbuf.c:974: error: braced-group within expression allowed only inside a function
      fs/jffs2/wbuf.c:974: error: initializer element is not constant
      fs/jffs2/wbuf.c:974: error: (near initialization for ‘oob_cleanmarker.nodetype’)
      fs/jffs2/wbuf.c:975: error: braced-group within expression allowed only inside a function
      fs/jffs2/wbuf.c:976: error: initializer element is not constant
      fs/jffs2/wbuf.c:976: error: (near initialization for ‘oob_cleanmarker.totlen’)
      
      Provide constant_cpu_to_je{16,32} functions, and use them for initialising the
      offending structure.
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      566865a2
  3. 21 4月, 2007 1 次提交
  4. 18 4月, 2007 6 次提交
  5. 03 4月, 2007 1 次提交
  6. 10 3月, 2007 1 次提交
  7. 09 3月, 2007 2 次提交
  8. 08 3月, 2007 2 次提交
    • D
      [JFFS2] Use yield() between GC passes in background thread. · f8a922c7
      David Woodhouse 提交于
      The garbage collection thread is strictly an optimisation. Everything it
      does would also be done just-in-time in the context of something in
      userspace trying to access the file system.
      
      Sometimes, however, it's a pessimisation. Especially during early boot
      when it's checksumming nodes and scanning inodes which are shortly going
      to be pulled in by read_inode anyway. We end up building the rbtree of
      node coverage twice for the same inode.
      
      By switching to yield() instead of cond_resched() in the main loop, we
      observe boot times on the OLPC system going down from about 100 seconds to
      60.
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      f8a922c7
    • V
      [JFFS2] Fix writebuffer recovery in the first page of a block · 180bfb31
      Vitaly Wool 提交于
      For the case when nand_write_page fail with -EIO for the first page in an
      eraseblock, jffs2_wbuf_recover ends up producing a BUG in jffs2_block_refile
      as jeb->first_node is not yet set up (it's set up later in jffs2_wbuf_recover).
      This BUG is not really a bug; it's just jffs2_wbuf_recover calling
      jffs2_block_refile with the wrong second parameter.
      This patch takes care of this situation.
      Signed-off-by: NVitaly Wool <vwool@ru.mvista.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      180bfb31
  9. 19 2月, 2007 1 次提交
    • A
      [JFFS2] printk warning fixes · 7be26bfb
      Andrew Morton 提交于
      fs/jffs2/wbuf.c: In function 'jffs2_check_oob_empty':
      fs/jffs2/wbuf.c:993: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
      fs/jffs2/wbuf.c:993: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
      fs/jffs2/wbuf.c: In function 'jffs2_check_nand_cleanmarker':
      fs/jffs2/wbuf.c:1036: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
      fs/jffs2/wbuf.c:1036: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
      fs/jffs2/wbuf.c: In function 'jffs2_write_nand_cleanmarker':
      fs/jffs2/wbuf.c:1062: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
      fs/jffs2/wbuf.c:1062: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      7be26bfb
  10. 15 2月, 2007 1 次提交
    • T
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau 提交于
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  11. 13 2月, 2007 2 次提交
  12. 09 2月, 2007 2 次提交
  13. 13 1月, 2007 1 次提交
  14. 10 1月, 2007 2 次提交
  15. 03 1月, 2007 1 次提交
  16. 19 12月, 2006 1 次提交
  17. 10 12月, 2006 1 次提交
  18. 09 12月, 2006 1 次提交
  19. 08 12月, 2006 3 次提交
  20. 04 12月, 2006 1 次提交
  21. 29 11月, 2006 2 次提交
    • A
      [MTD] return error code from get_mtd_device() · 9c74034f
      Artem Bityutskiy 提交于
      get_mtd_device() returns NULL in case of any failure. Teach it to return an
      error code instead. Fix all users as well.
      Signed-off-by: NArtem Bityutskiy <dedekind@infradead.org>
      9c74034f
    • V
      [MTD] [NAND] remove len/ooblen confusion. · 7014568b
      Vitaly Wool 提交于
      As was discussed between Ricard Wanderlöf, David Woodhouse, Artem 
      Bityutskiy and me, the current API for reading/writing OOB is confusing. 
      
      The thing that introduces confusion is the need to specify ops.len 
      together with ops.ooblen for reads/writes that concern only OOB not data 
      area. So, ops.len is overloaded: when ops.datbuf != NULL it serves to 
      specify the length of the data read, and when ops.datbuf == NULL, it 
      serves to specify the full OOB read length.
      
      The patch inlined below is the slightly updated version of the previous 
      patch serving the same purpose, but with the new Artem's comments taken 
      into account.
      
      Artem, BTW, thanks a lot for your valuable input!
      Signed-off-by: NVitaly Wool <vwool@ru.mvista.com>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      7014568b
  22. 21 10月, 2006 2 次提交
  23. 12 10月, 2006 1 次提交
  24. 04 10月, 2006 1 次提交
    • J
      [JFFS2] kill warning RE debug-only variables · a6b1d82d
      Jeff Garzik 提交于
      gcc emits the following warning on a 'allmodconfig' build:
      
      fs/jffs2/xattr.c: In function ‘unrefer_xattr_datum’:
      fs/jffs2/xattr.c:402: warning: unused variable ‘version’
      fs/jffs2/xattr.c:402: warning: unused variable ‘xid’
      
      Given that these variables are only used in the debug printk, and they
      merely remove a deref, we can easily kill the warning by adding the
      derefs to the debug printk.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      a6b1d82d