diff mbox series

xfsdump: fix compiling errors due to typedef removal in xfsprogs

Message ID 20190826050130.eqzxbotjlblckmgu@XZHOUW.usersys.redhat.com (mailing list archive)
State Deferred, archived
Headers show
Series xfsdump: fix compiling errors due to typedef removal in xfsprogs | expand

Commit Message

Murphy Zhou Aug. 26, 2019, 5:01 a.m. UTC
Since xfsprogs commit
  32dd7d9c xfs: remove various bulk request typedef usage

Some typedef _t types have been removed, so did in header files.

Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
---
 common/fs.c     | 2 +-
 common/hsmapi.c | 1 +
 common/util.h   | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

Comments

Christoph Hellwig Aug. 26, 2019, 9:52 a.m. UTC | #1
On Mon, Aug 26, 2019 at 01:01:30PM +0800, Murphy Zhou wrote:
> Since xfsprogs commit
>   32dd7d9c xfs: remove various bulk request typedef usage
> 
> Some typedef _t types have been removed, so did in header files.

I wonder if we need to add them back to xfsprogs to not break other
tools using the header.  But independent of that I think killing
them in xfsdump is good.

>  typedef char *(*gwbfp_t)(void *contextp, size_t wantedsz, size_t *szp);
>  typedef int (*wfp_t)(void *contextp, char *bufp, size_t bufsz);
> +typedef struct xfs_bstat xfs_bstat_t;
> +typedef struct xfs_inogrp xfs_inogrp_t;
> +typedef struct xfs_fsop_bulkreq xfs_fsop_bulkreq_t;

I think we just need to stop using the typedefs, as this would break
a compile with the old xfsprogs headers.
Murphy Zhou Aug. 26, 2019, 10:23 a.m. UTC | #2
On Mon, Aug 26, 2019 at 02:52:53AM -0700, Christoph Hellwig wrote:
> On Mon, Aug 26, 2019 at 01:01:30PM +0800, Murphy Zhou wrote:
> > Since xfsprogs commit
> >   32dd7d9c xfs: remove various bulk request typedef usage
> > 
> > Some typedef _t types have been removed, so did in header files.
> 
> I wonder if we need to add them back to xfsprogs to not break other
> tools using the header.  But independent of that I think killing
> them in xfsdump is good.
> 
> >  typedef char *(*gwbfp_t)(void *contextp, size_t wantedsz, size_t *szp);
> >  typedef int (*wfp_t)(void *contextp, char *bufp, size_t bufsz);
> > +typedef struct xfs_bstat xfs_bstat_t;
> > +typedef struct xfs_inogrp xfs_inogrp_t;
> > +typedef struct xfs_fsop_bulkreq xfs_fsop_bulkreq_t;
> 
> I think we just need to stop using the typedefs, as this would break
> a compile with the old xfsprogs headers.

So we need to add typedefs back to xfsprogs to not breaking others.
And kill it in xfsdump.

Are there tools using xfsdump's libs and headers ? Breaking them?

Thanks,
m
diff mbox series

Patch

diff --git a/common/fs.c b/common/fs.c
index a4c175c..ff8c75a 100644
--- a/common/fs.c
+++ b/common/fs.c
@@ -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);
diff --git a/common/hsmapi.c b/common/hsmapi.c
index e3e18a7..0771895 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -36,6 +36,7 @@ 
 #include "types.h"
 #include "hsmapi.h"
 #include "mlog.h"
+#include "util.h"
 
 /* This version of the HSM API supports the DMF attribute used in the initial
  * DMF release, as well as the attribute used in the pseudo multiple managed
diff --git a/common/util.h b/common/util.h
index 9a1729c..f43461f 100644
--- a/common/util.h
+++ b/common/util.h
@@ -34,6 +34,9 @@ 
  */
 typedef char *(*gwbfp_t)(void *contextp, size_t wantedsz, size_t *szp);
 typedef int (*wfp_t)(void *contextp, char *bufp, size_t bufsz);
+typedef struct xfs_bstat xfs_bstat_t;
+typedef struct xfs_inogrp xfs_inogrp_t;
+typedef struct xfs_fsop_bulkreq xfs_fsop_bulkreq_t;
 
 extern int write_buf(char *bufp,
 			   size_t bufsz,