[rear-devel] [rear/rear] 5b345f: Update layout-functions.sh

Johannes Meixner noreply at github.com
Mon Nov 15 13:23:39 CET 2021


  Branch: refs/heads/master
  Home:   https://github.com/rear/rear
  Commit: 5b345fd8031655c7f7ce6d1fefa18fd3a2fd5290
      https://github.com/rear/rear/commit/5b345fd8031655c7f7ce6d1fefa18fd3a2fd5290
  Author: Johannes Meixner <jsmeix at suse.com>
  Date:   2021-11-11 (Thu, 11 Nov 2021)

  Changed paths:
    M usr/share/rear/lib/layout-functions.sh

  Log Message:
  -----------
  Update layout-functions.sh

Get 'multipath -l' out of the function is_multipath_path
by adding a separated function is_multipath_used
that runs 'multipath -l' (which is expensive because it scans all devices)
to check if multipath is used and remembers the result in MULTIPATH_IS_USED
that is used in subsequent calls of is_multipath_used (without calling 'multipath -l')
so we can call is_multipath_used many times in is_multipath_path,
cf. https://github.com/rear/rear/pull/2597 and
https://github.com/rear/rear/pull/2299/files#r709909416


  Commit: f5992c0337f068ac4600324a99d5c5f31f0e56e8
      https://github.com/rear/rear/commit/f5992c0337f068ac4600324a99d5c5f31f0e56e8
  Author: Johannes Meixner <jsmeix at suse.com>
  Date:   2021-11-15 (Mon, 15 Nov 2021)

  Changed paths:
    M usr/share/rear/lib/layout-functions.sh

  Log Message:
  -----------
  Merge pull request #2708 from rear/jsmeix-is_multipath_used

New function is_multipath_used in layout-functions.sh to
get 'multipath -l' out of the function is_multipath_path
by adding a separated function is_multipath_used
that runs 'multipath -l' (which is expensive because it scans all devices)
to check if multipath is used and remembers the result in MULTIPATH_IS_USED
that is used in subsequent calls of is_multipath_used (without calling 'multipath -l')
so we can call is_multipath_used many times via is_multipath_path which is
called in layout/save/GNU/Linux/200_partition_layout.sh for each disk device.
This should avoid long computing time when there are very may disk devices,
cf. https://github.com/rear/rear/pull/2597#issuecomment-814950019


Compare: https://github.com/rear/rear/compare/a99286947d36...f5992c0337f0


More information about the rear-devel mailing list