UBI: improve internal interfaces
Pass volume description object to the EBA function which makes more sense, and EBA function do not have to find the volume description object by volume ID. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
@@ -129,8 +129,7 @@ static int gluebi_read(struct mtd_info *mtd, loff_t from, size_t len,
|
||||
if (to_read > total_read)
|
||||
to_read = total_read;
|
||||
|
||||
err = ubi_eba_read_leb(ubi, vol->vol_id, lnum, buf, offs,
|
||||
to_read, 0);
|
||||
err = ubi_eba_read_leb(ubi, vol, lnum, buf, offs, to_read, 0);
|
||||
if (err)
|
||||
break;
|
||||
|
||||
@@ -187,8 +186,8 @@ static int gluebi_write(struct mtd_info *mtd, loff_t to, size_t len,
|
||||
if (to_write > total_written)
|
||||
to_write = total_written;
|
||||
|
||||
err = ubi_eba_write_leb(ubi, vol->vol_id, lnum, buf, offs,
|
||||
to_write, UBI_UNKNOWN);
|
||||
err = ubi_eba_write_leb(ubi, vol, lnum, buf, offs, to_write,
|
||||
UBI_UNKNOWN);
|
||||
if (err)
|
||||
break;
|
||||
|
||||
@@ -237,7 +236,7 @@ static int gluebi_erase(struct mtd_info *mtd, struct erase_info *instr)
|
||||
return -EROFS;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
err = ubi_eba_unmap_leb(ubi, vol->vol_id, lnum + i);
|
||||
err = ubi_eba_unmap_leb(ubi, vol, lnum + i);
|
||||
if (err)
|
||||
goto out_err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user