Messages in this thread | | | Subject | Re: [PATCH 1/7] [RFC] UBI: Export next_sqnum() | From | Artem Bityutskiy <> | Date | Tue, 22 May 2012 11:23:32 +0300 |
| |
On Mon, 2012-05-21 at 16:16 +0200, Richard Weinberger wrote: > > It still contains EC and VID headers. So you can use the existing code > > for scanning it. > > I use already ubi_io_read_vid_hdr() and ubi_io_read_ec_hdr() what should > I reuse?
As I wrote: 'process_eb()'. Now it is named 'scan_peb()' after the renames.
It does all the work to scan PEB headers. Create a _separate_ 'struct ubi_attach_info' run 'scan_peb()' for each PEB of the fastmap. Check for errors, and sanity (all headers are there, no errors, etc, may be an extra self-check function would be appropriate here). Then go through the resulting fastmap volume attach info, read and process the fastmap _contents_. Of course you need the second (real) attach info for the data you read from the fastmep. This is what I call "reuse the existing" code.
How does this sound to you?
> Also checking the image sequence would make sense.
Yes, you should check everything. If you reuse the code, you will get this automatically, no?
-- Best Regards, Artem Bityutskiy [unhandled content-type:application/pgp-signature] | |