From: John Groves <[email protected]>

This series adds famfs mode support to daxctl, alongside the existing
devdax and system-ram modes.  A daxdev is in famfs mode when it is bound
to fsdev_dax.ko (drivers/dax/fsdev.c).

Patch 1 adds the library plumbing: mode detection helpers, an enable
function, and the device.c reconfigure-device wiring.  Patch 2 adds a
test that exercises mode transitions.

This series depends on the fsdev_dax kernel driver (which provides famfs
mode) and on the famfs kernel patch series.

Patches:
  1/2 daxctl: Add support for famfs mode
  2/2 Add test/daxctl-famfs.sh to test famfs mode transitions

Changes since V4 (addressing Alison and Ira's comments):
- Consolidate the per-mode driver-symlink lookups into a single static
  helper daxctl_dev_bound_to_module(); the three mode predicates now
  delegate to it.
- Use PATH_MAX instead of a hardcoded char[200] in the mode-check path.
- Use path_basename() instead of basename().
- Emit a dbg() message when realpath() on the driver symlink returns
  NULL.
- Revert the json.c change that reported unbound devices as 'unknown'.
  An unbound device is reported as 'devdax' again, matching the prior
  behavior; the configured-vs-active distinction Alison raised goes
  away.
- Add missing fprintf(stderr) "disable failed" messages in the
  "already in target mode, just re-enable" branches of
  reconfig_mode_devdax() and reconfig_mode_famfs(), matching the
  pattern used by the disable_*_device() helpers.
- Reword commit messages: clarify that the test is in a separate
  patch, drop the stale "json.c shows 'unknown'" line, and replace
  "Fix mode transition logic" with "Update mode transition logic"
  since these are extensions for the new mode rather than fixes to
  broken existing behavior.

John Groves (2):
  daxctl: Add support for famfs mode
  Add test/daxctl-famfs.sh to test famfs mode transitions:

 daxctl/device.c                | 132 +++++++++++++++--
 daxctl/json.c                  |  13 +-
 daxctl/lib/libdaxctl-private.h |   2 +
 daxctl/lib/libdaxctl.c         |  39 ++++-
 daxctl/lib/libdaxctl.sym       |   7 +
 daxctl/libdaxctl.h             |   3 +
 test/daxctl-famfs.sh           | 253 +++++++++++++++++++++++++++++++++
 test/meson.build               |   2 +
 8 files changed, 436 insertions(+), 15 deletions(-)
 create mode 100755 test/daxctl-famfs.sh


base-commit: 8ad90e54f0ff4f7291e7f21d44d769d10f24e2b6
-- 
2.53.0


Reply via email to