diff mbox series

[01/61] mkfs: move mkfs/proto.c declarations to mkfs/proto.h

Message ID 163174720034.350433.11964220787370567480.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfs: sync libxfs with 5.14 | expand

Commit Message

Darrick J. Wong Sept. 15, 2021, 11:06 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

These functions are only used by mkfs, so move them to a separate header
file that isn't in an internal library.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 include/xfs_multidisk.h |    5 -----
 mkfs/proto.c            |    1 +
 mkfs/proto.h            |   13 +++++++++++++
 mkfs/xfs_mkfs.c         |    1 +
 4 files changed, 15 insertions(+), 5 deletions(-)
 create mode 100644 mkfs/proto.h

Comments

Christoph Hellwig Sept. 16, 2021, 7:24 a.m. UTC | #1
> +extern char *setup_proto (char *fname);
> +extern void parse_proto (xfs_mount_t *mp, struct fsxattr *fsx, char **pp);
> +extern void res_failed (int err);

It might be worth to drop the externs, the spaces before the opening
braces and the xfs_mount_t typedef usage while you're at it.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/include/xfs_multidisk.h b/include/xfs_multidisk.h
index abfb50ce..a16a9fe2 100644
--- a/include/xfs_multidisk.h
+++ b/include/xfs_multidisk.h
@@ -42,9 +42,4 @@ 
 #define XFS_NOMULTIDISK_AGLOG		2	/* 4 AGs */
 #define XFS_MULTIDISK_AGCOUNT		(1 << XFS_MULTIDISK_AGLOG)
 
-/* proto.c */
-extern char *setup_proto (char *fname);
-extern void parse_proto (xfs_mount_t *mp, struct fsxattr *fsx, char **pp);
-extern void res_failed (int err);
-
 #endif	/* __XFS_MULTIDISK_H__ */
diff --git a/mkfs/proto.c b/mkfs/proto.c
index 6b22cc6a..ef130ed6 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -7,6 +7,7 @@ 
 #include "libxfs.h"
 #include <sys/stat.h>
 #include "libfrog/convert.h"
+#include "proto.h"
 
 /*
  * Prototypes for internal functions.
diff --git a/mkfs/proto.h b/mkfs/proto.h
new file mode 100644
index 00000000..9ccbddf6
--- /dev/null
+++ b/mkfs/proto.h
@@ -0,0 +1,13 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2000-2001,2004-2005 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ */
+#ifndef MKFS_PROTO_H_
+#define MKFS_PROTO_H_
+
+extern char *setup_proto (char *fname);
+extern void parse_proto (xfs_mount_t *mp, struct fsxattr *fsx, char **pp);
+extern void res_failed (int err);
+
+#endif /* MKFS_PROTO_H_ */
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 9c14c04e..16e347e5 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -11,6 +11,7 @@ 
 #include "libfrog/fsgeom.h"
 #include "libfrog/topology.h"
 #include "libfrog/convert.h"
+#include "proto.h"
 #include <ini.h>
 
 #define TERABYTES(count, blog)	((uint64_t)(count) << (40 - (blog)))