Linux Kernel
3.7.1
|
#include "ubi.h"
Go to the source code of this file.
Functions | |
int | ubi_calc_data_len (const struct ubi_device *ubi, const void *buf, int length) |
int | ubi_check_volume (struct ubi_device *ubi, int vol_id) |
void | ubi_update_reserved (struct ubi_device *ubi) |
void | ubi_calculate_reserved (struct ubi_device *ubi) |
int | ubi_check_pattern (const void *buf, uint8_t patt, int size) |
calc_data_len - calculate how much real data is stored in a buffer. : UBI device description object : a buffer with the contents of the physical eraseblock : the buffer length
This function calculates how much "real data" is stored in and returnes the length. Continuous 0xFF bytes at the end of the buffer are not considered as "real data".
void ubi_calculate_reserved | ( | struct ubi_device * | ubi | ) |
int ubi_check_volume | ( | struct ubi_device * | ubi, |
int | vol_id | ||
) |
ubi_check_volume - check the contents of a static volume. : UBI device description object : ID of the volume to check
This function checks if static volume is corrupted by fully reading it and checking data CRC. This function returns %0 if the volume is not corrupted, %1 if it is corrupted and a negative error code in case of failure. Dynamic volumes are not checked and zero is returned immediately.
void ubi_update_reserved | ( | struct ubi_device * | ubi | ) |
ubi_update_reserved - update bad eraseblock handling accounting data. : UBI device description object
This function calculates the gap between current number of PEBs reserved for bad eraseblock handling and the required level of PEBs that must be reserved, and if necessary, reserves more PEBs to fill that gap, according to availability. Should be called with ubi->volumes_lock held.