]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
Merge tag 'upstream-3.8-rc1' of git://git.infradead.org/linux-ubi
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Dec 2012 15:39:03 +0000 (07:39 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Dec 2012 15:39:03 +0000 (07:39 -0800)
Pull UBI update from Artem Bityutskiy:
 "Nothing exciting, just clean-ups and nicification.  Oh, and one small
  optimization which makes UBI to use less RAM."

* tag 'upstream-3.8-rc1' of git://git.infradead.org/linux-ubi:
  UBI: embed ubi_debug_info field in ubi_device struct
  UBI: introduce helpers dbg_chk_{io, gen}
  UBI: replace memcpy with struct assignment
  UBI: remove spurious comment
  UBI: gluebi: rename misleading variables
  UBI: do not allocate the memory unnecessarily
  UBI: use list_move_tail instead of list_del/list_add_tail

1  2 
drivers/mtd/ubi/wl.c

diff --combined drivers/mtd/ubi/wl.c
index 2144f611196e3188bd3983ea5e084dd4bafd47ff,c687538a8e3b74ad5735b6af20a3cf376db6546f..5df49d3cb5c7c05e7644bd9e534950b070336d5b
@@@ -1,5 -1,4 +1,4 @@@
  /*
-  * @ubi: UBI device description object
   * Copyright (c) International Business Machines Corp., 2006
   *
   * This program is free software; you can redistribute it and/or modify
@@@ -498,7 -497,7 +497,7 @@@ out
   * @ubi: UBI device description object
   *
   * This function returns a physical eraseblock in case of success and a
 - * negative error code in case of failure. Might sleep.
 + * negative error code in case of failure.
   */
  static int __wl_get_peb(struct ubi_device *ubi)
  {
@@@ -540,6 -539,13 +539,6 @@@ retry
         * ubi_wl_get_peb() after removing e from the pool. */
        prot_queue_add(ubi, e);
  #endif
 -      err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
 -                                  ubi->peb_size - ubi->vid_hdr_aloffset);
 -      if (err) {
 -              ubi_err("new PEB %d does not contain all 0xFF bytes", e->pnum);
 -              return err;
 -      }
 -
        return e->pnum;
  }
  
@@@ -672,30 -678,17 +671,30 @@@ static struct ubi_wl_entry *get_peb_for
  #else
  static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)
  {
 -      return find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
 +      struct ubi_wl_entry *e;
 +
 +      e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
 +      self_check_in_wl_tree(ubi, e, &ubi->free);
 +      rb_erase(&e->u.rb, &ubi->free);
 +
 +      return e;
  }
  
  int ubi_wl_get_peb(struct ubi_device *ubi)
  {
 -      int peb;
 +      int peb, err;
  
        spin_lock(&ubi->wl_lock);
        peb = __wl_get_peb(ubi);
        spin_unlock(&ubi->wl_lock);
  
 +      err = ubi_self_check_all_ff(ubi, peb, ubi->vid_hdr_aloffset,
 +                                  ubi->peb_size - ubi->vid_hdr_aloffset);
 +      if (err) {
 +              ubi_err("new PEB %d does not contain all 0xFF bytes", peb);
 +              return err;
 +      }
 +
        return peb;
  }
  #endif
@@@ -2050,7 -2043,7 +2049,7 @@@ static int self_check_ec(struct ubi_dev
        long long read_ec;
        struct ubi_ec_hdr *ec_hdr;
  
-       if (!ubi->dbg->chk_gen)
+       if (!ubi_dbg_chk_gen(ubi))
                return 0;
  
        ec_hdr = kzalloc(ubi->ec_hdr_alsize, GFP_NOFS);
@@@ -2090,7 -2083,7 +2089,7 @@@ out_free
  static int self_check_in_wl_tree(const struct ubi_device *ubi,
                                 struct ubi_wl_entry *e, struct rb_root *root)
  {
-       if (!ubi->dbg->chk_gen)
+       if (!ubi_dbg_chk_gen(ubi))
                return 0;
  
        if (in_wl_tree(e, root))
@@@ -2116,7 -2109,7 +2115,7 @@@ static int self_check_in_pq(const struc
        struct ubi_wl_entry *p;
        int i;
  
-       if (!ubi->dbg->chk_gen)
+       if (!ubi_dbg_chk_gen(ubi))
                return 0;
  
        for (i = 0; i < UBI_PROT_QUEUE_LEN; ++i)