/* * Copyright (c) 2012 Linutronix GmbH * Author: Richard Weinberger <richard@nod.at> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * */#include<linux/crc32.h>#include"ubi.h"/** * ubi_calc_fm_size - calculates the fastmap size in bytes for an UBI device. * @ubi: UBI device description object */size_tubi_calc_fm_size(structubi_device*ubi){size_tsize;size=sizeof(structubi_fm_hdr)+\
sizeof(structubi_fm_scan_pool)+\
sizeof(structubi_fm_scan_pool)+\
(ubi->peb_count*sizeof(structubi_fm_ec))+\
(sizeof(structubi_fm_eba)+\
(ubi->peb_count*sizeof(__be32)))+\
sizeof(structubi_fm_volhdr)