Make print_uint64 from btrfs.c globally available
And rename it to print_uint64_array_member to make the name sensible without additional context. * defs.h (print_uint64_array_member): New function prototype. * btrfs.c (print_uint64): Move... * util.c (print_uint64_array_member): ...here, drop "static" qualifier.
This commit is contained in:
parent
1aee6198c7
commit
459ea39686
10
btrfs.c
10
btrfs.c
@ -366,14 +366,6 @@ btrfs_print_ino_path_container(struct tcb *tcp,
|
||||
btrfs_print_data_container_footer();
|
||||
}
|
||||
|
||||
static bool
|
||||
print_uint64(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
|
||||
{
|
||||
tprintf("%" PRIu64, *(uint64_t *) elem_buf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ulong_t qgi_addr)
|
||||
{
|
||||
@ -400,7 +392,7 @@ btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ulong_t qgi_addr)
|
||||
uint64_t record;
|
||||
print_array(tcp, qgi_addr + offsetof(typeof(inherit), qgroups),
|
||||
inherit.num_qgroups, &record, sizeof(record),
|
||||
umoven_or_printaddr, print_uint64, 0);
|
||||
umoven_or_printaddr, print_uint64_array_member, 0);
|
||||
}
|
||||
tprints("}");
|
||||
}
|
||||
|
2
defs.h
2
defs.h
@ -493,6 +493,8 @@ umovestr(struct tcb *, kernel_ulong_t addr, unsigned int len, char *laddr);
|
||||
extern int upeek(struct tcb *tcp, unsigned long, kernel_ulong_t *);
|
||||
extern int upoke(struct tcb *tcp, unsigned long, kernel_ulong_t);
|
||||
|
||||
extern bool print_uint64_array_member(struct tcb *tcp, void *elem_buf,
|
||||
size_t elem_size, void *data);
|
||||
extern bool
|
||||
print_array(struct tcb *,
|
||||
kernel_ulong_t start_addr,
|
||||
|
9
util.c
9
util.c
@ -1008,6 +1008,15 @@ umoven_or_printaddr64_ignore_syserror(struct tcb *const tcp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
print_uint64_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
|
||||
void *data)
|
||||
{
|
||||
tprintf("%" PRIu64, *(uint64_t *) elem_buf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Iteratively fetch and print up to nmemb elements of elem_size size
|
||||
* from the array that starts at tracee's address start_addr.
|
||||
|
Loading…
x
Reference in New Issue
Block a user