f3probe/f3brew: add --reset-type=2

Reset type 2 does not reset, that is, it does nothing.
This parameter is only helpful to study the effects of cache on
the F3 algorithms.
This commit is contained in:
Michel Machado 2015-11-14 08:28:52 -05:00
parent 49c7d5fc63
commit 83a9c1c87d
3 changed files with 12 additions and 0 deletions

View File

@ -803,6 +803,12 @@ static int bdev_usb_reset(struct device *dev)
return 0;
}
static int bdev_none_reset(struct device *dev)
{
UNUSED(dev);
return 0;
}
static void bdev_free(struct device *dev)
{
struct block_device *bdev = dev_bdev(dev);
@ -915,6 +921,9 @@ struct device *create_block_device(const char *filename, enum reset_type rt)
case RT_USB:
bdev->dev.reset = bdev_usb_reset;
break;
case RT_NONE:
bdev->dev.reset = bdev_none_reset;
break;
default:
assert(0);
}

View File

@ -84,6 +84,7 @@ struct device *create_file_device(const char *filename,
enum reset_type {
RT_MANUAL_USB = 0,
RT_USB,
RT_NONE,
RT_MAX
};
#define RT_DEFAULT RT_MANUAL_USB

View File

@ -5,6 +5,8 @@
#include <argp.h> /* For struct argp_state. */
#include <sys/time.h> /* For struct timeval. */
#define UNUSED(x) ((void)x)
int ilog2(uint64_t x);
/* Least power of 2 greater than or equal to x. */