From: Darrick J. Wong <djwong@xxxxxxxxxx> The topology code depends on a few libxfs structures and is only needed by mkfs and xfs_repair. Move this code to libxfs to reduce the size of libfrog and to avoid build failures caused by "xfs: move perag structure and setup to libxfs/xfs_ag.[ch]". Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- include/libxfs.h | 1 + libfrog/Makefile | 2 -- libxfs/Makefile | 10 ++++++---- libxfs/topology.c | 5 ++--- libxfs/topology.h | 6 +++--- mkfs/xfs_mkfs.c | 1 - repair/sb.c | 1 - 7 files changed, 12 insertions(+), 14 deletions(-) rename libfrog/topology.c => libxfs/topology.c (99%) rename libfrog/topology.h => libxfs/topology.h (88%) diff --git a/include/libxfs.h b/include/libxfs.h index bc07655e..36ae86cc 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -213,5 +213,6 @@ int libxfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t); bool libxfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno); #include "xfs_attr.h" +#include "topology.h" #endif /* __LIBXFS_H__ */ diff --git a/libfrog/Makefile b/libfrog/Makefile index 395ce308..01107082 100644 --- a/libfrog/Makefile +++ b/libfrog/Makefile @@ -27,7 +27,6 @@ projects.c \ ptvar.c \ radix-tree.c \ scrub.c \ -topology.c \ util.c \ workqueue.c @@ -47,7 +46,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 de595b7c..3e3c4bd0 100644 --- a/libxfs/Makefile +++ b/libxfs/Makefile @@ -20,6 +20,11 @@ PKGHFILES = xfs_fs.h \ xfs_log_format.h HFILES = \ + libxfs_io.h \ + libxfs_api_defs.h \ + init.h \ + libxfs_priv.h \ + topology.h \ xfs_ag_resv.h \ xfs_alloc.h \ xfs_alloc_btree.h \ @@ -48,10 +53,6 @@ HFILES = \ xfs_shared.h \ xfs_trans_resv.h \ xfs_trans_space.h \ - libxfs_io.h \ - libxfs_api_defs.h \ - init.h \ - libxfs_priv.h \ xfs_dir2_priv.h CFILES = cache.c \ @@ -60,6 +61,7 @@ CFILES = cache.c \ kmem.c \ logitem.c \ rdwr.c \ + topology.c \ trans.c \ util.c \ xfs_ag.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..a17c1969 100644 --- a/libfrog/topology.c +++ b/libxfs/topology.c @@ -4,14 +4,13 @@ * All Rights Reserved. */ -#include "libxfs.h" +#include "libxfs_priv.h" #include "libxcmd.h" #ifdef ENABLE_BLKID # include <blkid/blkid.h> #endif /* ENABLE_BLKID */ #include "xfs_multidisk.h" -#include "topology.h" -#include "platform.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 16e347e5..53904677 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -9,7 +9,6 @@ #include "xfs_multidisk.h" #include "libxcmd.h" #include "libfrog/fsgeom.h" -#include "libfrog/topology.h" #include "libfrog/convert.h" #include "proto.h" #include <ini.h> diff --git a/repair/sb.c b/repair/sb.c index 17ce43cc..90f32e74 100644 --- a/repair/sb.c +++ b/repair/sb.c @@ -12,7 +12,6 @@ #include "protos.h" #include "err_protos.h" #include "xfs_multidisk.h" -#include "libfrog/topology.h" #define BSIZE (1024 * 1024)