static inline bool CFS_FAIL_PRECHECK(__u32 id)
{
- return cfs_fail_loc != 0 &&
+ return unlikely(cfs_fail_loc != 0 &&
((cfs_fail_loc & CFS_FAIL_MASK_LOC) == (id & CFS_FAIL_MASK_LOC) ||
- (cfs_fail_loc & id & CFS_FAULT));
+ (cfs_fail_loc & id & CFS_FAULT)));
}
#define UNLIKELY_CHECK_SET(id, value, set, quiet) \
unsigned long failed_once = cfs_fail_loc & CFS_FAILED; /* ok if racy */
int ret = 0;
- if (unlikely(CFS_FAIL_PRECHECK(id) &&
- (ret = __cfs_fail_check_set(id, value, set)))) {
+ if (CFS_FAIL_PRECHECK(id) &&
+ (ret = __cfs_fail_check_set(id, value, set))) {
if (quiet && failed_once) {
CDEBUG(D_INFO, "*** cfs_fail_loc=%x, val=%u***\n",
id, value);
static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set)
{
- if (unlikely(CFS_FAIL_PRECHECK(id)))
+ if (CFS_FAIL_PRECHECK(id))
return __cfs_fail_timeout_set(id, value, ms, set);
else
return 0;
/* PLEASE, KEEP NUMBERS UP TO 0x3000 RESERVED FOR OBD_FAIL_MDS_* */
-/* LNet is allocated failure locations 0xe000 to 0xffff */
-/* Assign references to moved code to reduce code changes */
-#define OBD_FAIL_PRECHECK(id) (unlikely(CFS_FAIL_PRECHECK(id)))
-#define OBD_FAIL_CHECK(id) CFS_FAIL_CHECK(id)
-#define OBD_FAIL_CHECK_QUIET(id) CFS_FAIL_CHECK_QUIET(id)
-#define OBD_FAIL_CHECK_VALUE(id, value) CFS_FAIL_CHECK_VALUE(id, value)
-#define OBD_FAIL_CHECK_ORSET(id, value) CFS_FAIL_CHECK_ORSET(id, value)
-#define OBD_FAIL_CHECK_RESET(id, value) CFS_FAIL_CHECK_RESET(id, value)
-#define OBD_FAIL_RETURN(id, ret) CFS_FAIL_RETURN(id, ret)
-#define OBD_FAIL_TIMEOUT(id, secs) CFS_FAIL_TIMEOUT(id, secs)
-#define OBD_FAIL_TIMEOUT_MS(id, ms) CFS_FAIL_TIMEOUT_MS(id, ms)
-#define OBD_FAIL_TIMEOUT_ORSET(id, value, secs) CFS_FAIL_TIMEOUT_ORSET(id, value, secs)
-#define OBD_RACE(id) CFS_RACE(id)
-#define OBD_FAIL_ONCE CFS_FAIL_ONCE
-#define OBD_FAILED CFS_FAILED
-
#define LUT_FAIL_CLASS(fail_id) (((fail_id) >> 8) << 16)
#define LUT_FAIL_MGT LUT_FAIL_CLASS(OBD_FAIL_MGS)
#define LUT_FAIL_MDT LUT_FAIL_CLASS(OBD_FAIL_MDS)