Signed-off-by: Jens Axboe <axboe@kernel.dk>
unsigned int bytes, int rw, unsigned long long ttime,
int fileno, unsigned int bs)
{
unsigned int bytes, int rw, unsigned long long ttime,
int fileno, unsigned int bs)
{
- struct io_piece *ipo = malloc(sizeof(*ipo));
+ ipo = calloc(1, sizeof(*ipo));
init_ipo(ipo);
ipo->offset = offset * bs;
init_ipo(ipo);
ipo->offset = offset * bs;
unsigned long long ttime,
unsigned long *ios, unsigned int *rw_bs)
{
unsigned long long ttime,
unsigned long *ios, unsigned int *rw_bs)
{
- struct io_piece *ipo = malloc(sizeof(*ipo));
unsigned int bs;
int fileno;
unsigned int bs;
int fileno;
+ ipo = calloc(1, sizeof(*ipo));
init_ipo(ipo);
fileno = trace_add_file(td, t->device, &bs);
init_ipo(ipo);
fileno = trace_add_file(td, t->device, &bs);
struct fio_rb_node **p, *parent;
struct io_piece *ipo, *__ipo;
struct fio_rb_node **p, *parent;
struct io_piece *ipo, *__ipo;
- ipo = malloc(sizeof(struct io_piece));
+ ipo = calloc(1, sizeof(struct io_piece));
init_ipo(ipo);
ipo->file = io_u->file;
ipo->offset = io_u->offset;
init_ipo(ipo);
ipo->file = io_u->file;
ipo->offset = io_u->offset;
/*
* Make note of file
*/
/*
* Make note of file
*/
- ipo = malloc(sizeof(*ipo));
+ ipo = calloc(1, sizeof(*ipo));
init_ipo(ipo);
ipo->ddir = rw;
if (rw == DDIR_WAIT) {
init_ipo(ipo);
ipo->ddir = rw;
if (rw == DDIR_WAIT) {
static inline void init_ipo(struct io_piece *ipo)
{
static inline void init_ipo(struct io_piece *ipo)
{
- memset(ipo, 0, sizeof(*ipo));
+ INIT_FLIST_HEAD(&ipo->list);
INIT_FLIST_HEAD(&ipo->trim_list);
}
INIT_FLIST_HEAD(&ipo->trim_list);
}