From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from down.free-electrons.com ([37.187.137.238] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZgVLA-0004Sl-Ar for linux-mtd@lists.infradead.org; Mon, 28 Sep 2015 10:07:24 +0000 Date: Mon, 28 Sep 2015 12:06:51 +0200 From: Boris Brezillon To: "Bean Huo =?UTF-8?B?6ZyN5paM5paM?= (beanhuo)" Cc: "dedekind1@gmail.com" , "adrian.hunter@intel.com" , "computersforpeace@gmail.com" , "baruch@tkos.co.il" , "asierra@xes-inc.com" , "guz.fnst@cn.fujitsu.com" , "gsi@denx.de" , "richard@nod.at" , David Woodhouse , "linux-mtd@lists.infradead.org" , "Frank Liu =?UTF-8?B?5YiY576k?= (frankliu)" , Andrea Scian , "Peter Pan =?UTF-8?B?5r2Y5p+P5a6P?= (peterpan)" , "Karl Zhang =?UTF-8?B?5byg5Y+M6ZSj?= (karlzhang)" , Iwo Mergler , "Jeff Lauruhn (jlauruhn)" , Stefan Roese , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 3/9] drivers:mtd:ubi:add metadata struct for UBI bakvol Message-ID: <20150928120651.5c55317d@bbrezillon> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 28 Sep 2015 07:02:42 +0000 Bean Huo =E9=9C=8D=E6=96=8C=E6=96=8C (beanhuo) wrote: > Add metadata struct for UBI bakvol. > Currently , bakvol reserves 20 PEBs for internal log volume. > Shares wear-leveling operation with ubi.=20 >=20 >=20 > Signed-off-by: Bean Huo > --- > drivers/mtd/ubi/ubi-media.h | 40 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 40 insertions(+) >=20 [...] > =20 > @@ -325,6 +339,32 @@ struct ubi_vid_hdr { > #define UBI_VTBL_RECORD_SIZE_CRC (UBI_VTBL_RECORD_SIZE - sizeof(__be32)) > =20 > /** > + * struct ubi_bkblk_info - the information for one backup block . > + * @pbn: physical block number > + * @lbn: logic block number > + * @plane: this block belongs to which plane > + * @pgnum: the page number (lower page) that can be programmed last time > + */ I'm not sure to understand what those fields are used for, but I guess I'll understand it while reviewing the following patches. > +struct ubi_bkblk_info { > + __be32 pbn; > + __be32 lbn; > + __u8 plane; > + __be32 pgnum; > + struct list_head node; > +}; You're mixing runtime and storage representation: node has nothing to do here. > + > +/** > + * struct ubi_bkblk_tbl - a table for backup blocks. > + * @volume_built: indicate if backup volume be initted > + * @bcount_of_plane: block count that has bee applied for corresponding= plane > + */ > +struct ubi_bkblk_tbl { > + __u8 volume_built; > + __be32 bcount_of_plane[2]; > + struct list_head head; > +}; Ditto. --=20 Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com