Decode mtd/ubi ioctls

Been playing with UBI of late and it'd help if I could see what it was
doing.  Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes
a pointer to a 64bit value, not a strict.

* util.c (MAX, MIN): Move to ...
* defs.h (MAX, MIN): ... here.
(CLAMP): Define.
(ubi_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'.
* mtd.c: Include ubi user API header.
(ubi_volume_types): New enum decode.
(ubi_volume_props): Likewise.
(ubi_ioctl): Define.
* linux/ubi-user.h: Import from linux 3.8.
5 files changed