Merge branch 'master' of ssh://git.kernel.dk/data/git/fio
authorJens Axboe <axboe@fb.com>
Wed, 24 Sep 2014 14:21:47 +0000 (08:21 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 24 Sep 2014 14:21:47 +0000 (08:21 -0600)
t/dedupe.c

index e51e444e7b82f441d67d0d7dab9600dd09e3f081..7acb090a63e4a0a080f083b715a7c7d9df9ba3c2 100644 (file)
@@ -134,11 +134,18 @@ static int read_block(int fd, void *buf, off_t offset)
 
 static void add_item(struct chunk *c, struct item *i)
 {
-       struct extent *e;
+       /*      
+        * Save some memory and don't add extent items, if we don't
+        * use them.
+        */
+       if (dump_output || collision_check) {
+               struct extent *e;
+
+               e = malloc(sizeof(*e));
+               e->offset = i->offset;
+               flist_add_tail(&e->list, &c->extent_list);
+       }
 
-       e = malloc(sizeof(*e));
-       e->offset = i->offset;
-       flist_add_tail(&e->list, &c->extent_list);
        c->count++;
 }