Changeset 47748


Ignore:
Timestamp:
2015-12-04T10:33:08+01:00 (2 years ago)
Author:
rmilecki
Message:

kernel: drop unneeded modification of mtd_add_partition function

In old days mtd_add_partition was checking for partitions overlapping
which was breaking our splitting feature. We had to modify this function
by adding an extra bool dup_check parameter. Upstream commit:
3a434f66e6da ("mtd: part: Remove partition overlap checks")
removed that check so we don't need our modification anymore.

Signed-off-by: Rafał Miłecki <zajec5@…>

Location:
trunk/target/linux/generic/patches-4.4
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/patches-4.4/400-mtd-add-rootfs-split-support.patch

    r47701 r47748  
    4141 /* Our partition linked list */ 
    4242 static LIST_HEAD(mtd_partitions); 
    43 @@ -47,13 +49,14 @@ struct mtd_part { 
     43@@ -47,6 +49,8 @@ struct mtd_part { 
    4444        struct list_head list; 
    4545 }; 
     
    5050  * Given a pointer to the MTD object in the mtd_part structure, we can retrieve 
    5151  * the pointer to that structure with this macro. 
    52   */ 
    53  #define PART(x)  ((struct mtd_part *)(x)) 
    54   
    55 - 
    56  /* 
    57   * MTD methods which simply translate the effective address and pass through 
    58   * to the _real_ device. 
    59 @@ -579,8 +582,10 @@ static int mtd_add_partition_attrs(struc 
    60         return ret; 
    61  } 
    62   
    63 -int mtd_add_partition(struct mtd_info *master, const char *name, 
    64 -                     long long offset, long long length) 
    65 + 
    66 +static int 
    67 +__mtd_add_partition(struct mtd_info *master, const char *name, 
    68 +                   long long offset, long long length, bool dup_check) 
    69  { 
    70         struct mtd_partition part; 
    71         struct mtd_part *new; 
    72 @@ -612,6 +617,7 @@ int mtd_add_partition(struct mtd_info *m 
     52@@ -612,6 +616,7 @@ int mtd_add_partition(struct mtd_info *m 
    7353        mutex_unlock(&mtd_partitions_mutex); 
    7454  
     
    7858        mtd_add_partition_attrs(new); 
    7959  
    80 @@ -619,6 +625,12 @@ int mtd_add_partition(struct mtd_info *m 
    81  } 
    82  EXPORT_SYMBOL_GPL(mtd_add_partition); 
    83   
    84 +int mtd_add_partition(struct mtd_info *master, const char *name, 
    85 +                     long long offset, long long length) 
    86 +{ 
    87 +       return __mtd_add_partition(master, name, offset, length, true); 
    88 +} 
    89 + 
    90  int mtd_del_partition(struct mtd_info *master, int partno) 
    91  { 
    92         struct mtd_part *slave, *next; 
    93 @@ -644,6 +656,35 @@ int mtd_del_partition(struct mtd_info *m 
     60@@ -644,6 +649,35 @@ int mtd_del_partition(struct mtd_info *m 
    9461 } 
    9562 EXPORT_SYMBOL_GPL(mtd_del_partition); 
     
    12794  * This function, given a master MTD object and a partition table, creates 
    12895  * and registers slave MTD objects which are bound to the master according to 
    129 @@ -675,6 +716,7 @@ int add_mtd_partitions(struct mtd_info * 
     96@@ -675,6 +709,7 @@ int add_mtd_partitions(struct mtd_info * 
    13097                mutex_unlock(&mtd_partitions_mutex); 
    13198  
  • trunk/target/linux/generic/patches-4.4/401-mtd-add-support-for-different-partition-parser-types.patch

    r47701 r47748  
    1212--- a/drivers/mtd/mtdpart.c 
    1313+++ b/drivers/mtd/mtdpart.c 
    14 @@ -747,6 +747,30 @@ static struct mtd_part_parser *get_parti 
     14@@ -740,6 +740,30 @@ static struct mtd_part_parser *get_parti 
    1515  
    1616 #define put_partition_parser(p) do { module_put((p)->owner); } while (0) 
     
    4343 { 
    4444        spin_lock(&part_parser_lock); 
    45 @@ -875,6 +899,38 @@ int parse_mtd_partitions(struct mtd_info 
     45@@ -868,6 +892,38 @@ int parse_mtd_partitions(struct mtd_info 
    4646        return err; 
    4747 } 
  • trunk/target/linux/generic/patches-4.4/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch

    r47701 r47748  
    11--- a/drivers/mtd/mtdpart.c 
    22+++ b/drivers/mtd/mtdpart.c 
    3 @@ -656,6 +656,37 @@ int mtd_del_partition(struct mtd_info *m 
     3@@ -649,6 +649,36 @@ int mtd_del_partition(struct mtd_info *m 
    44 } 
    55 EXPORT_SYMBOL_GPL(mtd_del_partition); 
     
    2424+               parts[i].offset += slave->offset; 
    2525+ 
    26 +               __mtd_add_partition(slave->master, 
    27 +                                   parts[i].name, 
    28 +                                   parts[i].offset, 
    29 +                                   parts[i].size, 
    30 +                                   false); 
     26+               mtd_add_partition(slave->master, 
     27+                                 parts[i].name, 
     28+                                 parts[i].offset, 
     29+                                 parts[i].size); 
    3130+       } 
    3231+ 
     
    3938 #define SPLIT_FIRMWARE_NAME    CONFIG_MTD_SPLIT_FIRMWARE_NAME 
    4039 #else 
    41 @@ -664,6 +695,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); 
     40@@ -657,6 +687,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); 
    4241  
    4342 static void split_firmware(struct mtd_info *master, struct mtd_part *part) 
     
    4746  
    4847 void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, 
    49 @@ -678,6 +710,12 @@ static void mtd_partition_split(struct m 
     48@@ -671,6 +702,12 @@ static void mtd_partition_split(struct m 
    5049        if (rootfs_found) 
    5150                return; 
  • trunk/target/linux/generic/patches-4.4/404-mtd-add-more-helper-functions.patch

    r47701 r47748  
    11--- a/drivers/mtd/mtdpart.c 
    22+++ b/drivers/mtd/mtdpart.c 
    3 @@ -453,14 +453,12 @@ static struct mtd_part *allocate_partiti 
     3@@ -454,14 +454,12 @@ static struct mtd_part *allocate_partiti 
    44        if (slave->offset == MTDPART_OFS_APPEND) 
    55                slave->offset = cur_offset; 
     
    1919        if (slave->offset == MTDPART_OFS_RETAIN) { 
    2020                slave->offset = cur_offset; 
    21 @@ -687,6 +685,17 @@ run_parsers_by_type(struct mtd_part *sla 
     21@@ -679,6 +677,17 @@ run_parsers_by_type(struct mtd_part *sla 
    2222        return nr_parts; 
    2323 } 
     
    3737 #define SPLIT_FIRMWARE_NAME    CONFIG_MTD_SPLIT_FIRMWARE_NAME 
    3838 #else 
    39 @@ -986,6 +995,24 @@ int mtd_is_partition(const struct mtd_in 
     39@@ -978,6 +987,24 @@ int mtd_is_partition(const struct mtd_in 
    4040 } 
    4141 EXPORT_SYMBOL_GPL(mtd_is_partition); 
  • trunk/target/linux/generic/patches-4.4/411-mtd-partial_eraseblock_write.patch

    r47701 r47748  
    1010 static LIST_HEAD(mtd_partitions); 
    1111 static DEFINE_MUTEX(mtd_partitions_mutex); 
    12 @@ -235,13 +237,61 @@ static int part_erase(struct mtd_info *m 
     12@@ -236,13 +238,61 @@ static int part_erase(struct mtd_info *m 
    1313        struct mtd_part *part = PART(mtd); 
    1414        int ret; 
     
    7272 } 
    7373  
    74 @@ -249,7 +299,25 @@ void mtd_erase_callback(struct erase_inf 
     74@@ -250,7 +300,25 @@ void mtd_erase_callback(struct erase_inf 
    7575 { 
    7676        if (instr->mtd->_erase == part_erase) { 
     
    9898                        instr->fail_addr -= part->offset; 
    9999                instr->addr -= part->offset; 
    100 @@ -522,17 +590,20 @@ static struct mtd_part *allocate_partiti 
     100@@ -523,17 +591,20 @@ static struct mtd_part *allocate_partiti 
    101101        if ((slave->mtd.flags & MTD_WRITEABLE) && 
    102102            mtd_mod_by_eb(slave->offset, &slave->mtd)) { 
  • trunk/target/linux/generic/patches-4.4/412-mtd-partial_eraseblock_unlock.patch

    r47701 r47748  
    11--- a/drivers/mtd/mtdpart.c 
    22+++ b/drivers/mtd/mtdpart.c 
    3 @@ -336,7 +336,14 @@ static int part_lock(struct mtd_info *mt 
     3@@ -337,7 +337,14 @@ static int part_lock(struct mtd_info *mt 
    44 static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) 
    55 { 
Note: See TracChangeset for help on using the changeset viewer.