returns size of fmap data structure if successful, <0 to indicate error */
| 29 | |
| 30 | /* returns size of fmap data structure if successful, <0 to indicate error */ |
| 31 | int fmap_size(const struct fmap *fmap) |
| 32 | { |
| 33 | if (!fmap) |
| 34 | return -1; |
| 35 | |
| 36 | return sizeof(*fmap) + (le16toh(fmap->nareas) * sizeof(struct fmap_area)); |
| 37 | } |
| 38 | |
| 39 | /* Make a best-effort assessment if the given fmap is real */ |
| 40 | static int is_valid_fmap(const struct fmap *fmap) |
no outgoing calls