ubi: decode flags field of struct ubi_mkvol_req

Introduced by Linux commit v4.19-rc1~13^2~6.

* configure.ac (AC_CHECK_MEMBERS): Add check for struct
ubi_mkvol_req.flags field.
* ubi.c: Include "xlat/ubi_mkvol_req_flags.h".
(UBI_MKVOL_REQ_FLAGS_FIELD): New macro definition.
(ubi_ioctl): Decode the flags field of struct ubi_mkvol_req.
* xlat/ubi_mkvol_req_flags.in: New file.
This commit is contained in:
Eugene Syromyatnikov 2018-08-25 22:10:44 +02:00
parent 044c1560f2
commit da228c39ad
3 changed files with 15 additions and 1 deletions

View File

@ -572,7 +572,10 @@ AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>
AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include <mtd/ubi-user.h>])
AC_CHECK_MEMBERS(m4_normalize([
struct ubi_attach_req.max_beb_per1024
struct ubi_mkvol_req.flags
]),,, [#include <mtd/ubi-user.h>])
AC_CHECK_TYPES(m4_normalize([
struct ptp_sys_offset

10
ubi.c
View File

@ -32,9 +32,16 @@
# include <linux/ioctl.h>
# include <mtd/ubi-user.h>
# include "xlat/ubi_mkvol_req_flags.h"
# include "xlat/ubi_volume_types.h"
# include "xlat/ubi_volume_props.h"
# ifdef HAVE_STRUCT_UBI_MKVOL_REQ_FLAGS
# define UBI_MKVOL_REQ_FLAGS_FIELD flags
# else
# define UBI_MKVOL_REQ_FLAGS_FIELD padding1
# endif
int
ubi_ioctl(struct tcb *const tcp, const unsigned int code,
const kernel_ulong_t arg)
@ -56,6 +63,9 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code,
mkvol.alignment, (int64_t)mkvol.bytes);
printxval(ubi_volume_types,
(uint8_t) mkvol.vol_type, "UBI_???_VOLUME");
printflags(ubi_mkvol_req_flags,
(uint8_t) mkvol.UBI_MKVOL_REQ_FLAGS_FIELD,
"UBI_VOL_???_FLG");
tprintf(", name_len=%" PRIi16 ", name=",
mkvol.name_len);
print_quoted_cstring(mkvol.name,

View File

@ -0,0 +1 @@
UBI_VOL_SKIP_CRC_CHECK_FLG 0x1