1. 19 7月, 2014 1 次提交
  2. 02 6月, 2014 1 次提交
  3. 21 5月, 2012 1 次提交
  4. 17 5月, 2012 2 次提交
  5. 04 7月, 2011 5 次提交
  6. 03 6月, 2011 1 次提交
  7. 16 5月, 2011 2 次提交
    • A
      UBIFS: synchronize write-buffer before switching to the next bud · cb14a184
      Artem Bityutskiy 提交于
      Currently when UBIFS fills up the current bud (which is the last in the journal
      head) and switches to the next bud, it first writes the log reference node for
      the next bud and only after this synchronizes the write-buffer of the previous
      bud. This is not a big deal, but an unclean power cut may lead to a situation
      when we have corruption in a next-to-last bud, although it is much more logical
      that we have to have corruption only in the last bud.
      
      This patch also removes write-buffer synchronization from
      'ubifs_wbuf_seek_nolock()' because this is not needed anymore (we synchronize
      the write-buffer explicitly everywhere now) and also because this is just
      prone to various errors.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      cb14a184
    • A
      UBIFS: remove unnecessary stack variable · 12f33891
      Artem Bityutskiy 提交于
      This is patch removes an unnecessary 'offs' variable from 'ubifs_wbuf_write_nolock()'
      - we can just keep 'wbuf->offs' up-to-date instead. This patch is very minor
      the only motivation for it was that it is cleaner to keep wbuf->offs up-to-date
      by the time we call 'ubifs_leb_write()'.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      12f33891
  8. 14 5月, 2011 1 次提交
  9. 08 3月, 2011 2 次提交
    • A
      UBIFS: use max_write_size for write-buffers · 6c7f74f7
      Artem Bityutskiy 提交于
      Switch write-buffers from 'c->min_io_size' to 'c->max_write_size' which
      presumably has to be more write speed-efficient. However, when write-buffer
      is synchronized, write only the the min. I/O units which contain the
      data, do not write whole write-buffer. This is more space-efficient.
      
      Additionally, this patch takes into account that the LEB might not start
      from the max. write unit-aligned address.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6c7f74f7
    • A
      UBIFS: introduce write-buffer size field · 3c89f396
      Artem Bityutskiy 提交于
      Currently we assume write-buffer size is always min_io_size. But
      this is about to change and write-buffers may be of variable size.
      Namely, they will be of max_write_size at the beginning, but will
      get smaller when we are approaching the end of LEB.
      
      This is a preparation patch which introduces 'size' field in
      the write-buffer structure which carries the current write-buffer
      size.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      3c89f396
  10. 18 1月, 2011 1 次提交
    • A
      UBIFS: introduce mounting flag · 18d1d7fb
      Artem Bityutskiy 提交于
      This is a preparational patch which removes the 'c->always_chk_crc' which was
      set during mounting and remounting to R/W mode and introduces 'c->mounting'
      flag which is set when mounting. Now the 'c->always_chk_crc' flag is the
      same as 'c->remounting_rw && c->mounting'.
      
      This patch is a preparation for the next one which will need to know when we
      are mounting and remounting to R/W mode, which is exactly what
      'c->always_chk_crc' effectively is, but its name does not suite the
      next patch. The other possibility would be to just re-name it, but then
      we'd end up with less logical flags coverage.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      18d1d7fb
  11. 20 9月, 2010 1 次提交
    • A
      UBIFS: introduce new flags for RO mounts · 2ef13294
      Artem Bityutskiy 提交于
      Commit 2fde99cb "UBIFS: mark VFS SB RO too"
      introduced regression. This commit made UBIFS set the 'MS_RDONLY' flag in the
      VFS superblock when it switches to R/O mode due to an error. This was done
      to make VFS show the R/O UBIFS flag in /proc/mounts.
      
      However, several places in UBIFS relied on the 'MS_RDONLY' flag and assume this
      flag can only change when we re-mount. For example, 'ubifs_put_super()'.
      
      This patch introduces new UBIFS flag - 'c->ro_mount' which changes only when
      we re-mount, and preserves the way UBIFS was originally mounted (R/W or R/O).
      This allows us to de-initialize UBIFS cleanly in 'ubifs_put_super()'.
      
      This patch also changes all 'ubifs_assert(!c->ro_media)' assertions to
      'ubifs_assert(!c->ro_media && !c->ro_mount)', because we never should write
      anything if the FS was mounter R/O.
      
      All the places where we test for 'MS_RDONLY' flag in the VFS SB were changed
      and now we test the 'c->ro_mount' flag instead, because it preserves the
      original UBIFS mount type, unlike the 'MS_RDONLY' flag.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      2ef13294
  12. 17 9月, 2010 1 次提交
    • A
      UBIFS: introduce new flag for RO due to errors · 2680d722
      Artem Bityutskiy 提交于
      The R/O state may have various reasons:
      
      1. The UBI volume is R/O
      2. The FS is mounted R/O
      3. The FS switched to R/O mode because of an error
      
      However, in UBIFS we have only one variable which represents cases
      1 and 3 - 'c->ro_media'. Indeed, we set this to 1 if we switch to
      R/O mode due to an error, and then we test it in many places to
      make sure that we stop writing as soon as the error happens.
      
      But this is very unclean. One consequence of this, for example, is
      that in 'ubifs_remount_fs()' we use 'c->ro_media' to check whether
      we are in R/O mode because on an error, and we print a message
      in this case. However, if we are in R/O mode because the media
      is R/O, our message is bogus.
      
      This patch introduces new flag - 'c->ro_error' which is set when
      we switch to R/O mode because of an error. It also changes all
      "if (c->ro_media)" checks to "if (c->ro_error)" checks, because
      this is what the checks actually mean. We do not need to check
      for 'c->ro_media' because if the UBI volume is in R/O mode, we
      do not allow R/W mounting, and now writes can happen. This is
      guaranteed by VFS. But it is good to double-check this, so this
      patch also adds many "ubifs_assert(!c->ro_media)" checks.
      
      In the 'ubifs_remount_fs()' function this patch makes a bit more
      changes - it fixes the error messages as well.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      2680d722
  13. 30 8月, 2010 1 次提交
  14. 29 4月, 2010 1 次提交
  15. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  16. 15 9月, 2009 1 次提交
  17. 05 7月, 2009 6 次提交
  18. 08 6月, 2009 1 次提交
    • A
      UBIFS: start using hrtimers · f2c5dbd7
      Artem Bityutskiy 提交于
      UBIFS uses timers for write-buffer write-back. It is not
      crucial for us to write-back exactly on time. We are fine
      to write-back a little earlier or later. And this means
      we may optimize UBIFS timer so that it could be groped
      with a close timer event, so that the CPU would not be
      waken up just to do the write back. This is optimization
      to lessen power consumption, which is important in
      embedded devices UBIFS is used for.
      
      hrtimers have a nice feature: they are effectively range
      timers, and we may defind the soft and hard limits for
      it. Standard timers do not have these feature. They may
      only be made deferrable, but this means there is effectively
      no hard limit. So, we will better use hrtimers.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      f2c5dbd7
  19. 27 1月, 2009 1 次提交
    • A
      UBIFS: fix no_chk_data_crc · 6f7ab6d4
      Artem Bityutskiy 提交于
      When data CRC checking is disabled, UBIFS returns incorrect return
      code from the 'try_read_node()' function (0 instead of 1, which means
      CRC error), which make the caller re-read the data node again, but using
      a different code patch, so the second read is fine. Thus, we read the
      same node twice. And the result of this is that UBIFS is slower
      with no_chk_data_crc option than it is with chk_data_crc option.
      This patches fixes the problem.
      Reported-by: NReuben Dowle <Reuben.Dowle@navico.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6f7ab6d4
  20. 30 9月, 2008 2 次提交
  21. 13 8月, 2008 1 次提交
  22. 15 7月, 2008 1 次提交