linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] libfrog: various small fixes
@ 2019-12-18 23:14 Darrick J. Wong
  2019-12-18 23:14 ` [PATCH 1/2] libfrog: remove libxfs.h dependencies in fsgeom.c and linux.c Darrick J. Wong
  2019-12-18 23:14 ` [PATCH 2/2] libfrog: move topology.[ch] to libxfs Darrick J. Wong
  0 siblings, 2 replies; 9+ messages in thread
From: Darrick J. Wong @ 2019-12-18 23:14 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

Hi all,

Clean up a few weird things in libfrog, like the topology code actually
needing to be in libxfs, and clean up a few source files that pull in
headers from libxfs even though they shouldn't.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=libfrog-fixes

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] libfrog: remove libxfs.h dependencies in fsgeom.c and linux.c
  2019-12-18 23:14 [PATCH 0/2] libfrog: various small fixes Darrick J. Wong
@ 2019-12-18 23:14 ` Darrick J. Wong
  2019-12-18 23:16   ` Eric Sandeen
  2019-12-18 23:14 ` [PATCH 2/2] libfrog: move topology.[ch] to libxfs Darrick J. Wong
  1 sibling, 1 reply; 9+ messages in thread
From: Darrick J. Wong @ 2019-12-18 23:14 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

libfrog isn't supposed to depend on libxfs, so don't include the header
file in the libfrog source code.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libfrog/fsgeom.c |    4 +++-
 libfrog/linux.c  |    4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)


diff --git a/libfrog/fsgeom.c b/libfrog/fsgeom.c
index 19a4911f..bd93924e 100644
--- a/libfrog/fsgeom.c
+++ b/libfrog/fsgeom.c
@@ -2,7 +2,9 @@
 /*
  * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
  */
-#include "libxfs.h"
+#include "platform_defs.h"
+#include "xfs.h"
+#include "bitops.h"
 #include "fsgeom.h"
 #include "util.h"
 
diff --git a/libfrog/linux.c b/libfrog/linux.c
index 79bd79eb..41a168b4 100644
--- a/libfrog/linux.c
+++ b/libfrog/linux.c
@@ -9,8 +9,8 @@
 #include <sys/ioctl.h>
 #include <sys/sysinfo.h>
 
-#include "libxfs_priv.h"
-#include "xfs_fs.h"
+#include "platform_defs.h"
+#include "xfs.h"
 #include "init.h"
 
 extern char *progname;


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] libfrog: move topology.[ch] to libxfs
  2019-12-18 23:14 [PATCH 0/2] libfrog: various small fixes Darrick J. Wong
  2019-12-18 23:14 ` [PATCH 1/2] libfrog: remove libxfs.h dependencies in fsgeom.c and linux.c Darrick J. Wong
@ 2019-12-18 23:14 ` Darrick J. Wong
  2019-12-18 23:26   ` Eric Sandeen
  1 sibling, 1 reply; 9+ messages in thread
From: Darrick J. Wong @ 2019-12-18 23:14 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

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%)


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)
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] libfrog: remove libxfs.h dependencies in fsgeom.c and linux.c
  2019-12-18 23:14 ` [PATCH 1/2] libfrog: remove libxfs.h dependencies in fsgeom.c and linux.c Darrick J. Wong
@ 2019-12-18 23:16   ` Eric Sandeen
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2019-12-18 23:16 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

On 12/18/19 5:14 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> libfrog isn't supposed to depend on libxfs, so don't include the header
> file in the libfrog source code.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

swizzle all the headers

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] libfrog: move topology.[ch] to libxfs
  2019-12-18 23:14 ` [PATCH 2/2] libfrog: move topology.[ch] to libxfs Darrick J. Wong
@ 2019-12-18 23:26   ` Eric Sandeen
  2019-12-19  0:12     ` Darrick J. Wong
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Sandeen @ 2019-12-18 23:26 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] libfrog: move topology.[ch] to libxfs
  2019-12-18 23:26   ` Eric Sandeen
@ 2019-12-19  0:12     ` Darrick J. Wong
  2019-12-19  1:04       ` Eric Sandeen
  0 siblings, 1 reply; 9+ messages in thread
From: Darrick J. Wong @ 2019-12-19  0:12 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] libfrog: move topology.[ch] to libxfs
  2019-12-19  0:12     ` Darrick J. Wong
@ 2019-12-19  1:04       ` Eric Sandeen
  2020-02-25 19:40         ` Darrick J. Wong
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Sandeen @ 2019-12-19  1:04 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] libfrog: move topology.[ch] to libxfs
  2019-12-19  1:04       ` Eric Sandeen
@ 2020-02-25 19:40         ` Darrick J. Wong
  2020-02-26 16:55           ` Christoph Hellwig
  0 siblings, 1 reply; 9+ messages in thread
From: Darrick J. Wong @ 2020-02-25 19:40 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Wed, Dec 18, 2019 at 07:04:32PM -0600, Eric Sandeen wrote:
> 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.

OTOH, not having it is now getting in the way of me being able to turn
XFS_BUF_SET_PRIORITY into a static inline function because the priority
functions reference libxfs_bcache, which ofc only exists in libxfs.  We
have gotten away with this because the preprocessor doesn't care, but
the compiler will.

--D

> -Eric

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] libfrog: move topology.[ch] to libxfs
  2020-02-25 19:40         ` Darrick J. Wong
@ 2020-02-26 16:55           ` Christoph Hellwig
  0 siblings, 0 replies; 9+ messages in thread
From: Christoph Hellwig @ 2020-02-26 16:55 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Feb 25, 2020 at 11:40:10AM -0800, Darrick J. Wong wrote:
> On Wed, Dec 18, 2019 at 07:04:32PM -0600, Eric Sandeen wrote:
> > 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.
> 
> OTOH, not having it is now getting in the way of me being able to turn
> XFS_BUF_SET_PRIORITY into a static inline function because the priority
> functions reference libxfs_bcache, which ofc only exists in libxfs.  We
> have gotten away with this because the preprocessor doesn't care, but
> the compiler will.

Feel free to drop the suggestion to turn XFS_BUF_SET_PRIORITY into
an inline function for now.  It is nice to have but not important
enough to block other work.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-26 16:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 23:14 [PATCH 0/2] libfrog: various small fixes Darrick J. Wong
2019-12-18 23:14 ` [PATCH 1/2] libfrog: remove libxfs.h dependencies in fsgeom.c and linux.c Darrick J. Wong
2019-12-18 23:16   ` Eric Sandeen
2019-12-18 23:14 ` [PATCH 2/2] libfrog: move topology.[ch] to libxfs Darrick J. Wong
2019-12-18 23:26   ` Eric Sandeen
2019-12-19  0:12     ` Darrick J. Wong
2019-12-19  1:04       ` Eric Sandeen
2020-02-25 19:40         ` Darrick J. Wong
2020-02-26 16:55           ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).