[2/2] libfrog: move topology.[ch] to libxfs
diff mbox series

Message ID 157671085471.190323.17808121856491080720.stgit@magnolia
State New
Headers show
Series
  • libfrog: various small fixes
Related show

Commit Message

Darrick J. Wong Dec. 18, 2019, 11:14 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

The functions in libfrog/topology.c rely on internal libxfs symbols and
functions, so move this file from libfrog to libxfs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libfrog/Makefile   |    2 --
 libxfs/Makefile    |    2 ++
 libxfs/topology.c  |    4 ++--
 libxfs/topology.h  |    6 +++---
 mkfs/xfs_mkfs.c    |    2 +-
 repair/sb.c        |    2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)
 rename libfrog/topology.c => libxfs/topology.c (99%)
 rename libfrog/topology.h => libxfs/topology.h (88%)

Comments

Eric Sandeen Dec. 18, 2019, 11:26 p.m. UTC | #1
On 12/18/19 5:14 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The functions in libfrog/topology.c rely on internal libxfs symbols and
> functions, so move this file from libfrog to libxfs.

None of this is used anywhere but mkfs & repair, and it's not really
part of libxfs per se (i.e. it shares nothing w/ kernel code).

It used to be in libxcmd.  Perhaps it should just be moved back?

-Eric
Darrick J. Wong Dec. 19, 2019, 12:12 a.m. UTC | #2
On Wed, Dec 18, 2019 at 05:26:44PM -0600, Eric Sandeen wrote:
> On 12/18/19 5:14 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > The functions in libfrog/topology.c rely on internal libxfs symbols and
> > functions, so move this file from libfrog to libxfs.
> 
> None of this is used anywhere but mkfs & repair, and it's not really
> part of libxfs per se (i.e. it shares nothing w/ kernel code).
> 
> It used to be in libxcmd.  Perhaps it should just be moved back?

But the whole point of getting it out of libxcmd was that it had nothing
to do with command processing.

I dunno, I kinda wonder if this should just be libxtopo or something.

--D

> -Eric
Eric Sandeen Dec. 19, 2019, 1:04 a.m. UTC | #3
On 12/18/19 6:12 PM, Darrick J. Wong wrote:
> On Wed, Dec 18, 2019 at 05:26:44PM -0600, Eric Sandeen wrote:
>> On 12/18/19 5:14 PM, Darrick J. Wong wrote:
>>> From: Darrick J. Wong <darrick.wong@oracle.com>
>>>
>>> The functions in libfrog/topology.c rely on internal libxfs symbols and
>>> functions, so move this file from libfrog to libxfs.
>>
>> None of this is used anywhere but mkfs & repair, and it's not really
>> part of libxfs per se (i.e. it shares nothing w/ kernel code).
>>
>> It used to be in libxcmd.  Perhaps it should just be moved back?
> 
> But the whole point of getting it out of libxcmd was that it had nothing
> to do with command processing.

Yeah I almost asked that.  ;)
 
> I dunno, I kinda wonder if this should just be libxtopo or something.

bleargh, not sure what it gains us to keep creating little internal libraries,
either.

I guess I don't really care, tbh.  Doesn't feel right to shove unrelated stuff
into libxfs/ though, when its main rationale is to share kernel code.

-Eric

Patch
diff mbox series

diff --git a/libfrog/Makefile b/libfrog/Makefile
index 780600cd..426fa15f 100644
--- a/libfrog/Makefile
+++ b/libfrog/Makefile
@@ -25,7 +25,6 @@  projects.c \
 ptvar.c \
 radix-tree.c \
 scrub.c \
-topology.c \
 util.c \
 workqueue.c
 
@@ -45,7 +44,6 @@  projects.h \
 ptvar.h \
 radix-tree.h \
 scrub.h \
-topology.h \
 workqueue.h
 
 LSRCFILES += gen_crc32table.c
diff --git a/libxfs/Makefile b/libxfs/Makefile
index 8c681e0b..c630a965 100644
--- a/libxfs/Makefile
+++ b/libxfs/Makefile
@@ -48,6 +48,7 @@  HFILES = \
 	libxfs_io.h \
 	libxfs_api_defs.h \
 	init.h \
+	topology.h \
 	libxfs_priv.h \
 	xfs_dir2_priv.h
 
@@ -58,6 +59,7 @@  CFILES = cache.c \
 	logitem.c \
 	rdwr.c \
 	trans.c \
+	topology.c \
 	util.c \
 	xfs_ag.c \
 	xfs_ag_resv.c \
diff --git a/libfrog/topology.c b/libxfs/topology.c
similarity index 99%
rename from libfrog/topology.c
rename to libxfs/topology.c
index b1b470c9..9aca1a2b 100644
--- a/libfrog/topology.c
+++ b/libxfs/topology.c
@@ -10,8 +10,8 @@ 
 #  include <blkid/blkid.h>
 #endif /* ENABLE_BLKID */
 #include "xfs_multidisk.h"
-#include "topology.h"
-#include "platform.h"
+#include "libxfs/topology.h"
+#include "libfrog/platform.h"
 
 #define TERABYTES(count, blog)	((uint64_t)(count) << (40 - (blog)))
 #define GIGABYTES(count, blog)	((uint64_t)(count) << (30 - (blog)))
diff --git a/libfrog/topology.h b/libxfs/topology.h
similarity index 88%
rename from libfrog/topology.h
rename to libxfs/topology.h
index 6fde868a..1a0fe24c 100644
--- a/libfrog/topology.h
+++ b/libxfs/topology.h
@@ -4,8 +4,8 @@ 
  * All Rights Reserved.
  */
 
-#ifndef __LIBFROG_TOPOLOGY_H__
-#define __LIBFROG_TOPOLOGY_H__
+#ifndef __LIBXFS_TOPOLOGY_H__
+#define __LIBXFS_TOPOLOGY_H__
 
 /*
  * Device topology information.
@@ -36,4 +36,4 @@  extern int
 check_overwrite(
 	const char	*device);
 
-#endif	/* __LIBFROG_TOPOLOGY_H__ */
+#endif	/* __LIBXFS_TOPOLOGY_H__ */
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 606f79da..784fe6a9 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -9,7 +9,7 @@ 
 #include "xfs_multidisk.h"
 #include "libxcmd.h"
 #include "libfrog/fsgeom.h"
-#include "libfrog/topology.h"
+#include "libxfs/topology.h"
 
 #define TERABYTES(count, blog)	((uint64_t)(count) << (40 - (blog)))
 #define GIGABYTES(count, blog)	((uint64_t)(count) << (30 - (blog)))
diff --git a/repair/sb.c b/repair/sb.c
index 91a36dd3..3054cef0 100644
--- a/repair/sb.c
+++ b/repair/sb.c
@@ -12,7 +12,7 @@ 
 #include "protos.h"
 #include "err_protos.h"
 #include "xfs_multidisk.h"
-#include "libfrog/topology.h"
+#include "libxfs/topology.h"
 
 #define BSIZE	(1024 * 1024)