Skip to contentSkip to conversation

xfsprogs: provide a few compatibility typedefs

PATCH Superseded Christoph Hellwig 3 participants 4 messages Aug 30, 2019 – Sep 2, 2019

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfsprogs: provide a few compatibility typedefs

Add back four typedefs that allow xfsdump to compile against the headers from the latests xfsprogs.

---
 include/xfs.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/xfs.h +9 -0
index f2f675df..35435b18 100644
@@ -37,4 +37,13 @@ extern int xfs_assert_largefile[sizeof(off_t)-8];
 #include <xfs/xfs_types.h>
 #include <xfs/xfs_fs.h>
 
+/*
+ * Backards compatibility for users of this header, now that the kernel
+ * removed these typedefs from xfs_fs.h.
+ */
+typedef struct xfs_bstat xfs_bstat_t;
+typedef struct xfs_fsop_bulkreq xfs_fsop_bulkreq_t;
+typedef struct xfs_fsop_geom_v1 xfs_fsop;
+typedef struct xfs_inogrp xfs_inogrp_t;
+
 #endif	/* __XFS_H__ */
Signature · 1 line
2.20.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Christoph Hellwig

Add back four typedefs that allow xfsdump to compile against the headers from the latests xfsprogs.

LGTM,

--D

Quoted 25 lines
---
 include/xfs.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/xfs.h +9 -0
index f2f675df..35435b18 100644
@@ -37,4 +37,13 @@ extern int xfs_assert_largefile[sizeof(off_t)-8];
 #include <xfs/xfs_types.h>
 #include <xfs/xfs_fs.h>
 
+/*
+ * Backards compatibility for users of this header, now that the kernel
+ * removed these typedefs from xfs_fs.h.
+ */
+typedef struct xfs_bstat xfs_bstat_t;
+typedef struct xfs_fsop_bulkreq xfs_fsop_bulkreq_t;
+typedef struct xfs_fsop_geom_v1 xfs_fsop;
+typedef struct xfs_inogrp xfs_inogrp_t;
+
 #endif	/* __XFS_H__ */
Signature · 1 line
2.20.1
#2 lore raw
In reply to Christoph Hellwig
Quoted 14 lines · Christoph Hellwig

Add back four typedefs that allow xfsdump to compile against the headers from the latests xfsprogs.

---
 include/xfs.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/xfs.h +0 -0
index f2f675df..35435b18 100644

include/xfs.h extern int xfs_assert_largefile[sizeof(off_t)-8]; · line 46

Quoted 10 lines
include/xfs.h +7 -0
@@ -37,4 +37,13 @@ extern int xfs_assert_largefile[sizeof(off_t)-8];
 #include <xfs/xfs_types.h>
 #include <xfs/xfs_fs.h>
 
+/*
+ * Backards compatibility for users of this header, now that the kernel
+ * removed these typedefs from xfs_fs.h.
+ */
+typedef struct xfs_bstat xfs_bstat_t;
+typedef struct xfs_fsop_bulkreq xfs_fsop_bulkreq_t;
+typedef struct xfs_fsop_geom_v1 xfs_fsop;

Still got build failure about this one.

Either change this line to:

+typedef struct xfs_fsop_geom_v1 xfs_fsop_geom_v1_t;

Or delete this line add this in xfsdump:

---

common/fs.c +1 -1
index a4c175c..ff8c75a 100644
@@ -204,7 +204,7 @@ fs_mounted(char *typs, char *chrs, char *mnts, uuid_t *idp)
 int
 fs_getid(char *mnts, uuid_t *idb)
 {
-	xfs_fsop_geom_v1_t geo;
+	struct xfs_fsop_geom_v1 geo;
 	int fd;
 
 	fd = open(mnts, O_RDONLY);

---

I prefer the later one since it's the only one, no need for a typedef.

Thanks,
Murphy

Quoted 6 lines
include/xfs.h +2 -0
+typedef struct xfs_inogrp xfs_inogrp_t;
+
 #endif	/* __XFS_H__ */
Signature · 1 line
2.20.1
#3 lore raw
Quoted 10 lines · Murphy Zhou

Review

Quoted 7 lines
(quoted diff) +7 -0
+/*
+ * Backards compatibility for users of this header, now that the kernel
+ * removed these typedefs from xfs_fs.h.
+ */
+typedef struct xfs_bstat xfs_bstat_t;
+typedef struct xfs_fsop_bulkreq xfs_fsop_bulkreq_t;
+typedef struct xfs_fsop_geom_v1 xfs_fsop;

Still got build failure about this one.

Quoted 3 lines

Either change this line to:

+typedef struct xfs_fsop_geom_v1 xfs_fsop_geom_v1_t;

Yes, that is correct. I'm obviously not competent enough to send userspace patches :)