1. 14 5月, 2011 12 次提交
    • A
      UBIFS: use ro_mount instead of MS_RDONLY · 3b2f9a01
      Artem Bityutskiy 提交于
      We have our own flags indicating R/O mode, and c->ro_mode is equivalent
      to MS_RDONLY. Let's be consistent and use UBIFS flags everywhere.
      This patch is just a minor cleanup.
      
      Additionally, add a comment that we are surprised with VFS behavior -
      as a reminder to look at this some day.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      3b2f9a01
    • A
      UBIFS: use EROFS when emulating failures · 1a29af8b
      Artem Bityutskiy 提交于
      When the debugging failure emulation is enabled and UBIFS decides to
      emulate an I/O error, it uses EIO error code. In which case UBIFS
      switches into R/O mode later on. The for the user-space is that when
      a failure is emulated, the file-system sometimes returns EIO and
      sometimes EROFS. This makes it more difficult to implement user-space
      tests for the failure mode. Let's be consistent and return EROFS in
      all the cases.
      
      This patch is an improvement for the debugging code and does not affect
      the functionality at all.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      1a29af8b
    • S
      UBIFS: make xattr operations names consistent · 14ffd5d0
      Sedat Dilek 提交于
      This is just a tiny clean-up patch. The variable name for empty address
      space operations is "empty_aops". Let's use consistent names for empty
      inode and file operations: "empty_iops" and "empty_fops", instead of
      inconsistent "none_inode_operations" and "none_file_operations".
      
      Artem: re-write the commit message.
      Signed-off-by: NSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      14ffd5d0
    • A
      UBIFS: introduce lsave debugging · cdd8ad6e
      Artem Bityutskiy 提交于
      Try to improve UBIFS testing coverage by randomly picking LEBs to
      store in lsave, rather than picking them optimally. Create a debugging
      version of 'populate_lsave()' for these purposes and enable it when
      general debugging self-checks are enabled.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      cdd8ad6e
    • A
      UBIFS: make force in-the-gaps to be a general self-check · bc3f07f0
      Artem Bityutskiy 提交于
      UBIFS can force itself to use the 'in-the-gaps' commit method - the last resort
      method which is normally invoced very very rarely. Currently this "force
      int-the-gaps" debugging feature is a separate test mode. But it is a bit saner
      to make it to be the "general" self-test check instead.
      
      This patch is just a clean-up which should make the debugging code look a bit
      nicer and easier to use - we have way too many debugging options.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      bc3f07f0
    • A
      UBIFS: improve space checking debugging feature · f1bd66af
      Artem Bityutskiy 提交于
      This patch improves the 'dbg_check_space_info()' function which checks
      whether the amount of space before re-mounting and after re-mounting
      is the same (remounting from R/O to R/W modes and vice-versa).
      
      The problem is that 'dbg_check_space_info()' does not save the budgeting
      information before re-mounting, so when an error is reported, we do not
      know why the amount of free space changed.
      
      This patches makes the following changes:
      
      1. Teaches 'dbg_dump_budg()' function to accept a 'struct ubifs_budg_info'
         argument and print out the this argument. This way we may ask it to
         print any saved budgeting info, no only the current one.
      2. Accordingly changes all the callers of 'dbg_dump_budg()' to comply with
         the changed interface.
      3. Introduce a 'saved_bi' (saved budgeting info) field to
         'struct ubifs_debug_info' and save the budgeting info before re-mounting
         there.
      4. Change 'dbg_check_space_info()' and make it print both old and new
         budgeting information.
      5. Additionally, save 'c->igx_gc_cnt' and print it if and error happens. This
         value contributes to the amount of free space, so we have to print it.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      f1bd66af
    • A
      UBIFS: rearrange the budget dump · 8c3067e4
      Artem Bityutskiy 提交于
      Re-arrange the budget dump and make sure we first dump all
      the 'struct ubifs_budg_info' fields, and then the other information.
      Additionally, print the 'uncommitted_idx' variable.
      
      This change is required for to the following dumping function
      enhancement where it will be possible to dump saved
      'struct ubifs_budg_info' objects, not only the current one.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      8c3067e4
    • A
      UBIFS: simplify dbg_dump_budg calling conventions · 8ff83089
      Artem Bityutskiy 提交于
      The current 'dbg_dump_budg()' calling convention is that the
      'c->space_lock' spinlock is held. However, none of the callers
      actually use it from contects which have 'c->space_lock' locked,
      so all callers have to explicitely lock and unlock the spinlock.
      This is not very sensible convention. This patch changes it and
      makes 'dbg_dump_budg()' lock the spinlock instead of imposing this
      to the callers. This simplifies the code a little.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      8ff83089
    • A
      UBIFS: introduce a separate structure for budgeting info · b137545c
      Artem Bityutskiy 提交于
      This patch separates out all the budgeting-related information
      from 'struct ubifs_info' to 'struct ubifs_budg_info'. This way the
      code looks a bit cleaner. However, the main driver for this is
      that we want to save budgeting information and print it later,
      so a separate data structure for this is helpful.
      
      This patch is a preparation for the further debugging output
      improvements.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      b137545c
    • A
      UBIFS: use __packed instead of __attribute__((packed)) · cc64f774
      Artem Bityutskiy 提交于
      There was an attempt to standartize various "__attribute__" and
      other macros in order to have potentially portable and more
      consistent code, see commit 82ddcb04.
      
      Note, that commit refers Rober Love's blog post, but the URL
      is broken, the valid URL is:
      http://blog.rlove.org/2005/10/with-little-help-from-your-compiler.html
      
      Moreover, nowadays checkpatch.pl warns about using
      __attribute__((packed)):
      
      "WARNING: __packed is preferred over __attribute__((packed))"
      
      It is not a big deal for UBIFS to use __packed, so let's do it.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      cc64f774
    • A
      UBIFS: fix minor stylistic issues · c4361570
      Artem Bityutskiy 提交于
      Fix several minor stylistic issues:
      * lines longer than 80 characters
      * space before closing parenthesis ')'
      * spaces in the indentations
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      c4361570
    • A
      UBIFS: make debugfs files non-seekable · 1bbfc848
      Artem Bityutskiy 提交于
      Turn the debufs files UBIFS maintains into non-seekable. Indeed, none
      of them is supposed to be seek'ed.
      
      Do this by making the '.lseek()' handler to be 'no_llseek()' and by
      using 'nonseekable_open()' in the '.open()' operation.
      
      This does mean an API break but this debugging API is only used by a couple
      of test scripts which do not rely in the 'llseek()' operation.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      1bbfc848
  2. 10 5月, 2011 25 次提交
  3. 09 5月, 2011 3 次提交