diff options
author | Alexander Motin <mav@FreeBSD.org> | 2021-10-05 18:54:03 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2021-10-05 18:54:03 +0000 |
commit | 8f9be1eed11c27c66386c3d72cd6c6aef597fa0d (patch) | |
tree | a91e9060ef4d8492ea56cfd9f40bf0d1d9c1e619 /sys/cam/cam_ccb.h | |
parent | 7835b2cb4a1ae57f403739a2f1076ec7188f18c9 (diff) | |
download | src-8f9be1eed11c27c66386c3d72cd6c6aef597fa0d.tar.gz src-8f9be1eed11c27c66386c3d72cd6c6aef597fa0d.zip |
cam(4): Improve XPT_DEV_MATCH
Remove *_MATCH_NONE enums, making no sense and so never used. Make
*_MATCH_ANY enums 0 (no any match flags set), previously used by
*_MATCH_NONE. Bump CAM_VERSION to 0x1a reflecting those changes and
add compat shims.
When traversing through buses and devices do not descend if we can
already see that requested pattern does not match the bus or device.
It allows to save significant amount of time on system with thousands
of disks when doing limited searches.
Reviewed by: imp
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D32304
Diffstat (limited to 'sys/cam/cam_ccb.h')
-rw-r--r-- | sys/cam/cam_ccb.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 5b5e24904996..1ae310d399b7 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -422,13 +422,12 @@ struct ccb_getdevlist { }; typedef enum { - PERIPH_MATCH_NONE = 0x000, + PERIPH_MATCH_ANY = 0x000, PERIPH_MATCH_PATH = 0x001, PERIPH_MATCH_TARGET = 0x002, PERIPH_MATCH_LUN = 0x004, PERIPH_MATCH_NAME = 0x008, PERIPH_MATCH_UNIT = 0x010, - PERIPH_MATCH_ANY = 0x01f } periph_pattern_flags; struct periph_match_pattern { @@ -441,13 +440,12 @@ struct periph_match_pattern { }; typedef enum { - DEV_MATCH_NONE = 0x000, + DEV_MATCH_ANY = 0x000, DEV_MATCH_PATH = 0x001, DEV_MATCH_TARGET = 0x002, DEV_MATCH_LUN = 0x004, DEV_MATCH_INQUIRY = 0x008, DEV_MATCH_DEVID = 0x010, - DEV_MATCH_ANY = 0x00f } dev_pattern_flags; struct device_id_match_pattern { @@ -467,12 +465,11 @@ struct device_match_pattern { }; typedef enum { - BUS_MATCH_NONE = 0x000, + BUS_MATCH_ANY = 0x000, BUS_MATCH_PATH = 0x001, BUS_MATCH_NAME = 0x002, BUS_MATCH_UNIT = 0x004, BUS_MATCH_BUS_ID = 0x008, - BUS_MATCH_ANY = 0x00f } bus_pattern_flags; struct bus_match_pattern { @@ -594,7 +591,7 @@ struct ccb_dev_match { /* * Definitions for the path inquiry CCB fields. */ -#define CAM_VERSION 0x19 /* Hex value for current version */ +#define CAM_VERSION 0x1a /* Hex value for current version */ typedef enum { PI_MDP_ABLE = 0x80, /* Supports MDP message */ |