linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs-progs: Split original mode check to its own
@ 2018-02-06  7:02 Qu Wenruo
  2018-02-06  7:02 ` [PATCH 3/3] btrfs-progs: Move check/main.c to cmds-check.c to maintain the subcommand hierarchy Qu Wenruo
  2018-03-09 16:56 ` [PATCH 0/3] btrfs-progs: Split original mode check to its own David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Qu Wenruo @ 2018-02-06  7:02 UTC (permalink / raw)
  To: linux-btrfs, dsterba

This time, there are 2 patches too large to reach mail list, so please
fetch the whole patchset from github as usual:
https://github.com/adam900710/btrfs-progs/tree/split_check_part2

The branch is based on devel branch, whose HEAD is:
commit 3aa1bbdd89ee9c9c48d260a6192fae08328f1b2f (david/devel)
Author: David Sterba <dsterba@suse.com>
Date:   Sat Feb 3 01:15:42 2018 +0100

    btrfs-progs: mkfs: fix build on musl
    
    Another build failure on musl.
    
    Issue: #90
    Signed-off-by: David Sterba <dsterba@suse.com>


The first patch moves remaining common code to mode-common.c.
Things like transid fix, which is handled in read_tree_block(), get
moved to mode-common.c.
And commented added for exported functions.

The 2nd patch moves the original mode code to mode-original.c.
Unlike lowmem mode, original mode has more functions exported, as things
like bad items repair is integrated into the main funtion.

The last patch moves check/main.c back to cmds-check.c to keep
subcommand hierarchy.

With the split done, we now have a clear view about the check code size:
$ wc -l check/*.[ch] cmds-check.c | sort -h
    67 check/mode-lowmem.h
   137 check/mode-common.h
   308 check/mode-original.h
   661 cmds-check.c
  2062 check/mode-common.c
  4573 check/mode-lowmem.c
  7577 check/mode-original.c

Qu Wenruo (3):
  btrfs-progs: check: Move more shared codes to mode-common.c
  btrfs-progs: Move the remaining original mode code to mode-original.c
  btrfs-progs: Move check/main.c to cmds-check.c to maintain the
    subcommand hierarchy

 Makefile                          |    7 +-
 check/mode-common.c               | 1711 +++++++++
 check/mode-common.h               |   39 +-
 check/{main.c => mode-original.c} | 6954 ++++++++++++-------------------------
 check/mode-original.h             |   32 +-
 cmds-check.c                      |  661 ++++
 6 files changed, 4742 insertions(+), 4662 deletions(-)
 rename check/{main.c => mode-original.c} (76%)
 create mode 100644 cmds-check.c

-- 
2.16.1


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

* [PATCH 3/3] btrfs-progs: Move check/main.c to cmds-check.c to maintain the subcommand hierarchy
  2018-02-06  7:02 [PATCH 0/3] btrfs-progs: Split original mode check to its own Qu Wenruo
@ 2018-02-06  7:02 ` Qu Wenruo
  2018-03-09 16:56 ` [PATCH 0/3] btrfs-progs: Split original mode check to its own David Sterba
  1 sibling, 0 replies; 4+ messages in thread
From: Qu Wenruo @ 2018-02-06  7:02 UTC (permalink / raw)
  To: linux-btrfs, dsterba

cmds-check.c is back now, with include files cleaned up.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 Makefile                     |  8 ++++----
 check/main.c => cmds-check.c | 17 -----------------
 2 files changed, 4 insertions(+), 21 deletions(-)
 rename check/main.c => cmds-check.c (97%)

diff --git a/Makefile b/Makefile
index f51a8d701a2c..58e894c0171b 100644
--- a/Makefile
+++ b/Makefile
@@ -100,6 +100,7 @@ CHECKER_FLAGS := -include $(check_defs) -D__CHECKER__ \
 	-D__CHECK_ENDIAN__ -Wbitwise -Wuninitialized -Wshadow -Wundef \
 	-U_FORTIFY_SOURCE -Wdeclaration-after-statement -Wdefault-bitfield-sign
 
+check_objects = check/mode-lowmem.o check/mode-original.o check/mode-common.o
 objects = ctree.o disk-io.o kernel-lib/radix-tree.o extent-tree.o print-tree.o \
 	  root-tree.o dir-item.o file-item.o inode-item.o inode-map.o \
 	  extent-cache.o extent_io.o volumes.o utils.o repair.o \
@@ -109,12 +110,11 @@ objects = ctree.o disk-io.o kernel-lib/radix-tree.o extent-tree.o print-tree.o \
 	  fsfeatures.o kernel-lib/tables.o kernel-lib/raid56.o transaction.o
 cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
 	       cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \
-	       cmds-quota.o cmds-qgroup.o cmds-replace.o check/main.o \
+	       cmds-quota.o cmds-qgroup.o cmds-replace.o cmds-check.o \
 	       cmds-restore.o cmds-rescue.o chunk-recover.o super-recover.o \
 	       cmds-property.o cmds-fi-usage.o cmds-inspect-dump-tree.o \
 	       cmds-inspect-dump-super.o cmds-inspect-tree-stats.o cmds-fi-du.o \
-	       mkfs/common.o check/mode-common.o check/mode-lowmem.o \
-	       check/mode-original.o
+	       mkfs/common.o
 libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \
 		   kernel-lib/crc32c.o messages.o \
 		   uuid-tree.o utils-lib.o rbtree-utils.o
@@ -391,7 +391,7 @@ btrfs-%: btrfs-%.o $(objects) $(standalone_deps) $(libs_static)
 		$(libs_static) \
 		$(LDFLAGS) $(LIBS) $($(subst -,_,$@-libs))
 
-btrfs: btrfs.o $(objects) $(cmds_objects) $(libs_static)
+btrfs: btrfs.o $(objects) $(cmds_objects) $(libs_static) $(check_objects)
 	@echo "    [LD]     $@"
 	$(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_COMP)
 
diff --git a/check/main.c b/cmds-check.c
similarity index 97%
rename from check/main.c
rename to cmds-check.c
index 1bb2142e113e..28746712fac1 100644
--- a/check/main.c
+++ b/cmds-check.c
@@ -16,32 +16,15 @@
  * Boston, MA 021110-1307, USA.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
 #include <getopt.h>
 #include <uuid/uuid.h>
-#include "ctree.h"
 #include "volumes.h"
 #include "repair.h"
 #include "disk-io.h"
-#include "print-tree.h"
 #include "task-utils.h"
 #include "transaction.h"
 #include "utils.h"
-#include "commands.h"
-#include "free-space-cache.h"
-#include "free-space-tree.h"
-#include "btrfsck.h"
 #include "qgroup-verify.h"
-#include "rbtree-utils.h"
-#include "backref.h"
-#include "kernel-shared/ulist.h"
-#include "hash.h"
 #include "help.h"
 #include "check/mode-common.h"
 #include "check/mode-original.h"
-- 
2.16.1


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

* Re: [PATCH 0/3] btrfs-progs: Split original mode check to its own
  2018-02-06  7:02 [PATCH 0/3] btrfs-progs: Split original mode check to its own Qu Wenruo
  2018-02-06  7:02 ` [PATCH 3/3] btrfs-progs: Move check/main.c to cmds-check.c to maintain the subcommand hierarchy Qu Wenruo
@ 2018-03-09 16:56 ` David Sterba
  2018-03-10  4:46   ` Qu Wenruo
  1 sibling, 1 reply; 4+ messages in thread
From: David Sterba @ 2018-03-09 16:56 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs, dsterba

On Tue, Feb 06, 2018 at 03:02:20PM +0800, Qu Wenruo wrote:
> This time, there are 2 patches too large to reach mail list, so please
> fetch the whole patchset from github as usual:
> https://github.com/adam900710/btrfs-progs/tree/split_check_part2

I missed this patch series, sorry. The changes look good, there
are unfortunatelly merge conflicts due to the asan/ubsan fixes that
should be trivial to resolve. Can you please rebase the branch and let
mek now? Thanks.

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

* Re: [PATCH 0/3] btrfs-progs: Split original mode check to its own
  2018-03-09 16:56 ` [PATCH 0/3] btrfs-progs: Split original mode check to its own David Sterba
@ 2018-03-10  4:46   ` Qu Wenruo
  0 siblings, 0 replies; 4+ messages in thread
From: Qu Wenruo @ 2018-03-10  4:46 UTC (permalink / raw)
  To: dsterba, Qu Wenruo, linux-btrfs


[-- Attachment #1.1: Type: text/plain, Size: 849 bytes --]



On 2018年03月10日 00:56, David Sterba wrote:
> On Tue, Feb 06, 2018 at 03:02:20PM +0800, Qu Wenruo wrote:
>> This time, there are 2 patches too large to reach mail list, so please
>> fetch the whole patchset from github as usual:
>> https://github.com/adam900710/btrfs-progs/tree/split_check_part2
> 
> I missed this patch series, sorry. The changes look good, there
> are unfortunatelly merge conflicts due to the asan/ubsan fixes that
> should be trivial to resolve. Can you please rebase the branch and let
> mek now? Thanks.

No problem, would send the new patchset and pull request to info you.

Thanks,
Qu

> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]

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

end of thread, other threads:[~2018-03-10  4:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-06  7:02 [PATCH 0/3] btrfs-progs: Split original mode check to its own Qu Wenruo
2018-02-06  7:02 ` [PATCH 3/3] btrfs-progs: Move check/main.c to cmds-check.c to maintain the subcommand hierarchy Qu Wenruo
2018-03-09 16:56 ` [PATCH 0/3] btrfs-progs: Split original mode check to its own David Sterba
2018-03-10  4:46   ` Qu Wenruo

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