Skip to content

Commit ff7d051

Browse files
robnkusumi
andauthored
Fix compile-time warnings caused by duplicate struct typedefs (#16880)
Some compiler/versions warn these typedefs according to #16660. The platform specific header sys/abd_os.h shouldn't define or use abd_t, as it's defined in its non-platform specific consumer sys/abd.h. Do the same as what FreeBSD header does. Original-patch-by: Tomohiro Kusumi <[email protected]> Signed-off-by: Rob Norris <[email protected]> (cherry picked from commit a9851ea) Co-authored-by: Tomohiro Kusumi <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]>
1 parent 5c51f8f commit ff7d051

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

include/os/linux/spl/sys/taskq.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <sys/thread.h>
3434
#include <sys/rwlock.h>
3535
#include <sys/wait.h>
36+
#include <sys/kstat.h>
3637

3738
#define TASKQ_NAMELEN 31
3839

include/os/linux/zfs/sys/abd_os.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
extern "C" {
3131
#endif
3232

33+
struct abd;
34+
3335
struct abd_scatter {
3436
uint_t abd_offset;
3537
uint_t abd_nents;
@@ -41,19 +43,17 @@ struct abd_linear {
4143
struct scatterlist *abd_sgl; /* for LINEAR_PAGE */
4244
};
4345

44-
typedef struct abd abd_t;
45-
4646
typedef int abd_iter_page_func_t(struct page *, size_t, size_t, void *);
47-
int abd_iterate_page_func(abd_t *, size_t, size_t, abd_iter_page_func_t *,
47+
int abd_iterate_page_func(struct abd *, size_t, size_t, abd_iter_page_func_t *,
4848
void *);
4949

5050
/*
5151
* Linux ABD bio functions
5252
* Note: these are only needed to support vdev_classic. See comment in
5353
* vdev_disk.c.
5454
*/
55-
unsigned int abd_bio_map_off(struct bio *, abd_t *, unsigned int, size_t);
56-
unsigned long abd_nr_pages_off(abd_t *, unsigned int, size_t);
55+
unsigned int abd_bio_map_off(struct bio *, struct abd *, unsigned int, size_t);
56+
unsigned long abd_nr_pages_off(struct abd *, unsigned int, size_t);
5757

5858
#ifdef __cplusplus
5959
}

0 commit comments

Comments
 (0)