Skip to content
Snippets Groups Projects
  • Henri Doreau's avatar
    1d40214d
    LU-7659 mdc: expose changelog through char devices · 1d40214d
    Henri Doreau authored
    
    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: default avatarHenri Doreau <henri.doreau@cea.fr>
    Change-Id: I14709fdbac76b5512e58099e4e536cf9c973868c
    Reviewed-on: https://review.whamcloud.com/18900
    
    
    Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
    Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
    Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
    1d40214d
    History
    LU-7659 mdc: expose changelog through char devices
    Henri Doreau authored
    
    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: default avatarHenri Doreau <henri.doreau@cea.fr>
    Change-Id: I14709fdbac76b5512e58099e4e536cf9c973868c
    Reviewed-on: https://review.whamcloud.com/18900
    
    
    Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
    Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
    Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>