From: Dmitry V. Levin Date: Sun, 8 Jan 2017 00:26:36 +0000 (+0000) Subject: Mpersify struct sg_io_hdr X-Git-Tag: v4.16~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d30a9bf7795fcaa042181cc7503b881c5048a171;p=strace Mpersify struct sg_io_hdr struct sg_io_hdr contains pointers and therefore has to be mpersified. * defs.h (decode_sg_io_v3): Remove prototype. * sg_io_v3.c (struct_sg_io_hdr): Typedef to struct sg_io_hdr. Mpersify it. (decode_sg_io_v3): Wrap into MPERS_PRINTER_DECL. --- diff --git a/defs.h b/defs.h index 7a874c91..eae39874 100644 --- a/defs.h +++ b/defs.h @@ -638,7 +638,6 @@ DECL_IOCTL(ubi); DECL_IOCTL(uffdio); #undef DECL_IOCTL -extern int decode_sg_io_v3(struct tcb *, const kernel_ulong_t arg); extern int decode_sg_io_v4(struct tcb *, const kernel_ulong_t arg); extern int tv_nz(const struct timeval *); diff --git a/sg_io_v3.c b/sg_io_v3.c index 47d847d4..ec8a6ae0 100644 --- a/sg_io_v3.c +++ b/sg_io_v3.c @@ -31,7 +31,17 @@ #ifdef HAVE_SCSI_SG_H +#include DEF_MPERS_TYPE(struct_sg_io_hdr) + # include + +typedef struct sg_io_hdr struct_sg_io_hdr; + +#endif /* HAVE_SCSI_SG_H */ + +#include MPERS_DEFS + +#ifdef HAVE_SCSI_SG_H # include "xlat/sg_io_dxfer_direction.h" static void @@ -44,9 +54,9 @@ print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr, static int decode_request(struct tcb *const tcp, const kernel_ulong_t arg) { - struct sg_io_hdr sg_io; + struct_sg_io_hdr sg_io; static const size_t skip_iid = - offsetof(struct sg_io_hdr, dxfer_direction); + offsetof(struct_sg_io_hdr, dxfer_direction); tprints("{interface_id='S', "); if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid, @@ -84,7 +94,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg) static int decode_response(struct tcb *const tcp, const kernel_ulong_t arg) { - struct sg_io_hdr sg_io; + struct_sg_io_hdr sg_io; if (umove(tcp, arg, &sg_io) < 0) { tprints(", ???"); @@ -142,8 +152,8 @@ decode_response(struct tcb *const tcp, const kernel_ulong_t arg) #endif -int -decode_sg_io_v3(struct tcb *const tcp, const kernel_ulong_t arg) +MPERS_PRINTER_DECL(int, decode_sg_io_v3, + struct tcb *const tcp, const kernel_ulong_t arg) { return entering(tcp) ? decode_request(tcp, arg) : decode_response(tcp, arg);