diff --git a/common/block.c b/common/block.c index e522ee4..0edc861 100644 --- a/common/block.c +++ b/common/block.c @@ -55,6 +55,9 @@ } } + if (blk->ops->flush) + return blk->ops->flush(blk); + return 0; } diff --git a/include/block.h b/include/block.h index 872a4c1..9137767 100644 --- a/include/block.h +++ b/include/block.h @@ -9,6 +9,7 @@ struct block_device_ops { int (*read)(struct block_device *, void *buf, int block, int num_blocks); int (*write)(struct block_device *, const void *buf, int block, int num_blocks); + int (*flush)(struct block_device *); }; struct chunk;