1. 21 May, 2012 4 commits
    • Joel Reardon's avatar
      UBI: modify ubi_wl_flush function to clear work queue for a lnum · 62f38455
      Joel Reardon authored
      This patch modifies ubi_wl_flush to force the erasure of
      particular volume id / logical eraseblock number pairs. Previous functionality
      is preserved when passing UBI_ALL for both values. The locations where ubi_wl_flush
      were called are appropriately changed: ubi_leb_erase only flushes for the
      erased LEB, and ubi_create_volume forces only flushing for its volume id.
      External code can call this new feature via the new function ubi_flush() added
      to kapi.c, which simply passes through to ubi_wl_flush().
      
      This was tested by disabling the call to do_work in ubi thread, which results
      in the work queue remaining unless explicitly called to remove. UBIFS was
      changed to call ubifs_leb_change 50 times for four different LEBs. Then the
      new function was called to clear the queue: passing wrong volume ids / lnum,
      correct ones, and finally UBI_ALL for both to ensure it was finally all
      cleard. The work queue was dumped each time and the selective removal
      of the particular LEB numbers was observed. Extra checks were enabled and
      ubifs's integck was also run. Finally, the drive was repeatedly filled and
      emptied to ensure that the queue was cleared normally.
      
      Artem: amended the patch.
      Signed-off-by: default avatarJoel Reardon <reardonj@inf.ethz.ch>
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      62f38455
    • Artem Bityutskiy's avatar
      UBI: introduce UBI_ALL constant · 05a3cb7d
      Artem Bityutskiy authored
      Joel will use it in his 'ubi_flush()' extention to specify all eraseblocks.
      Also amend the comment for UBI_UNKNOWN - it is used beyond attaching info
      structure now.
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      05a3cb7d
    • Joel Reardon's avatar
      UBI: add lnum and vol_id to struct ubi_work · d36e59e6
      Joel Reardon authored
      This is part of a multipart patch to allow UBI to force the erasure of
      particular logical eraseblock numbers. In this patch, the volume id and LEB
      number are added to ubi_work data structure, and both are also passed as a
      parameter to schedule erase to set it appropriately. Whenever ubi_wl_put_peb
      is called, the lnum is also passed to be forwarded to schedule erase. Later,
      a new ubi_sync_lnum will be added to execute immediately all work related to
      that lnum.
      
      This was tested by outputting the vol_id and lnum during the schedule of
      erasure. The ubi thread was disabled and two ubifs drives on separate
      partitions repeated changed a small number of LEBs. The ubi module was readded,
      and all the erased LEBs, corresponding to the volumes, were added to the
      schedule erase queue.
      
      Artem: minor tweaks
      Signed-off-by: default avatarJoel Reardon <reardonj@inf.ethz.ch>
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      d36e59e6
    • Joel Reardon's avatar
      UBI: add volume id struct ubi_ainf_peb · 6dd3bc7e
      Joel Reardon authored
      This patch adds the volume id to struct ubi_ainf_peb when scanning the LEBs at
      startup. PEBs now added to the erase queue will know their original LEB number
      and volume id, if available, and will be -1 otherwise (for instance, if the VID
      header is unreadable).
      
      This was tested by creating an ubi device with 3 volumes and disabiling the
      ubi_thread's do_work functionality. The different ubi volumes were formatted
      to ubifs and had files created and erased.  The ubi modules was reloaded and
      the list of LEB's added to the erased list was outputted, confirming the
      volume ids and LEB numbers were appropriate.
      Signed-off-by: default avatarJoel Reardon <reardonj@inf.ethz.ch>
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      6dd3bc7e
  2. 20 May, 2012 36 commits