size_t elem_size, void *data)
{
const struct file_dedupe_range_info *info = elem_buf;
+ unsigned int *count = data;
+
+ if (count) {
+ if (*count == 0) {
+ tprints("...");
+ return false;
+ }
+ --*count;
+ }
if (entering(tcp)) {
- tprintf("{dest_fd=%" PRIi64
- ", dest_offset=%" PRIu64 "}",
- (int64_t) info->dest_fd,
+ tprints("{dest_fd=");
+ printfd(tcp, info->dest_fd);
+ tprintf(", dest_offset=%" PRIu64 "}",
(uint64_t) info->dest_offset);
} else {
tprintf("{bytes_deduped=%" PRIu64 ", status=%d}",
#endif /* HAVE_LINUX_FIEMAP_H */
int
-file_ioctl(struct tcb *tcp, const unsigned int code, const long arg)
+file_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
{
switch (code) {
case FICLONE: /* W */
if (umove_or_printaddr(tcp, arg, &args))
break;
- tprintf("{src_fd=%" PRIi64
- ", src_offset=%" PRIu64
+ tprints("{src_fd=");
+ printfd(tcp, args.src_fd);
+ tprintf(", src_offset=%" PRIu64
", src_length=%" PRIu64
", dest_offset=%" PRIu64 "}",
- (int64_t) args.src_fd,
(uint64_t) args.src_offset,
(uint64_t) args.src_length,
(uint64_t) args.dest_offset);
case FIDEDUPERANGE: { /* RW */
struct file_dedupe_range args;
+ struct file_dedupe_range_info info;
+ unsigned int *limit = NULL;
+ unsigned int count = 2;
+ bool rc;
if (entering(tcp))
tprints(", ");
(uint16_t) args.dest_count);
}
- bool rc = false;
tprints("info=");
- if (abbrev(tcp)) {
- tprints("...");
- } else {
- struct file_dedupe_range_info info;
- rc = print_array(tcp,
- arg + offsetof(typeof(args), info),
- args.dest_count,
- &info, sizeof(info),
- umoven_or_printaddr,
- print_file_dedupe_range_info, 0);
- }
+
+ /* Limit how many elements we print in abbrev mode. */
+ if (abbrev(tcp) && args.dest_count > count)
+ limit = &count;
+
+ rc = print_array(tcp, arg + offsetof(typeof(args), info),
+ args.dest_count, &info, sizeof(info),
+ umoven_or_printaddr,
+ print_file_dedupe_range_info, limit);
tprints("}");
if (!rc || exiting(tcp))