summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
443bb11)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
unsigned int nr_blocks; /* total blocks */
unsigned int next_non_full;
int fd; /* memory backing fd */
unsigned int nr_blocks; /* total blocks */
unsigned int next_non_full;
int fd; /* memory backing fd */
- char file[PATH_MAX]; /* filename for fd */
unsigned int mmap_size;
};
unsigned int mmap_size;
};
static int add_pool(struct pool *pool, unsigned int alloc_size)
{
static int add_pool(struct pool *pool, unsigned int alloc_size)
{
+ char file[] = "/tmp/.fio_smalloc.XXXXXX";
+ void *ptr;
- strcpy(pool->file, "/tmp/.fio_smalloc.XXXXXX");
- fd = mkstemp(pool->file);
if (fd < 0)
goto out_close;
if (fd < 0)
goto out_close;
* which happens both for cleanup or unexpected quit. This way we
* don't leave temp files around in case of a crash.
*/
* which happens both for cleanup or unexpected quit. This way we
* don't leave temp files around in case of a crash.
*/
fprintf(stderr, "smalloc: failed adding pool\n");
if (pool->map)
munmap(pool->map, pool->mmap_size);
fprintf(stderr, "smalloc: failed adding pool\n");
if (pool->map)
munmap(pool->map, pool->mmap_size);
- if (fd >= 0)
- close(fd);