9
0
Fork 0

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:
Sascha Hauer 2014-07-04 09:07:24 +02:00
parent 2e82822d08
commit 2d9d230089
2 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,9 @@ static int writebuffer_flush(struct block_device *blk)
}
}
if (blk->ops->flush)
return blk->ops->flush(blk);
return 0;
}

View File

@ -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;