block: Add flush callback
Some block devices need an explicit callback for flushing written blocks. Add this callback. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
2e82822d08
commit
2d9d230089
|
@ -55,6 +55,9 @@ static int writebuffer_flush(struct block_device *blk)
|
|||
}
|
||||
}
|
||||
|
||||
if (blk->ops->flush)
|
||||
return blk->ops->flush(blk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ struct block_device;
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue