(More) new code for 5.6:
- Refactor the metadata buffer functions to return the usual int error
value instead of the open coded error checking mess we have now.