Whamcloud - gitweb
LU-7659 mdc: expose changelog through char devices
Register one character device per MDT in order to allow non-llapi to
read them and to make delivery more efficient.
- open() spawns a thread to prefetch records and enqueue them into a
local buffer (unless the device is open in write-only mode).
- lseek() can be used to jump to a specific record, in which case the
offset is a record number (with SEEK_SET) or a number of records to
skip (SEEK_CUR). Movement can only be done forward.
- read() copies records to userland. No truncation happens, so short
reads are likely.
- write() is used to transmit control commands to the device.
The only available one is changelog_clear, which is done by writing
"clear:cl<user>:<recno>" into the device.
- close() terminates the prefetch thread if any, and releases resources.
It is possible to poll() on the device to get notified when new records
are available for read.
Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Change-Id: I14709fdbac76b5512e58099e4e536cf9c973868c
Reviewed-on: https://review.whamcloud.com/18900
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
15 files changed: