Re: [RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-18 Thread Darrick J. Wong
On Mon, Jun 18, 2018 at 09:47:48PM -0700, Christoph Hellwig wrote:
> On Tue, Jun 19, 2018 at 02:05:23PM +1000, NeilBrown wrote:
> > From: NeilBrown 
> > Date: Tue, 19 Jun 2018 13:59:16 +1000
> > Subject: [PATCH] kbuild/xfs: example modobj-m conversion
> > 
> > This is a demonstration patch to show how
> > xfs can be changed to make use of the proposed modobj-m=
> > functionality, should the xfs developers want that.
> 
> Well, IFF we go with this new functionality I think everyone should
> be using it instead of the current hacks.
> 
> So text like the above should be in the series cover letter, and this
> patch should have an actual description..
> 
> I see no argument against these changes, but I've also added the XFS
> list.

Yes, please send the entire series to the xfs list in the future.

It looks like a reasonable reorganization of makefile goop. :)

(Will dig for the rest of the series on lkml tomorrow I guess.)

> > 
> > Signed-off-by: NeilBrown 
> > ---
> >  fs/xfs/Makefile| 78 
> > ++
> >  fs/xfs/libxfs/Makefile | 43 
> >  fs/xfs/scrub/Makefile  | 29 +++
> >  3 files changed, 74 insertions(+), 76 deletions(-)
> >  create mode 100644 fs/xfs/libxfs/Makefile
> >  create mode 100644 fs/xfs/scrub/Makefile
> > 
> > diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> > index 2f3f75a7f180..0ba854045fe9 100644
> > --- a/fs/xfs/Makefile
> > +++ b/fs/xfs/Makefile
> > @@ -15,47 +15,7 @@ obj-$(CONFIG_XFS_FS) += xfs.o
> >  xfs-y  += xfs_trace.o
> >  
> >  # build the libxfs code first
> > -xfs-y  += $(addprefix libxfs/, \
> > -  xfs_ag.o \
> > -  xfs_alloc.o \
> > -  xfs_alloc_btree.o \
> > -  xfs_attr.o \
> > -  xfs_attr_leaf.o \
> > -  xfs_attr_remote.o \
> > -  xfs_bit.o \
> > -  xfs_bmap.o \
> > -  xfs_bmap_btree.o \
> > -  xfs_btree.o \
> > -  xfs_da_btree.o \
> > -  xfs_da_format.o \
> > -  xfs_defer.o \
> > -  xfs_dir2.o \
> > -  xfs_dir2_block.o \
> > -  xfs_dir2_data.o \
> > -  xfs_dir2_leaf.o \
> > -  xfs_dir2_node.o \
> > -  xfs_dir2_sf.o \
> > -  xfs_dquot_buf.o \
> > -  xfs_ialloc.o \
> > -  xfs_ialloc_btree.o \
> > -  xfs_iext_tree.o \
> > -  xfs_inode_fork.o \
> > -  xfs_inode_buf.o \
> > -  xfs_log_rlimit.o \
> > -  xfs_ag_resv.o \
> > -  xfs_rmap.o \
> > -  xfs_rmap_btree.o \
> > -  xfs_refcount.o \
> > -  xfs_refcount_btree.o \
> > -  xfs_sb.o \
> > -  xfs_symlink_remote.o \
> > -  xfs_trans_resv.o \
> > -  xfs_types.o \
> > -  )
> > -# xfs_rtbitmap is shared with libxfs
> > -xfs-$(CONFIG_XFS_RT)   += $(addprefix libxfs/, \
> > -  xfs_rtbitmap.o \
> > -  )
> > +xfs-y  += libxfs/
> >  
> >  # highlevel code
> >  xfs-y  += xfs_aops.o \
> > @@ -127,38 +87,4 @@ xfs-$(CONFIG_SYSCTL)+= xfs_sysctl.o
> >  xfs-$(CONFIG_COMPAT)   += xfs_ioctl32.o
> >  xfs-$(CONFIG_EXPORTFS_BLOCK_OPS)   += xfs_pnfs.o
> >  
> > -# online scrub/repair
> > -ifeq ($(CONFIG_XFS_ONLINE_SCRUB),y)
> > -
> > -# Tracepoints like to blow up, so build that before everything else
> > -
> > -xfs-y  += $(addprefix scrub/, \
> > -  trace.o \
> > -  agheader.o \
> > -  alloc.o \
> > -  attr.o \
> > -  bmap.o \
> > -  btree.o \
> > -  common.o \
> > -  dabtree.o \
> > -  dir.o \
> > -  ialloc.o \
> > -  inode.o \
> > -  parent.o \
> > -  refcount.o \
> > -  rmap.o \
> > -  scrub.o \
> > -  

Re: [RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-18 Thread Darrick J. Wong
On Mon, Jun 18, 2018 at 09:47:48PM -0700, Christoph Hellwig wrote:
> On Tue, Jun 19, 2018 at 02:05:23PM +1000, NeilBrown wrote:
> > From: NeilBrown 
> > Date: Tue, 19 Jun 2018 13:59:16 +1000
> > Subject: [PATCH] kbuild/xfs: example modobj-m conversion
> > 
> > This is a demonstration patch to show how
> > xfs can be changed to make use of the proposed modobj-m=
> > functionality, should the xfs developers want that.
> 
> Well, IFF we go with this new functionality I think everyone should
> be using it instead of the current hacks.
> 
> So text like the above should be in the series cover letter, and this
> patch should have an actual description..
> 
> I see no argument against these changes, but I've also added the XFS
> list.

Yes, please send the entire series to the xfs list in the future.

It looks like a reasonable reorganization of makefile goop. :)

(Will dig for the rest of the series on lkml tomorrow I guess.)

> > 
> > Signed-off-by: NeilBrown 
> > ---
> >  fs/xfs/Makefile| 78 
> > ++
> >  fs/xfs/libxfs/Makefile | 43 
> >  fs/xfs/scrub/Makefile  | 29 +++
> >  3 files changed, 74 insertions(+), 76 deletions(-)
> >  create mode 100644 fs/xfs/libxfs/Makefile
> >  create mode 100644 fs/xfs/scrub/Makefile
> > 
> > diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> > index 2f3f75a7f180..0ba854045fe9 100644
> > --- a/fs/xfs/Makefile
> > +++ b/fs/xfs/Makefile
> > @@ -15,47 +15,7 @@ obj-$(CONFIG_XFS_FS) += xfs.o
> >  xfs-y  += xfs_trace.o
> >  
> >  # build the libxfs code first
> > -xfs-y  += $(addprefix libxfs/, \
> > -  xfs_ag.o \
> > -  xfs_alloc.o \
> > -  xfs_alloc_btree.o \
> > -  xfs_attr.o \
> > -  xfs_attr_leaf.o \
> > -  xfs_attr_remote.o \
> > -  xfs_bit.o \
> > -  xfs_bmap.o \
> > -  xfs_bmap_btree.o \
> > -  xfs_btree.o \
> > -  xfs_da_btree.o \
> > -  xfs_da_format.o \
> > -  xfs_defer.o \
> > -  xfs_dir2.o \
> > -  xfs_dir2_block.o \
> > -  xfs_dir2_data.o \
> > -  xfs_dir2_leaf.o \
> > -  xfs_dir2_node.o \
> > -  xfs_dir2_sf.o \
> > -  xfs_dquot_buf.o \
> > -  xfs_ialloc.o \
> > -  xfs_ialloc_btree.o \
> > -  xfs_iext_tree.o \
> > -  xfs_inode_fork.o \
> > -  xfs_inode_buf.o \
> > -  xfs_log_rlimit.o \
> > -  xfs_ag_resv.o \
> > -  xfs_rmap.o \
> > -  xfs_rmap_btree.o \
> > -  xfs_refcount.o \
> > -  xfs_refcount_btree.o \
> > -  xfs_sb.o \
> > -  xfs_symlink_remote.o \
> > -  xfs_trans_resv.o \
> > -  xfs_types.o \
> > -  )
> > -# xfs_rtbitmap is shared with libxfs
> > -xfs-$(CONFIG_XFS_RT)   += $(addprefix libxfs/, \
> > -  xfs_rtbitmap.o \
> > -  )
> > +xfs-y  += libxfs/
> >  
> >  # highlevel code
> >  xfs-y  += xfs_aops.o \
> > @@ -127,38 +87,4 @@ xfs-$(CONFIG_SYSCTL)+= xfs_sysctl.o
> >  xfs-$(CONFIG_COMPAT)   += xfs_ioctl32.o
> >  xfs-$(CONFIG_EXPORTFS_BLOCK_OPS)   += xfs_pnfs.o
> >  
> > -# online scrub/repair
> > -ifeq ($(CONFIG_XFS_ONLINE_SCRUB),y)
> > -
> > -# Tracepoints like to blow up, so build that before everything else
> > -
> > -xfs-y  += $(addprefix scrub/, \
> > -  trace.o \
> > -  agheader.o \
> > -  alloc.o \
> > -  attr.o \
> > -  bmap.o \
> > -  btree.o \
> > -  common.o \
> > -  dabtree.o \
> > -  dir.o \
> > -  ialloc.o \
> > -  inode.o \
> > -  parent.o \
> > -  refcount.o \
> > -  rmap.o \
> > -  scrub.o \
> > -  

Re: [RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-18 Thread Christoph Hellwig
On Tue, Jun 19, 2018 at 02:05:23PM +1000, NeilBrown wrote:
> From: NeilBrown 
> Date: Tue, 19 Jun 2018 13:59:16 +1000
> Subject: [PATCH] kbuild/xfs: example modobj-m conversion
> 
> This is a demonstration patch to show how
> xfs can be changed to make use of the proposed modobj-m=
> functionality, should the xfs developers want that.

Well, IFF we go with this new functionality I think everyone should
be using it instead of the current hacks.

So text like the above should be in the series cover letter, and this
patch should have an actual description..

I see no argument against these changes, but I've also added the XFS
list.

> 
> Signed-off-by: NeilBrown 
> ---
>  fs/xfs/Makefile| 78 
> ++
>  fs/xfs/libxfs/Makefile | 43 
>  fs/xfs/scrub/Makefile  | 29 +++
>  3 files changed, 74 insertions(+), 76 deletions(-)
>  create mode 100644 fs/xfs/libxfs/Makefile
>  create mode 100644 fs/xfs/scrub/Makefile
> 
> diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> index 2f3f75a7f180..0ba854045fe9 100644
> --- a/fs/xfs/Makefile
> +++ b/fs/xfs/Makefile
> @@ -15,47 +15,7 @@ obj-$(CONFIG_XFS_FS)   += xfs.o
>  xfs-y+= xfs_trace.o
>  
>  # build the libxfs code first
> -xfs-y+= $(addprefix libxfs/, \
> -xfs_ag.o \
> -xfs_alloc.o \
> -xfs_alloc_btree.o \
> -xfs_attr.o \
> -xfs_attr_leaf.o \
> -xfs_attr_remote.o \
> -xfs_bit.o \
> -xfs_bmap.o \
> -xfs_bmap_btree.o \
> -xfs_btree.o \
> -xfs_da_btree.o \
> -xfs_da_format.o \
> -xfs_defer.o \
> -xfs_dir2.o \
> -xfs_dir2_block.o \
> -xfs_dir2_data.o \
> -xfs_dir2_leaf.o \
> -xfs_dir2_node.o \
> -xfs_dir2_sf.o \
> -xfs_dquot_buf.o \
> -xfs_ialloc.o \
> -xfs_ialloc_btree.o \
> -xfs_iext_tree.o \
> -xfs_inode_fork.o \
> -xfs_inode_buf.o \
> -xfs_log_rlimit.o \
> -xfs_ag_resv.o \
> -xfs_rmap.o \
> -xfs_rmap_btree.o \
> -xfs_refcount.o \
> -xfs_refcount_btree.o \
> -xfs_sb.o \
> -xfs_symlink_remote.o \
> -xfs_trans_resv.o \
> -xfs_types.o \
> -)
> -# xfs_rtbitmap is shared with libxfs
> -xfs-$(CONFIG_XFS_RT) += $(addprefix libxfs/, \
> -xfs_rtbitmap.o \
> -)
> +xfs-y+= libxfs/
>  
>  # highlevel code
>  xfs-y+= xfs_aops.o \
> @@ -127,38 +87,4 @@ xfs-$(CONFIG_SYSCTL)  += xfs_sysctl.o
>  xfs-$(CONFIG_COMPAT) += xfs_ioctl32.o
>  xfs-$(CONFIG_EXPORTFS_BLOCK_OPS) += xfs_pnfs.o
>  
> -# online scrub/repair
> -ifeq ($(CONFIG_XFS_ONLINE_SCRUB),y)
> -
> -# Tracepoints like to blow up, so build that before everything else
> -
> -xfs-y+= $(addprefix scrub/, \
> -trace.o \
> -agheader.o \
> -alloc.o \
> -attr.o \
> -bmap.o \
> -btree.o \
> -common.o \
> -dabtree.o \
> -dir.o \
> -ialloc.o \
> -inode.o \
> -parent.o \
> -refcount.o \
> -rmap.o \
> -scrub.o \
> -symlink.o \
> -)
> -
> -xfs-$(CONFIG_XFS_RT) += scrub/rtbitmap.o
> -xfs-$(CONFIG_XFS_QUOTA)  += scrub/quota.o
> -
> -# online repair
> -ifeq ($(CONFIG_XFS_ONLINE_REPAIR),y)
> -xfs-y+= $(addprefix scrub/, \
> -agheader_repair.o \
> - 

Re: [RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-18 Thread Christoph Hellwig
On Tue, Jun 19, 2018 at 02:05:23PM +1000, NeilBrown wrote:
> From: NeilBrown 
> Date: Tue, 19 Jun 2018 13:59:16 +1000
> Subject: [PATCH] kbuild/xfs: example modobj-m conversion
> 
> This is a demonstration patch to show how
> xfs can be changed to make use of the proposed modobj-m=
> functionality, should the xfs developers want that.

Well, IFF we go with this new functionality I think everyone should
be using it instead of the current hacks.

So text like the above should be in the series cover letter, and this
patch should have an actual description..

I see no argument against these changes, but I've also added the XFS
list.

> 
> Signed-off-by: NeilBrown 
> ---
>  fs/xfs/Makefile| 78 
> ++
>  fs/xfs/libxfs/Makefile | 43 
>  fs/xfs/scrub/Makefile  | 29 +++
>  3 files changed, 74 insertions(+), 76 deletions(-)
>  create mode 100644 fs/xfs/libxfs/Makefile
>  create mode 100644 fs/xfs/scrub/Makefile
> 
> diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> index 2f3f75a7f180..0ba854045fe9 100644
> --- a/fs/xfs/Makefile
> +++ b/fs/xfs/Makefile
> @@ -15,47 +15,7 @@ obj-$(CONFIG_XFS_FS)   += xfs.o
>  xfs-y+= xfs_trace.o
>  
>  # build the libxfs code first
> -xfs-y+= $(addprefix libxfs/, \
> -xfs_ag.o \
> -xfs_alloc.o \
> -xfs_alloc_btree.o \
> -xfs_attr.o \
> -xfs_attr_leaf.o \
> -xfs_attr_remote.o \
> -xfs_bit.o \
> -xfs_bmap.o \
> -xfs_bmap_btree.o \
> -xfs_btree.o \
> -xfs_da_btree.o \
> -xfs_da_format.o \
> -xfs_defer.o \
> -xfs_dir2.o \
> -xfs_dir2_block.o \
> -xfs_dir2_data.o \
> -xfs_dir2_leaf.o \
> -xfs_dir2_node.o \
> -xfs_dir2_sf.o \
> -xfs_dquot_buf.o \
> -xfs_ialloc.o \
> -xfs_ialloc_btree.o \
> -xfs_iext_tree.o \
> -xfs_inode_fork.o \
> -xfs_inode_buf.o \
> -xfs_log_rlimit.o \
> -xfs_ag_resv.o \
> -xfs_rmap.o \
> -xfs_rmap_btree.o \
> -xfs_refcount.o \
> -xfs_refcount_btree.o \
> -xfs_sb.o \
> -xfs_symlink_remote.o \
> -xfs_trans_resv.o \
> -xfs_types.o \
> -)
> -# xfs_rtbitmap is shared with libxfs
> -xfs-$(CONFIG_XFS_RT) += $(addprefix libxfs/, \
> -xfs_rtbitmap.o \
> -)
> +xfs-y+= libxfs/
>  
>  # highlevel code
>  xfs-y+= xfs_aops.o \
> @@ -127,38 +87,4 @@ xfs-$(CONFIG_SYSCTL)  += xfs_sysctl.o
>  xfs-$(CONFIG_COMPAT) += xfs_ioctl32.o
>  xfs-$(CONFIG_EXPORTFS_BLOCK_OPS) += xfs_pnfs.o
>  
> -# online scrub/repair
> -ifeq ($(CONFIG_XFS_ONLINE_SCRUB),y)
> -
> -# Tracepoints like to blow up, so build that before everything else
> -
> -xfs-y+= $(addprefix scrub/, \
> -trace.o \
> -agheader.o \
> -alloc.o \
> -attr.o \
> -bmap.o \
> -btree.o \
> -common.o \
> -dabtree.o \
> -dir.o \
> -ialloc.o \
> -inode.o \
> -parent.o \
> -refcount.o \
> -rmap.o \
> -scrub.o \
> -symlink.o \
> -)
> -
> -xfs-$(CONFIG_XFS_RT) += scrub/rtbitmap.o
> -xfs-$(CONFIG_XFS_QUOTA)  += scrub/quota.o
> -
> -# online repair
> -ifeq ($(CONFIG_XFS_ONLINE_REPAIR),y)
> -xfs-y+= $(addprefix scrub/, \
> -agheader_repair.o \
> - 

Re: [RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-18 Thread NeilBrown
On Mon, Jun 18 2018, Christoph Hellwig wrote:

> On Mon, Jun 18, 2018 at 02:55:20PM +1000, NeilBrown wrote:
>> This set of patches makes it possible to build a module from
>> code in multiple directories without needing to list files from one
>> directory in the Makefile of another directory.
>> 
>> The code was developed for lustre (which is now out-of-tree :-( ) but
>> can be useful elsewhere, such as for xfs and btrfs and others.
>> 
>> In fs/xfs/Makefile the section:
>> 
>> xfs-y+= $(addprefix libxfs/, \
>> xfs_ag.o \
>> xfs_alloc.o \
>>  .
>> 
>> could become
>> 
>> xfs-y += libxfs/
>> 
>> and then in fs/xfs/libxfs/Makefile we would have
>> 
>> modobj-$(CONFIG_XFS_FS) += xfs_ag.o \
>> xfs_alloc.o \
>> .
>> 
>> A similar process could move filenames for scrub/* from the
>> fs/xfs/Makefile to fs/xfs/scrub/Makefile
>
> How about you actually convert it as an example?

Sure ... found a bug while testing it.  Thanks :-)

From ac7953b4ba6d9a2a69dab84dd772aafca38d8377 Mon Sep 17 00:00:00 2001
From: NeilBrown 
Date: Tue, 19 Jun 2018 13:59:16 +1000
Subject: [PATCH] kbuild/xfs: example modobj-m conversion

This is a demonstration patch to show how
xfs can be changed to make use of the proposed modobj-m=
functionality, should the xfs developers want that.

Signed-off-by: NeilBrown 
---
 fs/xfs/Makefile| 78 ++
 fs/xfs/libxfs/Makefile | 43 
 fs/xfs/scrub/Makefile  | 29 +++
 3 files changed, 74 insertions(+), 76 deletions(-)
 create mode 100644 fs/xfs/libxfs/Makefile
 create mode 100644 fs/xfs/scrub/Makefile

diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 2f3f75a7f180..0ba854045fe9 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -15,47 +15,7 @@ obj-$(CONFIG_XFS_FS) += xfs.o
 xfs-y  += xfs_trace.o
 
 # build the libxfs code first
-xfs-y  += $(addprefix libxfs/, \
-  xfs_ag.o \
-  xfs_alloc.o \
-  xfs_alloc_btree.o \
-  xfs_attr.o \
-  xfs_attr_leaf.o \
-  xfs_attr_remote.o \
-  xfs_bit.o \
-  xfs_bmap.o \
-  xfs_bmap_btree.o \
-  xfs_btree.o \
-  xfs_da_btree.o \
-  xfs_da_format.o \
-  xfs_defer.o \
-  xfs_dir2.o \
-  xfs_dir2_block.o \
-  xfs_dir2_data.o \
-  xfs_dir2_leaf.o \
-  xfs_dir2_node.o \
-  xfs_dir2_sf.o \
-  xfs_dquot_buf.o \
-  xfs_ialloc.o \
-  xfs_ialloc_btree.o \
-  xfs_iext_tree.o \
-  xfs_inode_fork.o \
-  xfs_inode_buf.o \
-  xfs_log_rlimit.o \
-  xfs_ag_resv.o \
-  xfs_rmap.o \
-  xfs_rmap_btree.o \
-  xfs_refcount.o \
-  xfs_refcount_btree.o \
-  xfs_sb.o \
-  xfs_symlink_remote.o \
-  xfs_trans_resv.o \
-  xfs_types.o \
-  )
-# xfs_rtbitmap is shared with libxfs
-xfs-$(CONFIG_XFS_RT)   += $(addprefix libxfs/, \
-  xfs_rtbitmap.o \
-  )
+xfs-y  += libxfs/
 
 # highlevel code
 xfs-y  += xfs_aops.o \
@@ -127,38 +87,4 @@ xfs-$(CONFIG_SYSCTL)+= xfs_sysctl.o
 xfs-$(CONFIG_COMPAT)   += xfs_ioctl32.o
 xfs-$(CONFIG_EXPORTFS_BLOCK_OPS)   += xfs_pnfs.o
 
-# online scrub/repair
-ifeq ($(CONFIG_XFS_ONLINE_SCRUB),y)
-
-# Tracepoints like to blow up, so build that before everything else
-
-xfs-y  += $(addprefix scrub/, \
-  trace.o \
-  agheader.o \
-  alloc.o \
-  attr.o \
-  bmap.o \
-  btree.o \
-  common.o \
-  

Re: [RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-18 Thread NeilBrown
On Mon, Jun 18 2018, Christoph Hellwig wrote:

> On Mon, Jun 18, 2018 at 02:55:20PM +1000, NeilBrown wrote:
>> This set of patches makes it possible to build a module from
>> code in multiple directories without needing to list files from one
>> directory in the Makefile of another directory.
>> 
>> The code was developed for lustre (which is now out-of-tree :-( ) but
>> can be useful elsewhere, such as for xfs and btrfs and others.
>> 
>> In fs/xfs/Makefile the section:
>> 
>> xfs-y+= $(addprefix libxfs/, \
>> xfs_ag.o \
>> xfs_alloc.o \
>>  .
>> 
>> could become
>> 
>> xfs-y += libxfs/
>> 
>> and then in fs/xfs/libxfs/Makefile we would have
>> 
>> modobj-$(CONFIG_XFS_FS) += xfs_ag.o \
>> xfs_alloc.o \
>> .
>> 
>> A similar process could move filenames for scrub/* from the
>> fs/xfs/Makefile to fs/xfs/scrub/Makefile
>
> How about you actually convert it as an example?

Sure ... found a bug while testing it.  Thanks :-)

From ac7953b4ba6d9a2a69dab84dd772aafca38d8377 Mon Sep 17 00:00:00 2001
From: NeilBrown 
Date: Tue, 19 Jun 2018 13:59:16 +1000
Subject: [PATCH] kbuild/xfs: example modobj-m conversion

This is a demonstration patch to show how
xfs can be changed to make use of the proposed modobj-m=
functionality, should the xfs developers want that.

Signed-off-by: NeilBrown 
---
 fs/xfs/Makefile| 78 ++
 fs/xfs/libxfs/Makefile | 43 
 fs/xfs/scrub/Makefile  | 29 +++
 3 files changed, 74 insertions(+), 76 deletions(-)
 create mode 100644 fs/xfs/libxfs/Makefile
 create mode 100644 fs/xfs/scrub/Makefile

diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 2f3f75a7f180..0ba854045fe9 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -15,47 +15,7 @@ obj-$(CONFIG_XFS_FS) += xfs.o
 xfs-y  += xfs_trace.o
 
 # build the libxfs code first
-xfs-y  += $(addprefix libxfs/, \
-  xfs_ag.o \
-  xfs_alloc.o \
-  xfs_alloc_btree.o \
-  xfs_attr.o \
-  xfs_attr_leaf.o \
-  xfs_attr_remote.o \
-  xfs_bit.o \
-  xfs_bmap.o \
-  xfs_bmap_btree.o \
-  xfs_btree.o \
-  xfs_da_btree.o \
-  xfs_da_format.o \
-  xfs_defer.o \
-  xfs_dir2.o \
-  xfs_dir2_block.o \
-  xfs_dir2_data.o \
-  xfs_dir2_leaf.o \
-  xfs_dir2_node.o \
-  xfs_dir2_sf.o \
-  xfs_dquot_buf.o \
-  xfs_ialloc.o \
-  xfs_ialloc_btree.o \
-  xfs_iext_tree.o \
-  xfs_inode_fork.o \
-  xfs_inode_buf.o \
-  xfs_log_rlimit.o \
-  xfs_ag_resv.o \
-  xfs_rmap.o \
-  xfs_rmap_btree.o \
-  xfs_refcount.o \
-  xfs_refcount_btree.o \
-  xfs_sb.o \
-  xfs_symlink_remote.o \
-  xfs_trans_resv.o \
-  xfs_types.o \
-  )
-# xfs_rtbitmap is shared with libxfs
-xfs-$(CONFIG_XFS_RT)   += $(addprefix libxfs/, \
-  xfs_rtbitmap.o \
-  )
+xfs-y  += libxfs/
 
 # highlevel code
 xfs-y  += xfs_aops.o \
@@ -127,38 +87,4 @@ xfs-$(CONFIG_SYSCTL)+= xfs_sysctl.o
 xfs-$(CONFIG_COMPAT)   += xfs_ioctl32.o
 xfs-$(CONFIG_EXPORTFS_BLOCK_OPS)   += xfs_pnfs.o
 
-# online scrub/repair
-ifeq ($(CONFIG_XFS_ONLINE_SCRUB),y)
-
-# Tracepoints like to blow up, so build that before everything else
-
-xfs-y  += $(addprefix scrub/, \
-  trace.o \
-  agheader.o \
-  alloc.o \
-  attr.o \
-  bmap.o \
-  btree.o \
-  common.o \
-  

Re: [RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2018 at 02:55:20PM +1000, NeilBrown wrote:
> This set of patches makes it possible to build a module from
> code in multiple directories without needing to list files from one
> directory in the Makefile of another directory.
> 
> The code was developed for lustre (which is now out-of-tree :-( ) but
> can be useful elsewhere, such as for xfs and btrfs and others.
> 
> In fs/xfs/Makefile the section:
> 
> xfs-y += $(addprefix libxfs/, \
>  xfs_ag.o \
>  xfs_alloc.o \
>   .
> 
> could become
> 
> xfs-y += libxfs/
> 
> and then in fs/xfs/libxfs/Makefile we would have
> 
> modobj-$(CONFIG_XFS_FS) += xfs_ag.o \
>  xfs_alloc.o \
>  .
> 
> A similar process could move filenames for scrub/* from the
> fs/xfs/Makefile to fs/xfs/scrub/Makefile

How about you actually convert it as an example?


Re: [RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-18 Thread Christoph Hellwig
On Mon, Jun 18, 2018 at 02:55:20PM +1000, NeilBrown wrote:
> This set of patches makes it possible to build a module from
> code in multiple directories without needing to list files from one
> directory in the Makefile of another directory.
> 
> The code was developed for lustre (which is now out-of-tree :-( ) but
> can be useful elsewhere, such as for xfs and btrfs and others.
> 
> In fs/xfs/Makefile the section:
> 
> xfs-y += $(addprefix libxfs/, \
>  xfs_ag.o \
>  xfs_alloc.o \
>   .
> 
> could become
> 
> xfs-y += libxfs/
> 
> and then in fs/xfs/libxfs/Makefile we would have
> 
> modobj-$(CONFIG_XFS_FS) += xfs_ag.o \
>  xfs_alloc.o \
>  .
> 
> A similar process could move filenames for scrub/* from the
> fs/xfs/Makefile to fs/xfs/scrub/Makefile

How about you actually convert it as an example?


[RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-17 Thread NeilBrown
This set of patches makes it possible to build a module from
code in multiple directories without needing to list files from one
directory in the Makefile of another directory.

The code was developed for lustre (which is now out-of-tree :-( ) but
can be useful elsewhere, such as for xfs and btrfs and others.

In fs/xfs/Makefile the section:

xfs-y   += $(addprefix libxfs/, \
   xfs_ag.o \
   xfs_alloc.o \
.

could become

xfs-y += libxfs/

and then in fs/xfs/libxfs/Makefile we would have

modobj-$(CONFIG_XFS_FS) += xfs_ag.o \
   xfs_alloc.o \
   .

A similar process could move filenames for scrub/* from the
fs/xfs/Makefile to fs/xfs/scrub/Makefile

Apart from improving modularity, this means that partial makes such
as:

  make fs/xfs/libxfs/

or

  make fs/xfs/scrub/attr.s

can work.

Comments and review most welcome.

Thanks,
NeilBrown

---

NeilBrown (5):
  kbuild: detect directories in components of a module.
  kbuild: treat a directory listed in a composite object as foo/mod.a
  kbuild: support building of per-directory mod.a
  kbuild: disable KBUILD_MODNAME when building for mod.a
  kbuild: Add documentation for modobj-m


 Documentation/kbuild/makefiles.txt |   65 ++--
 scripts/Makefile.build |   57 ++--
 scripts/Makefile.lib   |   63 ++-
 3 files changed, 141 insertions(+), 44 deletions(-)

--
Signature



[RFC PATCH 0/5] kbuild: build modules from code in multiple directories.

2018-06-17 Thread NeilBrown
This set of patches makes it possible to build a module from
code in multiple directories without needing to list files from one
directory in the Makefile of another directory.

The code was developed for lustre (which is now out-of-tree :-( ) but
can be useful elsewhere, such as for xfs and btrfs and others.

In fs/xfs/Makefile the section:

xfs-y   += $(addprefix libxfs/, \
   xfs_ag.o \
   xfs_alloc.o \
.

could become

xfs-y += libxfs/

and then in fs/xfs/libxfs/Makefile we would have

modobj-$(CONFIG_XFS_FS) += xfs_ag.o \
   xfs_alloc.o \
   .

A similar process could move filenames for scrub/* from the
fs/xfs/Makefile to fs/xfs/scrub/Makefile

Apart from improving modularity, this means that partial makes such
as:

  make fs/xfs/libxfs/

or

  make fs/xfs/scrub/attr.s

can work.

Comments and review most welcome.

Thanks,
NeilBrown

---

NeilBrown (5):
  kbuild: detect directories in components of a module.
  kbuild: treat a directory listed in a composite object as foo/mod.a
  kbuild: support building of per-directory mod.a
  kbuild: disable KBUILD_MODNAME when building for mod.a
  kbuild: Add documentation for modobj-m


 Documentation/kbuild/makefiles.txt |   65 ++--
 scripts/Makefile.build |   57 ++--
 scripts/Makefile.lib   |   63 ++-
 3 files changed, 141 insertions(+), 44 deletions(-)

--
Signature