Skip to content

Commit

Permalink
Move platform dependent errno aliases
Browse files Browse the repository at this point in the history
EBADE, EBADR, and ENOANO do not exist on FreeBSD

The libspl errno.h is similarly platform dependent.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes openzfs#9498
  • Loading branch information
mattmacy authored and behlendorf committed Oct 25, 2019
1 parent 68a1b15 commit 1952fe0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
10 changes: 10 additions & 0 deletions include/os/linux/spl/sys/errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,14 @@

#define ENOTSUP EOPNOTSUPP

/*
* We'll take the unused errnos, 'EBADE' and 'EBADR' (from the Convergent
* graveyard) to indicate checksum errors and fragmentation.
*/
#define ECKSUM EBADE
#define EFRAGS EBADR

/* Similar for ENOACTIVE */
#define ENOTACTIVE ENOANO

#endif /* _SYS_ERRNO_H */
10 changes: 0 additions & 10 deletions include/sys/zio.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,6 @@ enum zio_wait_type {
ZIO_WAIT_TYPES
};

/*
* We'll take the unused errnos, 'EBADE' and 'EBADR' (from the Convergent
* graveyard) to indicate checksum errors and fragmentation.
*/
#define ECKSUM EBADE
#define EFRAGS EBADR

/* Similar for ENOACTIVE */
#define ENOTACTIVE ENOANO

typedef void zio_done_func_t(zio_t *zio);

extern int zio_dva_throttle_enabled;
Expand Down
1 change: 1 addition & 0 deletions lib/libspl/include/os/linux/sys/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
libspldir = $(includedir)/libspl/sys
libspl_HEADERS = \
$(top_srcdir)/lib/libspl/include/os/linux/sys/byteorder.h \
$(top_srcdir)/lib/libspl/include/os/linux/sys/errno.h \
$(top_srcdir)/lib/libspl/include/os/linux/sys/file.h \
$(top_srcdir)/lib/libspl/include/os/linux/sys/mnttab.h \
$(top_srcdir)/lib/libspl/include/os/linux/sys/mount.h \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,16 @@
*/
#ifndef _LIBSPL_SYS_ERRNO_H
#define _LIBSPL_SYS_ERRNO_H

#include <errno.h>
/*
* We'll take the unused errnos, 'EBADE' and 'EBADR' (from the Convergent
* graveyard) to indicate checksum errors and fragmentation.
*/
#define ECKSUM EBADE
#define EFRAGS EBADR

/* Similar for ENOACTIVE */
#define ENOTACTIVE ENOANO

#endif /* _LIBSPL_SYS_ERRNO_H */
1 change: 0 additions & 1 deletion lib/libspl/include/sys/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ libspl_HEADERS = \
$(top_srcdir)/lib/libspl/include/sys/debug.h \
$(top_srcdir)/lib/libspl/include/sys/dkio.h \
$(top_srcdir)/lib/libspl/include/sys/dklabel.h \
$(top_srcdir)/lib/libspl/include/sys/errno.h \
$(top_srcdir)/lib/libspl/include/sys/feature_tests.h \
$(top_srcdir)/lib/libspl/include/sys/int_limits.h \
$(top_srcdir)/lib/libspl/include/sys/int_types.h \
Expand Down

0 comments on commit 1952fe0

Please sign in to comment.