diff mbox series

[2/6] mkfs: fix libxfs api misuse

Message ID 167657879922.3476911.12374504204515101304.stgit@magnolia (mailing list archive)
State Superseded
Headers show
Series xfsprogs: tool fixes for parent pointers | expand

Commit Message

Darrick J. Wong Feb. 16, 2023, 9:02 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Fix libxfs usage problems as pointed out by xfs/437.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 libxfs/libxfs_api_defs.h |    1 +
 mkfs/proto.c             |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h
index f8efcce7..e44b0b29 100644
--- a/libxfs/libxfs_api_defs.h
+++ b/libxfs/libxfs_api_defs.h
@@ -124,6 +124,7 @@ 
 #define xfs_initialize_perag		libxfs_initialize_perag
 #define xfs_initialize_perag_data	libxfs_initialize_perag_data
 #define xfs_init_local_fork		libxfs_init_local_fork
+#define xfs_init_parent_name_rec	libxfs_init_parent_name_rec
 
 #define xfs_inobt_maxrecs		libxfs_inobt_maxrecs
 #define xfs_inobt_stage_cursor		libxfs_inobt_stage_cursor
diff --git a/mkfs/proto.c b/mkfs/proto.c
index 36d8cde2..ac7ffbe9 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -613,8 +613,8 @@  parseproto(
 			.value = (void *)xname.name,
 			.valuelen = xname.len,
 		};
-		xfs_init_parent_name_rec(&rec, pip, offset);
-		error = xfs_attr_set(&args);
+		libxfs_init_parent_name_rec(&rec, pip, offset);
+		error = -libxfs_attr_set(&args);
 		if (error)
 			fail(_("Error creating parent pointer"), error);
 	}