block_session: extend interface with sync() call

To support components, which implement the block session's server side
rpc object, and which doesn't write data to their device backend immediately,
an additional synchronization call is needed. Thereby, clients like for
instance a file system can tell these components, when a synchronization is
required.

Ref #113
This commit is contained in:
Stefan Kalkowski
2013-11-22 13:55:05 +01:00
committed by Norman Feske
parent 44c7d64fb3
commit 50d73e7890
16 changed files with 41 additions and 2 deletions

View File

@ -35,7 +35,7 @@ namespace Partition {
Partition *partition(int num) { return (num < MAX_PARTITIONS) ? _part_list[num] : 0; }
size_t blk_size() { return _blk_size; }
inline unsigned long max_packets() { return (MAX_PACKET_SIZE / _blk_size); }
void sync() { _blk.sync(); }
/**
* Partition table entry format

View File

@ -137,6 +137,8 @@ namespace Block {
ops->set_operation(Packet_descriptor::WRITE);
}
void sync() { Partition::sync(); }
Partition::Partition *partition() { return _partition; }
};

View File

@ -72,6 +72,11 @@ namespace Partition {
* Returns block size of back end
*/
Genode::size_t blk_size();
/**
* Synchronize with backend device
*/
void sync();
}
#endif /* _PART_BLK_H_ */

View File

@ -173,6 +173,8 @@ namespace Block {
*blk_size = _block_size;
ops->set_operation(Block::Packet_descriptor::READ);
}
void sync() {}
};