Skip to content

Commit

Permalink
zfs: Use a statement expression to implement SET_ERROR()
Browse files Browse the repository at this point in the history
This way we can avoid making assumptions about the SDT probe
implementation.  No functional change intended.

This was submitted upstream as openzfs/zfs#16284

MFC after:	1 week
  • Loading branch information
markjdb committed Jun 19, 2024
1 parent bc29011 commit e5a7890
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@

#include_next <sys/sdt.h>
#ifdef KDTRACE_HOOKS
/* CSTYLED */
/* BEGIN CSTYLED */
SDT_PROBE_DECLARE(sdt, , , set__error);

#define SET_ERROR(err) \
((sdt_sdt___set__error->id ? \
(*sdt_probe_func)(sdt_sdt___set__error->id, \
(uintptr_t)err, 0, 0, 0, 0) : 0), err)
#define SET_ERROR(err) ({ \
SDT_PROBE1(sdt, , , set__error, (uintptr_t)err); \
err; \
})
/* END CSTYLED */
#else
#define SET_ERROR(err) (err)
#endif
Expand Down

0 comments on commit e5a7890

Please sign in to comment.