Skip to content

Commit

Permalink
Return boolean_t in inline functions of lib/libspl/include/sys/uio.h
Browse files Browse the repository at this point in the history
The inline functions zfs_dio_offset_aligned(), zfs_dio_size_aligned() and
zfs_dio_aligned() are declared as boolean_t but return the bool type.

This fixes the build of FreeBSD zstd.

Signed-off-by: Martin Matuska <mm@FreeBSD.org>
  • Loading branch information
mmatuska committed Oct 7, 2024
1 parent e8f0aa1 commit 10110d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/libspl/include/sys/uio.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@ zfs_dio_page_aligned(void *buf)
static inline boolean_t
zfs_dio_offset_aligned(uint64_t offset, uint64_t blksz)
{
return (IS_P2ALIGNED(offset, blksz));
return ((IS_P2ALIGNED(offset, blksz)) ? B_TRUE : B_FALSE);
}

static inline boolean_t
zfs_dio_size_aligned(uint64_t size, uint64_t blksz)
{
return ((size % blksz) == 0);
return (((size % blksz) == 0) ? B_TRUE : B_FALSE);
}

static inline boolean_t
zfs_dio_aligned(uint64_t offset, uint64_t size, uint64_t blksz)
{
return (zfs_dio_offset_aligned(offset, blksz) &&
zfs_dio_size_aligned(size, blksz));
return ((zfs_dio_offset_aligned(offset, blksz) &&
zfs_dio_size_aligned(size, blksz)) ? B_TRUE : B_FALSE);
}

static inline void
Expand Down

0 comments on commit 10110d6

Please sign in to comment.