Re: [PATCH v2] mtd: implement proper partition handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Richard,

Richard Weinberger <richard@xxxxxx> wrote on Thu, 9 Jan 2020 00:34:18
+0100 (CET):

> ----- Ursprüngliche Mail -----
> > Von: "Miquel Raynal" <miquel.raynal@xxxxxxxxxxx>
> > An: "richard" <richard@xxxxxx>, "Vignesh Raghavendra" <vigneshr@xxxxxx>, "Tudor Ambarus" <Tudor.Ambarus@xxxxxxxxxxxxx>,
> > "linux-mtd" <linux-mtd@xxxxxxxxxxxxxxxxxxx>
> > CC: "Boris Brezillon" <boris.brezillon@xxxxxxxxxxxxx>, "Thomas Petazzoni" <thomas.petazzoni@xxxxxxxxxxx>, "Miquel
> > Raynal" <miquel.raynal@xxxxxxxxxxx>
> > Gesendet: Montag, 30. Dezember 2019 12:19:48
> > Betreff: [PATCH v2] mtd: implement proper partition handling  
> 
> > Instead of collecting partitions in a flat list, create a hierarchy
> > within the mtd_info structure: use a partitions list to keep track of
> > the partitions of an MTD device (which might be itself a partition of
> > another MTD device), a pointer to the parent device (NULL when the MTD
> > device is the root one, not a partition).  
> 
> What problem does this solve?
> ...beside of a nice diffstat which removes more than it adds. :-)

It is much easier to escalade to the top most "master" device when
there are multiple levels of partitioning, which was not cleanly
described IMHO. Also it is already used in the MLC-in-pseudo-SLC-mode
series :)

> 
> > By also saving directly in mtd_info the offset of the partition, we
> > can get rid of the mtd_part structure.
> > 
> > While at it, be consistent in the naming of the mtd_info structures to
> > ease the understanding of the new hierarchy: these structures are
> > usually called 'mtd', unless there are multiple instances of the same
> > structure. In this case, there is usually a parent/child bound so we
> > will call them 'parent' and 'child'.
> > 
> > Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>  
> 
> [...]
> 
> > +static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd)
> > +{
> > +	while (mtd->parent)
> > +		mtd = mtd->parent;
> > +
> > +	return mtd;
> > +}  
> 
> So, parent == master?

top most parent (the one without parent) == master !

> 
> When I create a MTD ontop of UBI using gluebi, who will be parent/master?

I don't really understand the issue here?

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux