for-next: update 2nd wave patches to Jens
for-test: move checkpatch patches to for-next
diff --git a/for-next/0000-cover-letter.patch b/for-next/0000-cover-letter.patch
new file mode 100644
index 0000000..60919cb
--- /dev/null
+++ b/for-next/0000-cover-letter.patch
@@ -0,0 +1,56 @@
+From 1ac333e00ca5af1223d63df97e8eac012f62ba4e Mon Sep 17 00:00:00 2001
+From: Coly Li <colyli@suse.de>
+Date: Thu, 9 Aug 2018 15:35:29 +0800
+Subject: [PATCH 00/10] bcache patches for 4.19, 2nd wave
+
+Hi Jens, 
+
+Here are 2nd wave bcache patches for 4.19.
+
+The patches from me were either verified by other people or posted
+for quite long time. Except for the debugfs_create_dir() fix and
+"set max writeback rate" fix, rested patches are simple or trivial
+IMHO.
+
+Our new bcache developer Shenghui Wang contributes two patches in
+this run. The first one fixes a misleading error message, and the
+second one is a code style clean up.
+
+Thanks in advance for picking them.
+
+Coly Li
+---
+Coly Li (8):
+  bcache: do not check return value of debugfs_create_dir()
+  bcache: display rate debug parameters to 0 when writeback is not
+    running
+  bcache: avoid unncessary cache prefetch bch_btree_node_get()
+  bcache: add a comment in super.c
+  bcache: fix mistaken code comments in bcache.h
+  bcache: fix mistaken comments in request.c
+  bcache: add code comments for bset.c
+  bcache: set max writeback rate when I/O request is idle
+
+Shenghui Wang (2):
+  bcache: make the pr_err statement used for ENOENT only in
+    sysfs_attatch section
+  bcache: trivial - remove tailing backslash in macro BTREE_FLAG
+
+ drivers/md/bcache/bcache.h    | 18 +++----
+ drivers/md/bcache/bset.c      | 63 ++++++++++++++++++++++++
+ drivers/md/bcache/btree.c     | 14 +++---
+ drivers/md/bcache/btree.h     |  2 +-
+ drivers/md/bcache/closure.c   | 13 +++--
+ drivers/md/bcache/closure.h   |  4 +-
+ drivers/md/bcache/debug.c     | 11 +++--
+ drivers/md/bcache/request.c   | 61 +++++++++++++++++++++--
+ drivers/md/bcache/super.c     |  9 +++-
+ drivers/md/bcache/sysfs.c     | 41 ++++++++++------
+ drivers/md/bcache/util.c      |  2 +-
+ drivers/md/bcache/util.h      |  2 +-
+ drivers/md/bcache/writeback.c | 91 +++++++++++++++++++++++------------
+ 13 files changed, 251 insertions(+), 80 deletions(-)
+
+-- 
+2.18.0
+
diff --git a/for-next/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch b/for-next/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch
index 54782b1..70a58d1 100644
--- a/for-next/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch
+++ b/for-next/0001-bcache-do-not-check-return-value-of-debugfs_create_d.patch
@@ -1,7 +1,8 @@
 From 3678e3fc53da440570bb61fface0d6af11f96cae Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Tue, 22 May 2018 14:29:09 +0800
-Subject: [PATCH 1/9] bcache: do not check return value of debugfs_create_dir()
+Subject: [PATCH 01/10] bcache: do not check return value of
+ debugfs_create_dir()
 
 Greg KH suggests that normal code should not care about debugfs. Therefore
 no matter successful or failed of debugfs_create_dir() execution, it is
diff --git a/for-next/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch b/for-next/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch
index 6531207..a60c771 100644
--- a/for-next/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch
+++ b/for-next/0002-bcache-display-rate-debug-parameters-to-0-when-write.patch
@@ -1,8 +1,8 @@
 From 7ee659583a709e9a0da10a9a5d3e9bc103d94853 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Sat, 5 May 2018 20:52:33 +0800
-Subject: [PATCH 2/9] bcache: display rate debug parameters to 0 when writeback
- is not running
+Subject: [PATCH 02/10] bcache: display rate debug parameters to 0 when
+ writeback is not running
 
 When writeback is not running, writeback rate should be 0, other value is
 misleading. And the following dyanmic writeback rate debug parameters
diff --git a/for-next/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch b/for-next/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch
index 4063f8d..bef5596 100644
--- a/for-next/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch
+++ b/for-next/0003-bcache-avoid-unncessary-cache-prefetch-bch_btree_nod.patch
@@ -1,7 +1,7 @@
 From 3fc57055129d0f3f0002643ca28bcc242c974b02 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Mon, 26 Mar 2018 15:05:08 +0800
-Subject: [PATCH 3/9] bcache: avoid unncessary cache prefetch
+Subject: [PATCH 03/10] bcache: avoid unncessary cache prefetch
  bch_btree_node_get()
 
 In bch_btree_node_get() the read-in btree node will be partially
diff --git a/for-next/0004-bcache-add-a-comment-in-super.c.patch b/for-next/0004-bcache-add-a-comment-in-super.c.patch
index 32b5b1c..a5d8b6a 100644
--- a/for-next/0004-bcache-add-a-comment-in-super.c.patch
+++ b/for-next/0004-bcache-add-a-comment-in-super.c.patch
@@ -1,7 +1,7 @@
 From ec367ac0b48e43f6e8707ab10864f8ffd5220f5e Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Mon, 20 Nov 2017 16:53:48 +0800
-Subject: [PATCH 4/9] bcache: add a comment in super.c
+Subject: [PATCH 04/10] bcache: add a comment in super.c
 
 This patch adds a line of code comment in super.c:register_bdev(), to
 make code to be more comprehensible.
diff --git a/for-next/0005-bcache-fix-mistaken-code-comments-in-bcache.h.patch b/for-next/0005-bcache-fix-mistaken-code-comments-in-bcache.h.patch
index 8ec2c5d..5fae03f 100644
--- a/for-next/0005-bcache-fix-mistaken-code-comments-in-bcache.h.patch
+++ b/for-next/0005-bcache-fix-mistaken-code-comments-in-bcache.h.patch
@@ -1,7 +1,7 @@
 From c171ac9c60af11ec055e246d3ad50900381b905c Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Mon, 13 Nov 2017 23:55:01 +0800
-Subject: [PATCH 5/9] bcache: fix mistaken code comments in bcache.h
+Subject: [PATCH 05/10] bcache: fix mistaken code comments in bcache.h
 
 This patch updates the code comment in struct cache with correct array
 names, to make the code to be more comprehensible.
diff --git a/for-next/0006-bcache-fix-mistaken-comments-in-request.c.patch b/for-next/0006-bcache-fix-mistaken-comments-in-request.c.patch
index aee1030..d823fb9 100644
--- a/for-next/0006-bcache-fix-mistaken-comments-in-request.c.patch
+++ b/for-next/0006-bcache-fix-mistaken-comments-in-request.c.patch
@@ -1,7 +1,7 @@
 From 00c62fb5182203fd9911736115ca9ddbcaf680a6 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Tue, 14 Nov 2017 00:09:50 +0800
-Subject: [PATCH 6/9] bcache: fix mistaken comments in request.c
+Subject: [PATCH 06/10] bcache: fix mistaken comments in request.c
 
 This patch updates code comment in bch_keylist_realloc() by fixing
 incorrected function names, to make the code to be more comprehennsible.
diff --git a/for-next/0007-bcache-add-code-comments-for-bset.c.patch b/for-next/0007-bcache-add-code-comments-for-bset.c.patch
index b7ba3eb..c14596c 100644
--- a/for-next/0007-bcache-add-code-comments-for-bset.c.patch
+++ b/for-next/0007-bcache-add-code-comments-for-bset.c.patch
@@ -1,7 +1,7 @@
 From 9879a0caf2a5c9d2143b9d386092012f50eae963 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Thu, 12 Apr 2018 17:24:18 +0800
-Subject: [PATCH 7/9] bcache: add code comments for bset.c
+Subject: [PATCH 07/10] bcache: add code comments for bset.c
 
 This patch tries to add code comments in bset.c, to make some
 tricky code and designment to be more comprehensible. Most information
diff --git a/for-next/0008-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch b/for-next/0008-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch
index 908fcda..856f5fc 100644
--- a/for-next/0008-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch
+++ b/for-next/0008-bcache-set-max-writeback-rate-when-I-O-request-is-id.patch
@@ -1,7 +1,7 @@
 From 9c26e5fd96446919cc77c14a09ba9b6cf2320ab5 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Thu, 26 Jul 2018 15:16:11 +0800
-Subject: [PATCH 8/9] bcache: set max writeback rate when I/O request is idle
+Subject: [PATCH 08/10] bcache: set max writeback rate when I/O request is idle
 
 Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle")
 allows the writeback rate to be faster if there is no I/O request on a
diff --git a/for-next/0009-bcache-make-the-pr_err-statement-used-for-ENOENT-onl.patch b/for-next/0009-bcache-make-the-pr_err-statement-used-for-ENOENT-onl.patch
new file mode 100644
index 0000000..59eb77f
--- /dev/null
+++ b/for-next/0009-bcache-make-the-pr_err-statement-used-for-ENOENT-onl.patch
@@ -0,0 +1,71 @@
+From 1b28972603d1d9819c9273080b0a02ae00f609c2 Mon Sep 17 00:00:00 2001
+From: Shenghui Wang <shhuiw@foxmail.com>
+Date: Wed, 8 Aug 2018 20:32:52 +0800
+Subject: [PATCH 09/10] bcache: make the pr_err statement used for ENOENT only
+ in sysfs_attatch section
+
+The pr_err statement in the code for sysfs_attatch section would run
+for various error codes, which maybe confusing.
+
+E.g,
+
+Run the command twice:
+   echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be891 > \
+				/sys/block/bcache0/bcache/attach
+   [the backing dev got attached on the first run]
+   echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be891 > \
+				/sys/block/bcache0/bcache/attach
+
+In dmesg, after the command run twice, we can get:
+	bcache: bch_cached_dev_attach() Can't attach sda6: already attached
+	bcache: __cached_dev_store() Can't attach 796b5c05-b03c-4bc7-9cbd-\
+a8df5e8be891
+               : cache set not found
+The first statement in the message was right, but the second was
+confusing.
+
+bch_cached_dev_attach has various pr_ statements for various error
+codes, except ENOENT.
+
+After the change, rerun above command twice:
+	echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be891 > \
+			/sys/block/bcache0/bcache/attach
+	echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be891 > \
+			/sys/block/bcache0/bcache/attach
+
+In dmesg we only got:
+	bcache: bch_cached_dev_attach() Can't attach sda6: already attached
+No confusing "cache set not found" message anymore.
+
+And for some not exist SET-UUID:
+	echo 796b5c05-b03c-4bc7-9cbd-a8df5e8be898 > \
+			/sys/block/bcache0/bcache/attach
+In dmesg we can get:
+	bcache: __cached_dev_store() Can't attach 796b5c05-b03c-4bc7-9cbd-\
+a8df5e8be898
+	               : cache set not found
+
+Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
+Signed-off-by: Coly Li <colyli@suse.de>
+---
+ drivers/md/bcache/sysfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
+index 6e88142514fb..22f8565d2bf1 100644
+--- a/drivers/md/bcache/sysfs.c
++++ b/drivers/md/bcache/sysfs.c
+@@ -351,8 +351,8 @@ STORE(__cached_dev)
+ 			if (!v)
+ 				return size;
+ 		}
+-
+-		pr_err("Can't attach %s: cache set not found", buf);
++		if (v == -ENOENT)
++			pr_err("Can't attach %s: cache set not found", buf);
+ 		return v;
+ 	}
+ 
+-- 
+2.18.0
+
diff --git a/for-next/0009-bcache-recal-cached_dev_sectors-on-detach.patch b/for-next/0009-bcache-recal-cached_dev_sectors-on-detach.patch
deleted file mode 100644
index e23ebb9..0000000
--- a/for-next/0009-bcache-recal-cached_dev_sectors-on-detach.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 23ff3d829b6be6ff1c404558a4c8945b45e69394 Mon Sep 17 00:00:00 2001
-From: Shenghui Wang <shhuiw@foxmail.com>
-Date: Tue, 31 Jul 2018 19:24:09 +0800
-Subject: [PATCH 9/9] bcache: recal cached_dev_sectors on detach
-
-Recal cached_dev_sectors on cached_dev detached, as recal done on
-cached_dev attached.
-
-Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
-Cc: stable@vger.kernel.org
-Signed-off-by: Coly Li <colyli@suse.de>
----
- drivers/md/bcache/super.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
-index 32b95f3b9461..db2e7d12c4b6 100644
---- a/drivers/md/bcache/super.c
-+++ b/drivers/md/bcache/super.c
-@@ -999,6 +999,7 @@ static void cached_dev_detach_finish(struct work_struct *w)
- 
- 	bcache_device_detach(&dc->disk);
- 	list_move(&dc->list, &uncached_devices);
-+	calc_cached_dev_sectors(dc->disk->c);
- 
- 	clear_bit(BCACHE_DEV_DETACHING, &dc->disk.flags);
- 	clear_bit(BCACHE_DEV_UNLINK_DONE, &dc->disk.flags);
--- 
-2.18.0
-
diff --git a/for-next/0010-bcache-trivial-remove-tailing-backslash-in-macro-BTR.patch b/for-next/0010-bcache-trivial-remove-tailing-backslash-in-macro-BTR.patch
new file mode 100644
index 0000000..91713fd
--- /dev/null
+++ b/for-next/0010-bcache-trivial-remove-tailing-backslash-in-macro-BTR.patch
@@ -0,0 +1,30 @@
+From 1ac333e00ca5af1223d63df97e8eac012f62ba4e Mon Sep 17 00:00:00 2001
+From: Shenghui Wang <shhuiw@foxmail.com>
+Date: Fri, 3 Aug 2018 16:55:02 +0800
+Subject: [PATCH 10/10] bcache: trivial - remove tailing backslash in macro
+ BTREE_FLAG
+
+Remove the tailing backslash in macro BTREE_FLAG in btree.h
+
+Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
+Signed-off-by: Coly Li <colyli@suse.de>
+---
+ drivers/md/bcache/btree.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/md/bcache/btree.h b/drivers/md/bcache/btree.h
+index d211e2c25b6b..68e9d926134d 100644
+--- a/drivers/md/bcache/btree.h
++++ b/drivers/md/bcache/btree.h
+@@ -152,7 +152,7 @@ static inline bool btree_node_ ## flag(struct btree *b)			\
+ {	return test_bit(BTREE_NODE_ ## flag, &b->flags); }		\
+ 									\
+ static inline void set_btree_node_ ## flag(struct btree *b)		\
+-{	set_bit(BTREE_NODE_ ## flag, &b->flags); }			\
++{	set_bit(BTREE_NODE_ ## flag, &b->flags); }
+ 
+ enum btree_flags {
+ 	BTREE_NODE_io_error,
+-- 
+2.18.0
+
diff --git a/for-test/checkpatches_fixes/0000-cover-letter.patch b/for-next/checkpatch/0000-cover-letter.patch
similarity index 70%
rename from for-test/checkpatches_fixes/0000-cover-letter.patch
rename to for-next/checkpatch/0000-cover-letter.patch
index da8a8aa..c13772c 100644
--- a/for-test/checkpatches_fixes/0000-cover-letter.patch
+++ b/for-next/checkpatch/0000-cover-letter.patch
@@ -1,16 +1,19 @@
-From 3963d925e5b72a43355ee3176528a6c858198945 Mon Sep 17 00:00:00 2001
+From 2b04674443471465b4bdc0e52b2355bb5e128078 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
-Date: Sat, 28 Jul 2018 23:05:38 +0800
-Subject: [PATCH 00/18] bcache cleanup and fixes reported by checkpatch.pl
+Date: Thu, 9 Aug 2018 13:27:47 +0800
+Subject: [PATCH 00/17] fixes reported by checkpatch.pl 
 
-This series is code cleanup and fixes for the issues reported by
-checkpatch.pl.
+This series contains several minor fixes and code cleanup reported by
+scripts/checkpatch.pl. After this series, there are still a few warning
+from checkpatch.pl, but I think they are necessary to be the way they
+are and don't change them. For example, error message exceeds 80 chars
+line limit.
 
-Any code reivew or comment is welcome.
+Thanks in advance for any comment or review.
 
 Coly Li
 ---
-Coly Li (18):
+Coly Li (17):
   bcache: style fix to replace 'unsigned' by 'unsigned int'
   bcache: style fix to add a blank line after declarations
   bcache: add identifier names to arguments of function definitions
@@ -25,7 +28,6 @@
   bcache: fix code comments style
   bcache: add static const prefix to char * array declarations
   bcache: move open brace at end of function definitions to next line
-  bcache: remove useless macros from util.c
   bcache: add missing SPDX header
   bcache: remove unnecessary space before ioctl function pointer
     arguments
@@ -33,9 +35,9 @@
 
  drivers/md/bcache/Kconfig     |   6 +-
  drivers/md/bcache/alloc.c     |  39 ++++---
- drivers/md/bcache/bcache.h    | 208 +++++++++++++++++-----------------
- drivers/md/bcache/bset.c      | 133 ++++++++++++----------
- drivers/md/bcache/bset.h      | 146 +++++++++++++-----------
+ drivers/md/bcache/bcache.h    | 210 +++++++++++++++++-----------------
+ drivers/md/bcache/bset.c      | 129 +++++++++++----------
+ drivers/md/bcache/bset.h      | 146 ++++++++++++-----------
  drivers/md/bcache/btree.c     |  66 ++++++-----
  drivers/md/bcache/btree.h     |  86 +++++++-------
  drivers/md/bcache/closure.c   |   6 +-
@@ -55,12 +57,12 @@
  drivers/md/bcache/super.c     | 103 ++++++++++-------
  drivers/md/bcache/sysfs.c     |  36 +++---
  drivers/md/bcache/sysfs.h     |   6 +-
- drivers/md/bcache/util.c      |   5 +-
+ drivers/md/bcache/util.c      |   2 +
  drivers/md/bcache/util.h      |  24 ++--
  drivers/md/bcache/writeback.c |  27 +++--
- drivers/md/bcache/writeback.h |  19 ++--
+ drivers/md/bcache/writeback.h |  19 +--
  include/uapi/linux/bcache.h   |   8 +-
- 29 files changed, 662 insertions(+), 532 deletions(-)
+ 29 files changed, 660 insertions(+), 529 deletions(-)
 
 -- 
 2.18.0
diff --git a/for-test/checkpatches_fixes/0001-bcache-style-fix-to-replace-unsigned-by-unsigned-int.patch b/for-next/checkpatch/0001-bcache-style-fix-to-replace-unsigned-by-unsigned-int.patch
similarity index 88%
rename from for-test/checkpatches_fixes/0001-bcache-style-fix-to-replace-unsigned-by-unsigned-int.patch
rename to for-next/checkpatch/0001-bcache-style-fix-to-replace-unsigned-by-unsigned-int.patch
index a123deb..a533d90 100644
--- a/for-test/checkpatches_fixes/0001-bcache-style-fix-to-replace-unsigned-by-unsigned-int.patch
+++ b/for-next/checkpatch/0001-bcache-style-fix-to-replace-unsigned-by-unsigned-int.patch
@@ -1,13 +1,13 @@
-From 0f4c5310d2844532bce6a4033c97e3a69d5bdef6 Mon Sep 17 00:00:00 2001
+From 11bf8bbd85a5f49b49fefe48106b12c2a421ae70 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Tue, 26 Jun 2018 22:30:50 +0800
-Subject: [PATCH 01/18] bcache: style fix to replace 'unsigned' by 'unsigned
+Subject: [PATCH 01/17] bcache: style fix to replace 'unsigned' by 'unsigned
  int'
 
 Signed-off-by; Coly Li <colyli@suse.de>
 ---
  drivers/md/bcache/alloc.c     |  36 ++++++-----
- drivers/md/bcache/bcache.h    | 104 +++++++++++++++----------------
+ drivers/md/bcache/bcache.h    | 107 +++++++++++++++----------------
  drivers/md/bcache/bset.c      | 114 ++++++++++++++++++----------------
  drivers/md/bcache/bset.h      |  34 +++++-----
  drivers/md/bcache/btree.c     |  50 +++++++--------
@@ -29,7 +29,7 @@
  drivers/md/bcache/writeback.c |  19 +++---
  drivers/md/bcache/writeback.h |  12 ++--
  include/uapi/linux/bcache.h   |   6 +-
- 23 files changed, 307 insertions(+), 295 deletions(-)
+ 23 files changed, 309 insertions(+), 296 deletions(-)
 
 diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
 index 7fa2631b422c..89f663d22551 100644
@@ -158,7 +158,7 @@
  			: RESERVE_NONE;
  
 diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
-index d6bf294f3907..dd134c36ae92 100644
+index 05f82ff6f016..1ebd2d9d90d5 100644
 --- a/drivers/md/bcache/bcache.h
 +++ b/drivers/md/bcache/bcache.h
 @@ -252,7 +252,7 @@ struct bcache_device {
@@ -203,7 +203,7 @@
  	sector_t		last;
  };
  
-@@ -365,18 +365,18 @@ struct cached_dev {
+@@ -358,18 +358,18 @@ struct cached_dev {
  	struct cache_accounting	accounting;
  
  	/* The rest of this all shows up in sysfs */
@@ -231,7 +231,7 @@
  
  	uint64_t		writeback_rate_target;
  	int64_t			writeback_rate_proportional;
-@@ -384,16 +384,16 @@ struct cached_dev {
+@@ -377,16 +377,16 @@ struct cached_dev {
  	int64_t			writeback_rate_integral_scaled;
  	int32_t			writeback_rate_change;
  
@@ -254,7 +254,7 @@
  
  	char			backing_dev_name[BDEVNAME_SIZE];
  };
-@@ -454,7 +454,7 @@ struct cache {
+@@ -447,7 +447,7 @@ struct cache {
  	 * until a gc finishes - otherwise we could pointlessly burn a ton of
  	 * cpu
  	 */
@@ -263,7 +263,7 @@
  
  	bool			discard; /* Get rid of? */
  
-@@ -478,7 +478,7 @@ struct gc_stat {
+@@ -472,7 +472,7 @@ struct gc_stat {
  
  	size_t			nkeys;
  	uint64_t		data;	/* sectors */
@@ -272,16 +272,16 @@
  };
  
  /*
-@@ -522,7 +522,7 @@ struct cache_set {
+@@ -518,7 +518,7 @@ struct cache_set {
  	int			caches_loaded;
  
  	struct bcache_device	**devices;
 -	unsigned		devices_max_used;
 +	unsigned int		devices_max_used;
+ 	atomic_t		attached_dev_nr;
  	struct list_head	cached_devs;
  	uint64_t		cached_dev_sectors;
- 	struct closure		caching;
-@@ -550,7 +550,7 @@ struct cache_set {
+@@ -548,7 +548,7 @@ struct cache_set {
  	 * Default number of pages for a new btree node - may be less than a
  	 * full bucket
  	 */
@@ -290,7 +290,7 @@
  
  	/*
  	 * Lists of struct btrees; lru is the list for structs that have memory
-@@ -573,7 +573,7 @@ struct cache_set {
+@@ -571,7 +571,7 @@ struct cache_set {
  	struct list_head	btree_cache_freed;
  
  	/* Number of elements in btree_cache + btree_cache_freeable lists */
@@ -299,7 +299,7 @@
  
  	/*
  	 * If we need to allocate memory for a new btree node and that
-@@ -647,7 +647,7 @@ struct cache_set {
+@@ -649,7 +649,7 @@ struct cache_set {
  	struct mutex		verify_lock;
  #endif
  
@@ -308,7 +308,7 @@
  	struct uuid_entry	*uuids;
  	BKEY_PADDED(uuid_bucket);
  	struct closure		uuid_write;
-@@ -668,12 +668,12 @@ struct cache_set {
+@@ -670,12 +670,12 @@ struct cache_set {
  	struct journal		journal;
  
  #define CONGESTED_MAX		1024
@@ -324,7 +324,7 @@
  
  	struct time_stats	btree_gc_time;
  	struct time_stats	btree_split_time;
-@@ -692,16 +692,16 @@ struct cache_set {
+@@ -694,16 +694,16 @@ struct cache_set {
  		ON_ERROR_PANIC,
  	}			on_error;
  #define DEFAULT_IO_ERROR_LIMIT 8
@@ -348,7 +348,7 @@
  
  #define BUCKET_HASH_BITS	12
  	struct hlist_head	bucket_hash[1 << BUCKET_HASH_BITS];
-@@ -710,7 +710,7 @@ struct cache_set {
+@@ -712,7 +712,7 @@ struct cache_set {
  };
  
  struct bbio {
@@ -357,7 +357,7 @@
  	union {
  		struct bkey	key;
  		uint64_t	_pad[3];
-@@ -727,10 +727,10 @@ struct bbio {
+@@ -729,10 +729,10 @@ struct bbio {
  
  #define btree_bytes(c)		((c)->btree_pages * PAGE_SIZE)
  #define btree_blocks(b)							\
@@ -370,7 +370,7 @@
  
  #define bucket_pages(c)		((c)->sb.bucket_size / PAGE_SECTORS)
  #define bucket_bytes(c)		((c)->sb.bucket_size << 9)
-@@ -759,21 +759,21 @@ static inline sector_t bucket_remainder(struct cache_set *c, sector_t s)
+@@ -761,21 +761,21 @@ static inline sector_t bucket_remainder(struct cache_set *c, sector_t s)
  
  static inline struct cache *PTR_CACHE(struct cache_set *c,
  				      const struct bkey *k,
@@ -395,7 +395,7 @@
  {
  	return PTR_CACHE(c, k, ptr)->buckets + PTR_BUCKET_NR(c, k, ptr);
  }
-@@ -785,13 +785,13 @@ static inline uint8_t gen_after(uint8_t a, uint8_t b)
+@@ -787,13 +787,13 @@ static inline uint8_t gen_after(uint8_t a, uint8_t b)
  }
  
  static inline uint8_t ptr_stale(struct cache_set *c, const struct bkey *k,
@@ -411,7 +411,7 @@
  {
  	return (PTR_DEV(k, i) < MAX_CACHES_PER_SET) && PTR_CACHE(c, k, i);
  }
-@@ -886,7 +886,7 @@ static inline uint8_t bucket_gc_gen(struct bucket *b)
+@@ -888,7 +888,7 @@ static inline uint8_t bucket_gc_gen(struct bucket *b)
  static inline void wake_up_allocators(struct cache_set *c)
  {
  	struct cache *ca;
@@ -420,7 +420,17 @@
  
  	for_each_cache(ca, c, i)
  		wake_up_process(ca->alloc_thread);
-@@ -942,13 +942,13 @@ void __bch_invalidate_one_bucket(struct cache *, struct bucket *);
+@@ -933,7 +933,8 @@ void bch_bbio_free(struct bio *, struct cache_set *);
+ struct bio *bch_bbio_alloc(struct cache_set *);
+ 
+ void __bch_submit_bbio(struct bio *, struct cache_set *);
+-void bch_submit_bbio(struct bio *, struct cache_set *, struct bkey *, unsigned);
++void bch_submit_bbio(struct bio *, struct cache_set *,
++		     struct bkey *, unsigned int);
+ 
+ uint8_t bch_inc_gen(struct cache *, struct bucket *);
+ void bch_rescale_priorities(struct cache_set *, int);
+@@ -944,13 +945,13 @@ void __bch_invalidate_one_bucket(struct cache *, struct bucket *);
  void __bch_bucket_free(struct cache *, struct bucket *);
  void bch_bucket_free(struct cache_set *, struct bkey *);
  
@@ -440,7 +450,7 @@
  
  __printf(2, 3)
 diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
-index f3403b45bc28..e3576f279493 100644
+index 596c93b44e9b..dfda7e9efc3e 100644
 --- a/drivers/md/bcache/bset.c
 +++ b/drivers/md/bcache/bset.c
 @@ -18,7 +18,7 @@
@@ -546,25 +556,25 @@
  
  	b->ops = ops;
  	b->expensive_debug_checks = expensive_debug_checks;
-@@ -366,7 +366,7 @@ EXPORT_SYMBOL(bch_btree_keys_init);
- 
- /* Binary tree stuff for auxiliary search trees */
- 
+@@ -370,7 +370,7 @@ EXPORT_SYMBOL(bch_btree_keys_init);
+  * return array index next to j when does in-order traverse
+  * of a binary tree which is stored in a linear array
+  */
 -static unsigned inorder_next(unsigned j, unsigned size)
 +static unsigned int inorder_next(unsigned int j, unsigned int size)
  {
  	if (j * 2 + 1 < size) {
  		j = j * 2 + 1;
-@@ -379,7 +379,7 @@ static unsigned inorder_next(unsigned j, unsigned size)
- 	return j;
- }
- 
+@@ -387,7 +387,7 @@ static unsigned inorder_next(unsigned j, unsigned size)
+  * return array index previous to j when does in-order traverse
+  * of a binary tree which is stored in a linear array
+  */
 -static unsigned inorder_prev(unsigned j, unsigned size)
 +static unsigned int inorder_prev(unsigned int j, unsigned int size)
  {
  	if (j * 2 < size) {
  		j = j * 2;
-@@ -405,10 +405,12 @@ static unsigned inorder_prev(unsigned j, unsigned size)
+@@ -413,10 +413,12 @@ static unsigned inorder_prev(unsigned j, unsigned size)
   * extra is a function of size:
   *   extra = (size - rounddown_pow_of_two(size - 1)) << 1;
   */
@@ -580,10 +590,10 @@
  
  	j  ^= 1U << (b - 1);
  	j <<= 1;
-@@ -421,14 +423,16 @@ static unsigned __to_inorder(unsigned j, unsigned size, unsigned extra)
- 	return j;
- }
- 
+@@ -433,14 +435,16 @@ static unsigned __to_inorder(unsigned j, unsigned size, unsigned extra)
+  * Return the cacheline index in bset_tree->data, where j is index
+  * from a linear array which stores the auxiliar binary tree
+  */
 -static unsigned to_inorder(unsigned j, struct bset_tree *t)
 +static unsigned int to_inorder(unsigned int j, struct bset_tree *t)
  {
@@ -600,16 +610,16 @@
  
  	if (j > extra)
  		j += j - extra;
-@@ -441,7 +445,7 @@ static unsigned __inorder_to_tree(unsigned j, unsigned size, unsigned extra)
- 	return j;
- }
- 
+@@ -457,7 +461,7 @@ static unsigned __inorder_to_tree(unsigned j, unsigned size, unsigned extra)
+  * Return an index from a linear array which stores the auxiliar binary
+  * tree, j is the cacheline index of t->data.
+  */
 -static unsigned inorder_to_tree(unsigned j, struct bset_tree *t)
 +static unsigned int inorder_to_tree(unsigned int j, struct bset_tree *t)
  {
  	return __inorder_to_tree(j, t->size, t->extra);
  }
-@@ -452,11 +456,11 @@ void inorder_test(void)
+@@ -468,11 +472,11 @@ void inorder_test(void)
  	unsigned long done = 0;
  	ktime_t start = ktime_get();
  
@@ -624,7 +634,7 @@
  
  		if (!(size % 4096))
  			printk(KERN_NOTICE "loop %u, %llu per us\n", size,
-@@ -502,30 +506,31 @@ void inorder_test(void)
+@@ -518,30 +522,31 @@ void inorder_test(void)
   * of the previous key so we can walk backwards to it from t->tree[j]'s key.
   */
  
@@ -663,7 +673,7 @@
  {
  	return (void *) (((uint64_t *) tree_to_bkey(t, j)) - t->prev[j]);
  }
-@@ -534,7 +539,7 @@ static struct bkey *tree_to_prev_bkey(struct bset_tree *t, unsigned j)
+@@ -550,7 +555,7 @@ static struct bkey *tree_to_prev_bkey(struct bset_tree *t, unsigned j)
   * For the write set - the one we're currently inserting keys into - we don't
   * maintain a full search tree, we just keep a simple lookup table in t->prev.
   */
@@ -672,10 +682,10 @@
  {
  	return cacheline_to_bkey(t, cacheline, t->prev[cacheline]);
  }
-@@ -546,14 +551,14 @@ static inline uint64_t shrd128(uint64_t high, uint64_t low, uint8_t shift)
- 	return low;
- }
- 
+@@ -576,14 +581,14 @@ static inline uint64_t shrd128(uint64_t high, uint64_t low, uint8_t shift)
+  * See make_bfloat() to check when most significant bit of f->exponent
+  * is set or not.
+  */
 -static inline unsigned bfloat_mantissa(const struct bkey *k,
 +static inline unsigned int bfloat_mantissa(const struct bkey *k,
  				       struct bkey_float *f)
@@ -689,7 +699,7 @@
  {
  	struct bkey_float *f = &t->tree[j];
  	struct bkey *m = tree_to_bkey(t, j);
-@@ -591,7 +596,7 @@ static void make_bfloat(struct bset_tree *t, unsigned j)
+@@ -631,7 +636,7 @@ static void make_bfloat(struct bset_tree *t, unsigned j)
  static void bset_alloc_tree(struct btree_keys *b, struct bset_tree *t)
  {
  	if (t != b->set) {
@@ -698,7 +708,7 @@
  				     64 / sizeof(struct bkey_float));
  
  		t->tree = t[-1].tree + j;
-@@ -637,13 +642,13 @@ void bch_bset_build_written_tree(struct btree_keys *b)
+@@ -686,13 +691,13 @@ void bch_bset_build_written_tree(struct btree_keys *b)
  {
  	struct bset_tree *t = bset_tree_last(b);
  	struct bkey *prev = NULL, *k = t->data->start;
@@ -714,7 +724,7 @@
  			bkey_to_cacheline(t, bset_bkey_last(t->data)),
  			b->set->tree + btree_keys_cachelines(b) - t->tree);
  
-@@ -683,7 +688,7 @@ EXPORT_SYMBOL(bch_bset_build_written_tree);
+@@ -732,7 +737,7 @@ EXPORT_SYMBOL(bch_bset_build_written_tree);
  void bch_bset_fix_invalidated_key(struct btree_keys *b, struct bkey *k)
  {
  	struct bset_tree *t;
@@ -723,7 +733,7 @@
  
  	for (t = b->set; t <= bset_tree_last(b); t++)
  		if (k < bset_bkey_last(t->data))
-@@ -730,8 +735,8 @@ static void bch_bset_fix_lookup_table(struct btree_keys *b,
+@@ -779,8 +784,8 @@ static void bch_bset_fix_lookup_table(struct btree_keys *b,
  				      struct bset_tree *t,
  				      struct bkey *k)
  {
@@ -734,7 +744,7 @@
  
  	/* We're getting called from btree_split() or btree_gc, just bail out */
  	if (!t->size)
-@@ -818,10 +823,10 @@ void bch_bset_insert(struct btree_keys *b, struct bkey *where,
+@@ -867,10 +872,10 @@ void bch_bset_insert(struct btree_keys *b, struct bkey *where,
  }
  EXPORT_SYMBOL(bch_bset_insert);
  
@@ -747,7 +757,7 @@
  	struct bset *i = bset_tree_last(b)->data;
  	struct bkey *m, *prev = NULL;
  	struct btree_iter iter;
-@@ -873,10 +878,10 @@ struct bset_search_iter {
+@@ -922,10 +927,10 @@ struct bset_search_iter {
  static struct bset_search_iter bset_search_write_set(struct bset_tree *t,
  						     const struct bkey *search)
  {
@@ -760,7 +770,7 @@
  
  		if (bkey_cmp(table_to_bkey(t, m), search) > 0)
  			ri = m;
-@@ -895,10 +900,10 @@ static struct bset_search_iter bset_search_tree(struct bset_tree *t,
+@@ -944,7 +949,7 @@ static struct bset_search_iter bset_search_tree(struct bset_tree *t,
  {
  	struct bkey *l, *r;
  	struct bkey_float *f;
@@ -768,12 +778,17 @@
 +	unsigned int inorder, j, n = 1;
  
  	do {
+ 		/*
+@@ -958,7 +963,7 @@ static struct bset_search_iter bset_search_tree(struct bset_tree *t,
+ 		 *		p = 0;
+ 		 * but a branch instruction is avoided.
+ 		 */
 -		unsigned p = n << 4;
 +		unsigned int p = n << 4;
  		p &= ((int) (p - t->size)) >> 31;
  
  		prefetch(&t->tree[p]);
-@@ -915,7 +920,7 @@ static struct bset_search_iter bset_search_tree(struct bset_tree *t,
+@@ -978,7 +983,7 @@ static struct bset_search_iter bset_search_tree(struct bset_tree *t,
  		 * to work  - that's done in make_bfloat()
  		 */
  		if (likely(f->exponent != 127))
@@ -782,7 +797,7 @@
  				      (f->mantissa -
  				       bfloat_mantissa(search, f))) >> 31);
  		else
-@@ -1121,7 +1126,8 @@ void bch_bset_sort_state_free(struct bset_sort_state *state)
+@@ -1184,7 +1189,8 @@ void bch_bset_sort_state_free(struct bset_sort_state *state)
  	mempool_exit(&state->pool);
  }
  
@@ -792,7 +807,7 @@
  {
  	spin_lock_init(&state->time.lock);
  
-@@ -1174,7 +1180,7 @@ static void btree_mergesort(struct btree_keys *b, struct bset *out,
+@@ -1237,7 +1243,7 @@ static void btree_mergesort(struct btree_keys *b, struct bset *out,
  }
  
  static void __btree_sort(struct btree_keys *b, struct btree_iter *iter,
@@ -801,7 +816,7 @@
  			 struct bset_sort_state *state)
  {
  	uint64_t start_time;
-@@ -1225,7 +1231,7 @@ static void __btree_sort(struct btree_keys *b, struct btree_iter *iter,
+@@ -1288,7 +1294,7 @@ static void __btree_sort(struct btree_keys *b, struct btree_iter *iter,
  		bch_time_stats_update(&state->time, start_time);
  }
  
@@ -810,7 +825,7 @@
  			    struct bset_sort_state *state)
  {
  	size_t order = b->page_order, keys = 0;
-@@ -1235,7 +1241,7 @@ void bch_btree_sort_partial(struct btree_keys *b, unsigned start,
+@@ -1298,7 +1304,7 @@ void bch_btree_sort_partial(struct btree_keys *b, unsigned start,
  	__bch_btree_iter_init(b, &iter, NULL, &b->set[start]);
  
  	if (start) {
@@ -819,7 +834,7 @@
  
  		for (i = start; i <= b->nsets; i++)
  			keys += b->set[i].data->keys;
-@@ -1275,7 +1281,7 @@ void bch_btree_sort_into(struct btree_keys *b, struct btree_keys *new,
+@@ -1338,7 +1344,7 @@ void bch_btree_sort_into(struct btree_keys *b, struct btree_keys *new,
  
  void bch_btree_sort_lazy(struct btree_keys *b, struct bset_sort_state *state)
  {
@@ -828,7 +843,7 @@
  	int i;
  
  	/* Don't sort if nothing to do */
-@@ -1304,7 +1310,7 @@ EXPORT_SYMBOL(bch_btree_sort_lazy);
+@@ -1367,7 +1373,7 @@ EXPORT_SYMBOL(bch_btree_sort_lazy);
  
  void bch_btree_keys_stats(struct btree_keys *b, struct bset_stats *stats)
  {
@@ -976,10 +991,10 @@
  #endif
  
 diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
-index 547c9eedc2f4..a80fd1106ed0 100644
+index c19f7716df88..96c39a8db895 100644
 --- a/drivers/md/bcache/btree.c
 +++ b/drivers/md/bcache/btree.c
-@@ -180,7 +180,7 @@ static void bch_btree_init_next(struct btree *b)
+@@ -183,7 +183,7 @@ static void bch_btree_init_next(struct btree *b)
  
  void bkey_put(struct cache_set *c, struct bkey *k)
  {
@@ -988,7 +1003,7 @@
  
  	for (i = 0; i < KEY_PTRS(k); i++)
  		if (ptr_available(c, k, i))
-@@ -476,7 +476,7 @@ void __bch_btree_node_write(struct btree *b, struct closure *parent)
+@@ -479,7 +479,7 @@ void __bch_btree_node_write(struct btree *b, struct closure *parent)
  
  void bch_btree_node_write(struct btree *b, struct closure *parent)
  {
@@ -997,7 +1012,7 @@
  
  	lockdep_assert_held(&b->lock);
  
-@@ -578,7 +578,7 @@ static void mca_bucket_free(struct btree *b)
+@@ -581,7 +581,7 @@ static void mca_bucket_free(struct btree *b)
  	list_move(&b->list, &b->c->btree_cache_freeable);
  }
  
@@ -1006,7 +1021,7 @@
  {
  	return ilog2(KEY_SIZE(k) / PAGE_SECTORS ?: 1);
  }
-@@ -586,7 +586,7 @@ static unsigned btree_order(struct bkey *k)
+@@ -589,7 +589,7 @@ static unsigned btree_order(struct bkey *k)
  static void mca_data_alloc(struct btree *b, struct bkey *k, gfp_t gfp)
  {
  	if (!bch_btree_keys_alloc(&b->keys,
@@ -1015,7 +1030,7 @@
  					ilog2(b->c->btree_pages),
  					btree_order(k)),
  				  gfp)) {
-@@ -617,7 +617,7 @@ static struct btree *mca_bucket_alloc(struct cache_set *c,
+@@ -620,7 +620,7 @@ static struct btree *mca_bucket_alloc(struct cache_set *c,
  	return b;
  }
  
@@ -1024,7 +1039,7 @@
  {
  	struct closure cl;
  
-@@ -783,7 +783,7 @@ void bch_btree_cache_free(struct cache_set *c)
+@@ -786,7 +786,7 @@ void bch_btree_cache_free(struct cache_set *c)
  
  int bch_btree_cache_alloc(struct cache_set *c)
  {
@@ -1033,7 +1048,7 @@
  
  	for (i = 0; i < mca_reserve(c); i++)
  		if (!mca_bucket_alloc(c, &ZERO_KEY, GFP_KERNEL))
-@@ -1133,7 +1133,7 @@ static struct btree *btree_node_alloc_replacement(struct btree *b,
+@@ -1136,7 +1136,7 @@ static struct btree *btree_node_alloc_replacement(struct btree *b,
  
  static void make_btree_freeing_key(struct btree *b, struct bkey *k)
  {
@@ -1042,7 +1057,7 @@
  
  	mutex_lock(&b->c->bucket_lock);
  
-@@ -1154,7 +1154,7 @@ static int btree_check_reserve(struct btree *b, struct btree_op *op)
+@@ -1157,7 +1157,7 @@ static int btree_check_reserve(struct btree *b, struct btree_op *op)
  {
  	struct cache_set *c = b->c;
  	struct cache *ca;
@@ -1051,7 +1066,7 @@
  
  	mutex_lock(&c->bucket_lock);
  
-@@ -1178,7 +1178,7 @@ static uint8_t __bch_btree_mark_key(struct cache_set *c, int level,
+@@ -1181,7 +1181,7 @@ static uint8_t __bch_btree_mark_key(struct cache_set *c, int level,
  				    struct bkey *k)
  {
  	uint8_t stale = 0;
@@ -1060,7 +1075,7 @@
  	struct bucket *g;
  
  	/*
-@@ -1216,7 +1216,7 @@ static uint8_t __bch_btree_mark_key(struct cache_set *c, int level,
+@@ -1219,7 +1219,7 @@ static uint8_t __bch_btree_mark_key(struct cache_set *c, int level,
  			SET_GC_MARK(g, GC_MARK_RECLAIMABLE);
  
  		/* guard against overflow */
@@ -1069,7 +1084,7 @@
  					     GC_SECTORS_USED(g) + KEY_SIZE(k),
  					     MAX_GC_SECTORS_USED));
  
-@@ -1230,7 +1230,7 @@ static uint8_t __bch_btree_mark_key(struct cache_set *c, int level,
+@@ -1233,7 +1233,7 @@ static uint8_t __bch_btree_mark_key(struct cache_set *c, int level,
  
  void bch_initial_mark_key(struct cache_set *c, int level, struct bkey *k)
  {
@@ -1078,7 +1093,7 @@
  
  	for (i = 0; i < KEY_PTRS(k); i++)
  		if (ptr_available(c, k, i) &&
-@@ -1256,7 +1256,7 @@ void bch_update_bucket_in_use(struct cache_set *c, struct gc_stat *stats)
+@@ -1259,7 +1259,7 @@ void bch_update_bucket_in_use(struct cache_set *c, struct gc_stat *stats)
  static bool btree_gc_mark_node(struct btree *b, struct gc_stat *gc)
  {
  	uint8_t stale = 0;
@@ -1087,7 +1102,7 @@
  	struct bkey *k;
  	struct btree_iter iter;
  	struct bset_tree *t;
-@@ -1299,7 +1299,7 @@ static bool btree_gc_mark_node(struct btree *b, struct gc_stat *gc)
+@@ -1302,7 +1302,7 @@ static bool btree_gc_mark_node(struct btree *b, struct gc_stat *gc)
  
  struct gc_merge_info {
  	struct btree	*b;
@@ -1096,7 +1111,7 @@
  };
  
  static int bch_btree_insert_node(struct btree *, struct btree_op *,
-@@ -1308,7 +1308,7 @@ static int bch_btree_insert_node(struct btree *, struct btree_op *,
+@@ -1311,7 +1311,7 @@ static int bch_btree_insert_node(struct btree *, struct btree_op *,
  static int btree_gc_coalesce(struct btree *b, struct btree_op *op,
  			     struct gc_stat *gc, struct gc_merge_info *r)
  {
@@ -1105,7 +1120,7 @@
  	struct btree *new_nodes[GC_MERGE_NODES];
  	struct keylist keylist;
  	struct closure cl;
-@@ -1508,11 +1508,11 @@ static int btree_gc_rewrite_node(struct btree *b, struct btree_op *op,
+@@ -1511,11 +1511,11 @@ static int btree_gc_rewrite_node(struct btree *b, struct btree_op *op,
  	return -EINTR;
  }
  
@@ -1119,7 +1134,7 @@
  
  	for_each_key_filter(&b->keys, k, &iter, bch_ptr_bad)
  		ret += bkey_u64s(k);
-@@ -1642,7 +1642,7 @@ static void btree_gc_start(struct cache_set *c)
+@@ -1678,7 +1678,7 @@ static void btree_gc_start(struct cache_set *c)
  {
  	struct cache *ca;
  	struct bucket *b;
@@ -1128,7 +1143,7 @@
  
  	if (!c->gc_mark_valid)
  		return;
-@@ -1668,7 +1668,7 @@ static void bch_btree_gc_finish(struct cache_set *c)
+@@ -1704,7 +1704,7 @@ static void bch_btree_gc_finish(struct cache_set *c)
  {
  	struct bucket *b;
  	struct cache *ca;
@@ -1137,7 +1152,7 @@
  
  	mutex_lock(&c->bucket_lock);
  
-@@ -1686,7 +1686,7 @@ static void bch_btree_gc_finish(struct cache_set *c)
+@@ -1722,7 +1722,7 @@ static void bch_btree_gc_finish(struct cache_set *c)
  		struct bcache_device *d = c->devices[i];
  		struct cached_dev *dc;
  		struct keybuf_key *w, *n;
@@ -1146,7 +1161,7 @@
  
  		if (!d || UUID_FLASH_ONLY(&c->uuids[i]))
  			continue;
-@@ -1775,7 +1775,7 @@ static void bch_btree_gc(struct cache_set *c)
+@@ -1814,7 +1814,7 @@ static void bch_btree_gc(struct cache_set *c)
  static bool gc_should_run(struct cache_set *c)
  {
  	struct cache *ca;
@@ -1155,7 +1170,7 @@
  
  	for_each_cache(ca, c, i)
  		if (ca->invalidate_needs_gc)
-@@ -1860,7 +1860,7 @@ void bch_initial_gc_finish(struct cache_set *c)
+@@ -1905,7 +1905,7 @@ void bch_initial_gc_finish(struct cache_set *c)
  {
  	struct cache *ca;
  	struct bucket *b;
@@ -1164,7 +1179,7 @@
  
  	bch_btree_gc_finish(c);
  
-@@ -1900,7 +1900,7 @@ void bch_initial_gc_finish(struct cache_set *c)
+@@ -1945,7 +1945,7 @@ void bch_initial_gc_finish(struct cache_set *c)
  static bool btree_insert_key(struct btree *b, struct bkey *k,
  			     struct bkey *replace_key)
  {
@@ -1173,7 +1188,7 @@
  
  	BUG_ON(bkey_cmp(k, &b->key) > 0);
  
-@@ -1999,7 +1999,7 @@ static int btree_split(struct btree *b, struct btree_op *op,
+@@ -2044,7 +2044,7 @@ static int btree_split(struct btree *b, struct btree_op *op,
  			   block_bytes(n1->c)) > (btree_blocks(b) * 4) / 5;
  
  	if (split) {
@@ -1182,7 +1197,7 @@
  
  		trace_bcache_btree_node_split(b, btree_bset_first(n1)->keys);
  
-@@ -2255,7 +2255,7 @@ int bch_btree_insert(struct cache_set *c, struct keylist *keys,
+@@ -2300,7 +2300,7 @@ int bch_btree_insert(struct cache_set *c, struct keylist *keys,
  
  void bch_btree_set_root(struct btree *b)
  {
@@ -1191,7 +1206,7 @@
  	struct closure cl;
  
  	closure_init_stack(&cl);
-@@ -2367,7 +2367,7 @@ static inline int keybuf_nonoverlapping_cmp(struct keybuf_key *l,
+@@ -2412,7 +2412,7 @@ static inline int keybuf_nonoverlapping_cmp(struct keybuf_key *l,
  
  struct refill {
  	struct btree_op	op;
@@ -1223,7 +1238,7 @@
  
  static inline void bch_btree_op_init(struct btree_op *op, int write_lock_level)
 diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h
-index 71427eb5fdae..07c631f1b7c7 100644
+index 7c2c5bc7c88b..7f3594c0be14 100644
 --- a/drivers/md/bcache/closure.h
 +++ b/drivers/md/bcache/closure.h
 @@ -159,7 +159,7 @@ struct closure {
@@ -1236,7 +1251,7 @@
  	unsigned long		ip;
  	unsigned long		waiting_on;
 diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
-index d030ce3025a6..e0fb31bba346 100644
+index 12034c07257b..0caad145902b 100644
 --- a/drivers/md/bcache/debug.c
 +++ b/drivers/md/bcache/debug.c
 @@ -69,7 +69,7 @@ void bch_btree_verify(struct btree *b)
@@ -1257,7 +1272,7 @@
  				block_bytes(b->c);
  
  			printk(KERN_ERR "*** on disk block %u:\n", block);
-@@ -172,7 +172,7 @@ static ssize_t bch_dump_read(struct file *file, char __user *buf,
+@@ -176,7 +176,7 @@ static ssize_t bch_dump_read(struct file *file, char __user *buf,
  
  	while (size) {
  		struct keybuf_key *w;
@@ -1433,7 +1448,7 @@
  		int us = t - b->submit_time_us;
  		int congested = atomic_read(&c->congested);
 diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
-index 18f1b5239620..9c6201109e14 100644
+index 10748c626a1d..ee61062b58fc 100644
 --- a/drivers/md/bcache/journal.c
 +++ b/drivers/md/bcache/journal.c
 @@ -32,7 +32,7 @@ static void journal_read_endio(struct bio *bio)
@@ -1598,7 +1613,7 @@
  		ca->heap.used = 0;
  
 diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
-index ae67f5fa8047..7769af040ec0 100644
+index 7dbe8b6316a0..6e1a60dd1742 100644
 --- a/drivers/md/bcache/request.c
 +++ b/drivers/md/bcache/request.c
 @@ -27,7 +27,7 @@ struct kmem_cache *bch_search_cache;
@@ -1693,7 +1708,7 @@
  			? min_t(uint64_t, INT_MAX,
  				KEY_START(k) - bio->bi_iter.bi_sector)
  			: INT_MAX;
-@@ -854,10 +854,10 @@ static void cached_dev_read_done_bh(struct closure *cl)
+@@ -856,10 +856,10 @@ static void cached_dev_read_done_bh(struct closure *cl)
  }
  
  static int cached_dev_cache_miss(struct btree *b, struct search *s,
@@ -1706,7 +1721,7 @@
  	struct cached_dev *dc = container_of(s->d, struct cached_dev, disk);
  	struct bio *miss, *cache_bio;
  
-@@ -1170,7 +1170,7 @@ static int cached_dev_congested(void *data, int bits)
+@@ -1226,7 +1226,7 @@ static int cached_dev_congested(void *data, int bits)
  		return 1;
  
  	if (cached_dev_get(dc)) {
@@ -1715,7 +1730,7 @@
  		struct cache *ca;
  
  		for_each_cache(ca, d->c, i) {
-@@ -1197,9 +1197,9 @@ void bch_cached_dev_request_init(struct cached_dev *dc)
+@@ -1253,9 +1253,9 @@ void bch_cached_dev_request_init(struct cached_dev *dc)
  /* Flash backed devices */
  
  static int flash_dev_cache_miss(struct btree *b, struct search *s,
@@ -1727,7 +1742,7 @@
  
  	swap(bio->bi_iter.bi_size, bytes);
  	zero_fill_bio(bio);
-@@ -1283,7 +1283,7 @@ static int flash_dev_congested(void *data, int bits)
+@@ -1338,7 +1338,7 @@ static int flash_dev_congested(void *data, int bits)
  	struct bcache_device *d = data;
  	struct request_queue *q;
  	struct cache *ca;
@@ -1825,7 +1840,7 @@
  
  struct cache_accounting {
 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
-index fa4058e43202..6a59fc47e0fe 100644
+index 32b95f3b9461..bd6c364ebdf8 100644
 --- a/drivers/md/bcache/super.c
 +++ b/drivers/md/bcache/super.c
 @@ -61,7 +61,7 @@ static const char *read_super(struct cache_sb *sb, struct block_device *bdev,
@@ -1891,7 +1906,7 @@
  	struct cache *ca;
  
  	for_each_cache(ca, d->c, i)
-@@ -713,7 +713,7 @@ static void bcache_device_detach(struct bcache_device *d)
+@@ -715,7 +715,7 @@ static void bcache_device_detach(struct bcache_device *d)
  }
  
  static void bcache_device_attach(struct bcache_device *d, struct cache_set *c,
@@ -1900,7 +1915,7 @@
  {
  	d->id = id;
  	d->c = c;
-@@ -760,7 +760,7 @@ static void bcache_device_free(struct bcache_device *d)
+@@ -762,7 +762,7 @@ static void bcache_device_free(struct bcache_device *d)
  	closure_debug_destroy(&d->cl);
  }
  
@@ -1909,7 +1924,7 @@
  			      sector_t sectors)
  {
  	struct request_queue *q;
-@@ -776,7 +776,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
+@@ -778,7 +778,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
  
  	if (!d->nr_stripes || d->nr_stripes > max_stripes) {
  		pr_err("nr_stripes too large or invalid: %u (start sector beyond end of disk?)",
@@ -1918,7 +1933,7 @@
  		return -ENOMEM;
  	}
  
-@@ -1203,7 +1203,7 @@ static void cached_dev_flush(struct closure *cl)
+@@ -1212,7 +1212,7 @@ static void cached_dev_flush(struct closure *cl)
  	continue_at(cl, cached_dev_free, system_wq);
  }
  
@@ -1927,7 +1942,7 @@
  {
  	int ret;
  	struct io *io;
-@@ -1477,7 +1477,7 @@ static void cache_set_free(struct closure *cl)
+@@ -1489,7 +1489,7 @@ static void cache_set_free(struct closure *cl)
  {
  	struct cache_set *c = container_of(cl, struct cache_set, cl);
  	struct cache *ca;
@@ -1936,7 +1951,7 @@
  
  	if (!IS_ERR_OR_NULL(c->debug))
  		debugfs_remove(c->debug);
-@@ -1520,7 +1520,7 @@ static void cache_set_flush(struct closure *cl)
+@@ -1532,7 +1532,7 @@ static void cache_set_flush(struct closure *cl)
  	struct cache_set *c = container_of(cl, struct cache_set, caching);
  	struct cache *ca;
  	struct btree *b;
@@ -1945,7 +1960,7 @@
  
  	bch_cache_accounting_destroy(&c->accounting);
  
-@@ -1749,7 +1749,7 @@ static void run_cache_set(struct cache_set *c)
+@@ -1762,7 +1762,7 @@ static void run_cache_set(struct cache_set *c)
  	struct cached_dev *dc, *t;
  	struct cache *ca;
  	struct closure cl;
@@ -1954,7 +1969,7 @@
  
  	closure_init_stack(&cl);
  
-@@ -1840,7 +1840,7 @@ static void run_cache_set(struct cache_set *c)
+@@ -1853,7 +1853,7 @@ static void run_cache_set(struct cache_set *c)
  		pr_notice("invalidating existing data");
  
  		for_each_cache(ca, c, i) {
@@ -1963,7 +1978,7 @@
  
  			ca->sb.keys = clamp_t(int, ca->sb.nbuckets >> 7,
  					      2, SB_JOURNAL_BUCKETS);
-@@ -1985,7 +1985,7 @@ static const char *register_cache_set(struct cache *ca)
+@@ -1998,7 +1998,7 @@ static const char *register_cache_set(struct cache *ca)
  void bch_cache_release(struct kobject *kobj)
  {
  	struct cache *ca = container_of(kobj, struct cache, kobj);
@@ -1972,7 +1987,7 @@
  
  	if (ca->set) {
  		BUG_ON(ca->set->cache[ca->sb.nr_this_dev] != ca);
-@@ -2137,7 +2137,7 @@ static bool bch_is_open_backing(struct block_device *bdev) {
+@@ -2150,7 +2150,7 @@ static bool bch_is_open_backing(struct block_device *bdev) {
  static bool bch_is_open_cache(struct block_device *bdev) {
  	struct cache_set *c, *tc;
  	struct cache *ca;
@@ -1982,10 +1997,10 @@
  	list_for_each_entry_safe(c, tc, &bch_cache_sets, list)
  		for_each_cache(ca, c, i)
 diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
-index 225b15aa0340..5fabee253448 100644
+index 22f8565d2bf1..0333180ba5a2 100644
 --- a/drivers/md/bcache/sysfs.c
 +++ b/drivers/md/bcache/sysfs.c
-@@ -287,7 +287,7 @@ STORE(__cached_dev)
+@@ -300,7 +300,7 @@ STORE(__cached_dev)
  		if (v < 0)
  			return v;
  
@@ -1994,7 +2009,7 @@
  			SET_BDEV_CACHE_MODE(&dc->sb, v);
  			bch_write_bdev_super(dc, NULL);
  		}
-@@ -513,9 +513,9 @@ static int bch_bset_print_stats(struct cache_set *c, char *buf)
+@@ -526,9 +526,9 @@ static int bch_bset_print_stats(struct cache_set *c, char *buf)
  			op.stats.floats, op.stats.failed);
  }
  
@@ -2006,7 +2021,7 @@
  	struct bkey *k;
  	struct btree *b;
  	struct btree_iter iter;
-@@ -550,9 +550,9 @@ static size_t bch_cache_size(struct cache_set *c)
+@@ -563,9 +563,9 @@ static size_t bch_cache_size(struct cache_set *c)
  	return ret;
  }
  
@@ -2018,7 +2033,7 @@
  	struct hlist_head *h;
  
  	mutex_lock(&c->bucket_lock);
-@@ -560,7 +560,7 @@ static unsigned bch_cache_max_chain(struct cache_set *c)
+@@ -573,7 +573,7 @@ static unsigned bch_cache_max_chain(struct cache_set *c)
  	for (h = c->bucket_hash;
  	     h < c->bucket_hash + (1 << BUCKET_HASH_BITS);
  	     h++) {
@@ -2027,7 +2042,7 @@
  		struct hlist_node *p;
  
  		hlist_for_each(p, h)
-@@ -573,13 +573,13 @@ static unsigned bch_cache_max_chain(struct cache_set *c)
+@@ -586,13 +586,13 @@ static unsigned bch_cache_max_chain(struct cache_set *c)
  	return ret;
  }
  
@@ -2043,7 +2058,7 @@
  {
  	return c->gc_stats.nkeys
  		? div64_u64(c->gc_stats.data, c->gc_stats.nkeys)
-@@ -976,7 +976,7 @@ STORE(__bch_cache)
+@@ -989,7 +989,7 @@ STORE(__bch_cache)
  		if (v < 0)
  			return v;
  
@@ -2053,7 +2068,7 @@
  			SET_CACHE_REPLACEMENT(&ca->sb, v);
  			mutex_unlock(&ca->set->bucket_lock);
 diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
-index cced87f8eb27..9486104fe304 100644
+index f7b0133c9d2f..484044231f21 100644
 --- a/drivers/md/bcache/util.h
 +++ b/drivers/md/bcache/util.h
 @@ -347,7 +347,7 @@ static inline int bch_strtoul_h(const char *cp, long *res)
@@ -2088,10 +2103,10 @@
  	x >>= fract_bits;
  	x   = 1 << x;
 diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
-index ad45ebe1a74b..91ceb32f7525 100644
+index 481d4cf38ac0..39ee38ffb2db 100644
 --- a/drivers/md/bcache/writeback.c
 +++ b/drivers/md/bcache/writeback.c
-@@ -163,7 +163,8 @@ static void update_writeback_rate(struct work_struct *work)
+@@ -215,7 +215,8 @@ static void update_writeback_rate(struct work_struct *work)
  	smp_mb();
  }
  
@@ -2101,7 +2116,7 @@
  {
  	if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) ||
  	    !dc->writeback_percent)
-@@ -211,7 +212,7 @@ static void write_dirty_finish(struct closure *cl)
+@@ -263,7 +264,7 @@ static void write_dirty_finish(struct closure *cl)
  	/* This is kind of a dumb way of signalling errors. */
  	if (KEY_DIRTY(&w->key)) {
  		int ret;
@@ -2110,7 +2125,7 @@
  		struct keylist keys;
  
  		bch_keylist_init(&keys);
-@@ -325,7 +326,7 @@ static void read_dirty_submit(struct closure *cl)
+@@ -377,7 +378,7 @@ static void read_dirty_submit(struct closure *cl)
  
  static void read_dirty(struct cached_dev *dc)
  {
@@ -2119,7 +2134,7 @@
  	struct keybuf_key *next, *keys[MAX_WRITEBACKS_IN_PASS], *w;
  	size_t size;
  	int nk, i;
-@@ -467,11 +468,11 @@ static void read_dirty(struct cached_dev *dc)
+@@ -498,11 +499,11 @@ static void read_dirty(struct cached_dev *dc)
  
  /* Scan for dirty data */
  
@@ -2133,7 +2148,7 @@
  
  	if (!d)
  		return;
-@@ -480,7 +481,7 @@ void bcache_dev_sectors_dirty_add(struct cache_set *c, unsigned inode,
+@@ -514,7 +515,7 @@ void bcache_dev_sectors_dirty_add(struct cache_set *c, unsigned inode,
  	stripe_offset = offset & (d->stripe_size - 1);
  
  	while (nr_sectors) {
@@ -2142,7 +2157,7 @@
  			      d->stripe_size - stripe_offset);
  
  		if (nr_sectors < 0)
-@@ -514,7 +515,7 @@ static bool dirty_pred(struct keybuf *buf, struct bkey *k)
+@@ -548,7 +549,7 @@ static bool dirty_pred(struct keybuf *buf, struct bkey *k)
  static void refill_full_stripes(struct cached_dev *dc)
  {
  	struct keybuf *buf = &dc->writeback_keys;
@@ -2151,7 +2166,7 @@
  	bool wrapped = false;
  
  	stripe = offset_to_stripe(&dc->disk, KEY_OFFSET(&buf->last_scanned));
-@@ -654,7 +655,7 @@ static int bch_writeback_thread(void *arg)
+@@ -688,7 +689,7 @@ static int bch_writeback_thread(void *arg)
  		read_dirty(dc);
  
  		if (searched_full_index) {
@@ -2160,20 +2175,20 @@
  
  			while (delay &&
  			       !kthread_should_stop() &&
-@@ -676,7 +677,7 @@ static int bch_writeback_thread(void *arg)
+@@ -712,7 +713,7 @@ static int bch_writeback_thread(void *arg)
  
  struct sectors_dirty_init {
  	struct btree_op	op;
 -	unsigned	inode;
 +	unsigned int	inode;
+ 	size_t		count;
+ 	struct bkey	start;
  };
- 
- static int sectors_dirty_init_fn(struct btree_op *_op, struct btree *b,
 diff --git a/drivers/md/bcache/writeback.h b/drivers/md/bcache/writeback.h
-index 610fb01de629..276696482c80 100644
+index 3745d7004c47..76b691850c98 100644
 --- a/drivers/md/bcache/writeback.h
 +++ b/drivers/md/bcache/writeback.h
-@@ -47,7 +47,7 @@ static inline uint64_t  bcache_flash_devs_sectors_dirty(struct cache_set *c)
+@@ -28,7 +28,7 @@ static inline uint64_t bcache_dev_sectors_dirty(struct bcache_device *d)
  	return ret;
  }
  
@@ -2182,7 +2197,7 @@
  					uint64_t offset)
  {
  	do_div(offset, d->stripe_size);
-@@ -56,9 +56,9 @@ static inline unsigned offset_to_stripe(struct bcache_device *d,
+@@ -37,9 +37,9 @@ static inline unsigned offset_to_stripe(struct bcache_device *d,
  
  static inline bool bcache_dev_stripe_dirty(struct cached_dev *dc,
  					   uint64_t offset,
@@ -2194,7 +2209,7 @@
  
  	while (1) {
  		if (atomic_read(dc->disk.stripe_sectors_dirty + stripe))
-@@ -73,9 +73,9 @@ static inline bool bcache_dev_stripe_dirty(struct cached_dev *dc,
+@@ -54,9 +54,9 @@ static inline bool bcache_dev_stripe_dirty(struct cached_dev *dc,
  }
  
  static inline bool should_writeback(struct cached_dev *dc, struct bio *bio,
@@ -2206,7 +2221,7 @@
  
  	if (cache_mode != CACHE_MODE_WRITEBACK ||
  	    test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) ||
-@@ -115,7 +115,7 @@ static inline void bch_writeback_add(struct cached_dev *dc)
+@@ -96,7 +96,7 @@ static inline void bch_writeback_add(struct cached_dev *dc)
  	}
  }
  
@@ -2216,7 +2231,7 @@
  void bch_sectors_dirty_init(struct bcache_device *);
  void bch_cached_dev_writeback_init(struct cached_dev *);
 diff --git a/include/uapi/linux/bcache.h b/include/uapi/linux/bcache.h
-index 821f71a2e48f..d50fa71daaca 100644
+index 8d19e02d752a..6bdcb48ee8cf 100644
 --- a/include/uapi/linux/bcache.h
 +++ b/include/uapi/linux/bcache.h
 @@ -30,10 +30,10 @@ struct bkey {
diff --git a/for-test/checkpatches_fixes/0002-bcache-style-fix-to-add-a-blank-line-after-declarati.patch b/for-next/checkpatch/0002-bcache-style-fix-to-add-a-blank-line-after-declarati.patch
similarity index 85%
rename from for-test/checkpatches_fixes/0002-bcache-style-fix-to-add-a-blank-line-after-declarati.patch
rename to for-next/checkpatch/0002-bcache-style-fix-to-add-a-blank-line-after-declarati.patch
index bafb26e..4e2fcff 100644
--- a/for-test/checkpatches_fixes/0002-bcache-style-fix-to-add-a-blank-line-after-declarati.patch
+++ b/for-next/checkpatch/0002-bcache-style-fix-to-add-a-blank-line-after-declarati.patch
@@ -1,7 +1,7 @@
-From b87c5de3a384a831dfc83c440da39c1106417663 Mon Sep 17 00:00:00 2001
+From b28468fa7325184ba444331ab92350d0f0ba6f91 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Tue, 26 Jun 2018 22:54:13 +0800
-Subject: [PATCH 02/18] bcache: style fix to add a blank line after
+Subject: [PATCH 02/17] bcache: style fix to add a blank line after
  declarations
 
 Signed-off-by: Coly Li <colyli@suse.de>
@@ -54,10 +54,10 @@
  			return -ENOMEM;
  
 diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
-index dd134c36ae92..5e96650f8d39 100644
+index 1ebd2d9d90d5..fd74dd075951 100644
 --- a/drivers/md/bcache/bcache.h
 +++ b/drivers/md/bcache/bcache.h
-@@ -781,6 +781,7 @@ static inline struct bucket *PTR_BUCKET(struct cache_set *c,
+@@ -783,6 +783,7 @@ static inline struct bucket *PTR_BUCKET(struct cache_set *c,
  static inline uint8_t gen_after(uint8_t a, uint8_t b)
  {
  	uint8_t r = a - b;
@@ -66,10 +66,10 @@
  }
  
 diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
-index e3576f279493..f24ea5a5dbd1 100644
+index dfda7e9efc3e..6fd5623b2e63 100644
 --- a/drivers/md/bcache/bset.c
 +++ b/drivers/md/bcache/bset.c
-@@ -555,6 +555,7 @@ static inline unsigned int bfloat_mantissa(const struct bkey *k,
+@@ -585,6 +585,7 @@ static inline unsigned int bfloat_mantissa(const struct bkey *k,
  				       struct bkey_float *f)
  {
  	const uint64_t *p = &k->low - (f->exponent >> 6);
@@ -77,15 +77,15 @@
  	return shrd128(p[-1], p[0], f->exponent & 63) & BKEY_MANTISSA_MASK;
  }
  
-@@ -904,6 +905,7 @@ static struct bset_search_iter bset_search_tree(struct bset_tree *t,
- 
- 	do {
+@@ -964,6 +965,7 @@ static struct bset_search_iter bset_search_tree(struct bset_tree *t,
+ 		 * but a branch instruction is avoided.
+ 		 */
  		unsigned int p = n << 4;
 +
  		p &= ((int) (p - t->size)) >> 31;
  
  		prefetch(&t->tree[p]);
-@@ -1051,6 +1053,7 @@ static struct bkey *__bch_btree_iter_init(struct btree_keys *b,
+@@ -1114,6 +1116,7 @@ static struct bkey *__bch_btree_iter_init(struct btree_keys *b,
  					  struct bset_tree *start)
  {
  	struct bkey *ret = NULL;
@@ -93,7 +93,7 @@
  	iter->size = ARRAY_SIZE(iter->data);
  	iter->used = 0;
  
-@@ -1266,8 +1269,8 @@ void bch_btree_sort_into(struct btree_keys *b, struct btree_keys *new,
+@@ -1329,8 +1332,8 @@ void bch_btree_sort_into(struct btree_keys *b, struct btree_keys *new,
  			 struct bset_sort_state *state)
  {
  	uint64_t start_time = local_clock();
@@ -104,10 +104,10 @@
  
  	btree_mergesort(b, new->set->data, &iter, false, true);
 diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
-index a80fd1106ed0..f10dacb4ce90 100644
+index 96c39a8db895..4003f92f4d2c 100644
 --- a/drivers/md/bcache/btree.c
 +++ b/drivers/md/bcache/btree.c
-@@ -284,6 +284,7 @@ void bch_btree_node_read_done(struct btree *b)
+@@ -287,6 +287,7 @@ void bch_btree_node_read_done(struct btree *b)
  static void btree_node_read_endio(struct bio *bio)
  {
  	struct closure *cl = bio->bi_private;
@@ -115,7 +115,7 @@
  	closure_put(cl);
  }
  
-@@ -601,6 +602,7 @@ static struct btree *mca_bucket_alloc(struct cache_set *c,
+@@ -604,6 +605,7 @@ static struct btree *mca_bucket_alloc(struct cache_set *c,
  				      struct bkey *k, gfp_t gfp)
  {
  	struct btree *b = kzalloc(sizeof(struct btree), gfp);
@@ -123,7 +123,7 @@
  	if (!b)
  		return NULL;
  
-@@ -743,6 +745,7 @@ void bch_btree_cache_free(struct cache_set *c)
+@@ -746,6 +748,7 @@ void bch_btree_cache_free(struct cache_set *c)
  {
  	struct btree *b;
  	struct closure cl;
@@ -131,7 +131,7 @@
  	closure_init_stack(&cl);
  
  	if (c->shrink.list.next)
-@@ -1121,6 +1124,7 @@ static struct btree *btree_node_alloc_replacement(struct btree *b,
+@@ -1124,6 +1127,7 @@ static struct btree *btree_node_alloc_replacement(struct btree *b,
  						  struct btree_op *op)
  {
  	struct btree *n = bch_btree_node_alloc(b->c, op, b->level, b->parent);
@@ -139,7 +139,7 @@
  	if (!IS_ERR_OR_NULL(n)) {
  		mutex_lock(&n->write_lock);
  		bch_btree_sort_into(&b->keys, &n->keys, &b->c->sort);
-@@ -2443,6 +2447,7 @@ void bch_refill_keybuf(struct cache_set *c, struct keybuf *buf,
+@@ -2488,6 +2492,7 @@ void bch_refill_keybuf(struct cache_set *c, struct keybuf *buf,
  
  	if (!RB_EMPTY_ROOT(&buf->keys)) {
  		struct keybuf_key *w;
@@ -147,7 +147,7 @@
  		w = RB_FIRST(&buf->keys, struct keybuf_key, node);
  		buf->start	= START_KEY(&w->key);
  
-@@ -2474,6 +2479,7 @@ bool bch_keybuf_check_overlapping(struct keybuf *buf, struct bkey *start,
+@@ -2519,6 +2524,7 @@ bool bch_keybuf_check_overlapping(struct keybuf *buf, struct bkey *start,
  {
  	bool ret = false;
  	struct keybuf_key *p, *w, s;
@@ -155,7 +155,7 @@
  	s.key = *start;
  
  	if (bkey_cmp(end, &buf->start) <= 0 ||
-@@ -2500,6 +2506,7 @@ bool bch_keybuf_check_overlapping(struct keybuf *buf, struct bkey *start,
+@@ -2545,6 +2551,7 @@ bool bch_keybuf_check_overlapping(struct keybuf *buf, struct bkey *start,
  struct keybuf_key *bch_keybuf_next(struct keybuf *buf)
  {
  	struct keybuf_key *w;
@@ -164,7 +164,7 @@
  
  	w = RB_FIRST(&buf->keys, struct keybuf_key, node);
 diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c
-index 0e14969182c6..0af954884e19 100644
+index 618253683d40..8570fc426e31 100644
 --- a/drivers/md/bcache/closure.c
 +++ b/drivers/md/bcache/closure.c
 @@ -162,6 +162,7 @@ static struct dentry *closure_debug;
@@ -176,10 +176,10 @@
  
  	list_for_each_entry(cl, &closure_list, all) {
 diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
-index e0fb31bba346..cdcab6fdbd13 100644
+index 0caad145902b..f0eb37a14dab 100644
 --- a/drivers/md/bcache/debug.c
 +++ b/drivers/md/bcache/debug.c
-@@ -173,8 +173,8 @@ static ssize_t bch_dump_read(struct file *file, char __user *buf,
+@@ -177,8 +177,8 @@ static ssize_t bch_dump_read(struct file *file, char __user *buf,
  	while (size) {
  		struct keybuf_key *w;
  		unsigned int bytes = min(i->bytes, size);
@@ -189,7 +189,7 @@
  		if (err)
  			return err;
  
-@@ -233,8 +233,8 @@ void bch_debug_init_cache_set(struct cache_set *c)
+@@ -237,8 +237,8 @@ void bch_debug_init_cache_set(struct cache_set *c)
  {
  	if (!IS_ERR_OR_NULL(bcache_debug)) {
  		char name[50];
@@ -272,7 +272,7 @@
  
  			ms = min(ms, CONGESTED_MAX + congested);
 diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
-index 9c6201109e14..6b992651d357 100644
+index ee61062b58fc..301cbb43a78f 100644
 --- a/drivers/md/bcache/journal.c
 +++ b/drivers/md/bcache/journal.c
 @@ -28,6 +28,7 @@
@@ -312,7 +312,7 @@
  }
  
 diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
-index 7769af040ec0..403bb58c117f 100644
+index 6e1a60dd1742..d15d8c5778ed 100644
 --- a/drivers/md/bcache/request.c
 +++ b/drivers/md/bcache/request.c
 @@ -45,6 +45,7 @@ static void bio_csum(struct bio *bio, struct bkey *k)
@@ -341,7 +341,7 @@
  		s->iop.status = bio->bi_status;
  		/* Only cache read errors are recoverable */
  		s->recoverable = false;
-@@ -1156,6 +1158,7 @@ static int cached_dev_ioctl(struct bcache_device *d, fmode_t mode,
+@@ -1212,6 +1214,7 @@ static int cached_dev_ioctl(struct bcache_device *d, fmode_t mode,
  			    unsigned int cmd, unsigned long arg)
  {
  	struct cached_dev *dc = container_of(d, struct cached_dev, disk);
@@ -378,7 +378,7 @@
  	atomic_inc(&c->accounting.collector.cache_miss_collisions);
  }
 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
-index 6a59fc47e0fe..6a6be7c47429 100644
+index bd6c364ebdf8..83b578733b3b 100644
 --- a/drivers/md/bcache/super.c
 +++ b/drivers/md/bcache/super.c
 @@ -415,8 +415,8 @@ static int __uuid_write(struct cache_set *c)
@@ -415,7 +415,7 @@
  	closure_put(&d->cl);
  }
  
-@@ -911,6 +914,7 @@ void bch_cached_dev_run(struct cached_dev *dc)
+@@ -919,6 +922,7 @@ void bch_cached_dev_run(struct cached_dev *dc)
  	if (!d->c &&
  	    BDEV_STATE(&dc->sb) != BDEV_STATE_NONE) {
  		struct closure cl;
@@ -423,7 +423,7 @@
  		closure_init_stack(&cl);
  
  		SET_BDEV_STATE(&dc->sb, BDEV_STATE_STALE);
-@@ -968,6 +972,7 @@ static void cached_dev_detach_finish(struct work_struct *w)
+@@ -976,6 +980,7 @@ static void cached_dev_detach_finish(struct work_struct *w)
  {
  	struct cached_dev *dc = container_of(w, struct cached_dev, detach);
  	struct closure cl;
@@ -431,7 +431,7 @@
  	closure_init_stack(&cl);
  
  	BUG_ON(!test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags));
-@@ -1095,6 +1100,7 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
+@@ -1103,6 +1108,7 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
  
  	if (bch_is_zero(u->uuid, 16)) {
  		struct closure cl;
@@ -439,15 +439,15 @@
  		closure_init_stack(&cl);
  
  		memcpy(u->uuid, dc->sb.uuid, 16);
-@@ -1310,6 +1316,7 @@ void bch_flash_dev_release(struct kobject *kobj)
+@@ -1320,6 +1326,7 @@ void bch_flash_dev_release(struct kobject *kobj)
  static void flash_dev_free(struct closure *cl)
  {
  	struct bcache_device *d = container_of(cl, struct bcache_device, cl);
 +
  	mutex_lock(&bch_register_lock);
- 	bcache_device_free(d);
- 	mutex_unlock(&bch_register_lock);
-@@ -1469,6 +1476,7 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...)
+ 	atomic_long_sub(bcache_dev_sectors_dirty(d),
+ 			&d->c->flash_dev_dirty_sectors);
+@@ -1481,6 +1488,7 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...)
  void bch_cache_set_release(struct kobject *kobj)
  {
  	struct cache_set *c = container_of(kobj, struct cache_set, kobj);
@@ -455,7 +455,7 @@
  	kfree(c);
  	module_put(THIS_MODULE);
  }
-@@ -1659,6 +1667,7 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)
+@@ -1671,6 +1679,7 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)
  {
  	int iter_size;
  	struct cache_set *c = kzalloc(sizeof(struct cache_set), GFP_KERNEL);
@@ -463,7 +463,7 @@
  	if (!c)
  		return NULL;
  
-@@ -2199,6 +2208,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
+@@ -2216,6 +2225,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
  	err = "failed to register device";
  	if (SB_IS_BDEV(sb)) {
  		struct cached_dev *dc = kzalloc(sizeof(*dc), GFP_KERNEL);
@@ -471,7 +471,7 @@
  		if (!dc)
  			goto err_close;
  
-@@ -2207,6 +2217,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
+@@ -2224,6 +2234,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
  		mutex_unlock(&bch_register_lock);
  	} else {
  		struct cache *ca = kzalloc(sizeof(*ca), GFP_KERNEL);
@@ -480,10 +480,10 @@
  			goto err_close;
  
 diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
-index 5fabee253448..7374b78e442e 100644
+index 0333180ba5a2..f8d7ceadb9ba 100644
 --- a/drivers/md/bcache/sysfs.c
 +++ b/drivers/md/bcache/sysfs.c
-@@ -439,6 +439,7 @@ STORE(__bch_flash_dev)
+@@ -452,6 +452,7 @@ STORE(__bch_flash_dev)
  
  	if (attr == &sysfs_size) {
  		uint64_t v;
@@ -491,7 +491,7 @@
  		strtoi_h_or_return(buf, v);
  
  		u->sectors = v >> 9;
-@@ -683,6 +684,7 @@ STORE(__bch_cache_set)
+@@ -696,6 +697,7 @@ STORE(__bch_cache_set)
  	if (attr == &sysfs_flash_vol_create) {
  		int r;
  		uint64_t v;
@@ -499,7 +499,7 @@
  		strtoi_h_or_return(buf, v);
  
  		r = bch_flash_dev_create(c, v);
-@@ -716,6 +718,7 @@ STORE(__bch_cache_set)
+@@ -729,6 +731,7 @@ STORE(__bch_cache_set)
  
  	if (attr == &sysfs_prune_cache) {
  		struct shrink_control sc;
@@ -507,7 +507,7 @@
  		sc.gfp_mask = GFP_KERNEL;
  		sc.nr_to_scan = strtoul_or_return(buf);
  		c->shrink.scan_objects(&c->shrink, &sc);
-@@ -769,12 +772,14 @@ STORE_LOCKED(bch_cache_set)
+@@ -782,12 +785,14 @@ STORE_LOCKED(bch_cache_set)
  SHOW(bch_cache_set_internal)
  {
  	struct cache_set *c = container_of(kobj, struct cache_set, internal);
@@ -523,7 +523,7 @@
  }
  
 diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
-index fc479b026d6d..5b1b92d605ca 100644
+index b15256bcf0e7..18016e7bb32c 100644
 --- a/drivers/md/bcache/util.c
 +++ b/drivers/md/bcache/util.c
 @@ -133,6 +133,7 @@ bool bch_is_zero(const char *p, size_t n)
@@ -535,10 +535,10 @@
  
  	for (i = 0, j = 0;
 diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
-index 91ceb32f7525..89b56dd9f562 100644
+index 39ee38ffb2db..44f1b0f1f4d9 100644
 --- a/drivers/md/bcache/writeback.c
 +++ b/drivers/md/bcache/writeback.c
-@@ -198,6 +198,7 @@ static void dirty_init(struct keybuf_key *w)
+@@ -250,6 +250,7 @@ static void dirty_init(struct keybuf_key *w)
  static void dirty_io_destructor(struct closure *cl)
  {
  	struct dirty_io *io = container_of(cl, struct dirty_io, cl);
@@ -547,7 +547,7 @@
  }
  
 diff --git a/include/uapi/linux/bcache.h b/include/uapi/linux/bcache.h
-index d50fa71daaca..f55e804c9694 100644
+index 6bdcb48ee8cf..5d4f58e059fd 100644
 --- a/include/uapi/linux/bcache.h
 +++ b/include/uapi/linux/bcache.h
 @@ -117,12 +117,14 @@ static inline void bkey_copy_key(struct bkey *dest, const struct bkey *src)
diff --git a/for-test/checkpatches_fixes/0003-bcache-add-identifier-names-to-arguments-of-function.patch b/for-next/checkpatch/0003-bcache-add-identifier-names-to-arguments-of-function.patch
similarity index 96%
rename from for-test/checkpatches_fixes/0003-bcache-add-identifier-names-to-arguments-of-function.patch
rename to for-next/checkpatch/0003-bcache-add-identifier-names-to-arguments-of-function.patch
index 7d8b4d9..0b0a144 100644
--- a/for-test/checkpatches_fixes/0003-bcache-add-identifier-names-to-arguments-of-function.patch
+++ b/for-next/checkpatch/0003-bcache-add-identifier-names-to-arguments-of-function.patch
@@ -1,7 +1,7 @@
-From c243de293d7cea6ee75f29d558e1559e0d169af0 Mon Sep 17 00:00:00 2001
+From d397574a468b43be217b8c4a2be6e0ac75c94648 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Mon, 23 Jul 2018 15:48:49 +0800
-Subject: [PATCH 03/18] bcache: add identifier names to arguments of function
+Subject: [PATCH 03/17] bcache: add identifier names to arguments of function
  definitions
 
 There are many function definitions do not have identifier argument names,
@@ -17,7 +17,7 @@
 
 Signed-off-by: Coly Li <colyli@suse.de>
 ---
- drivers/md/bcache/bcache.h    | 109 +++++++++++++++--------------
+ drivers/md/bcache/bcache.h    | 112 +++++++++++++++---------------
  drivers/md/bcache/bset.h      | 126 +++++++++++++++++++---------------
  drivers/md/bcache/btree.h     |  80 ++++++++++-----------
  drivers/md/bcache/debug.h     |   6 +-
@@ -27,10 +27,10 @@
  drivers/md/bcache/stats.h     |  13 ++--
  drivers/md/bcache/util.h      |  12 ++--
  drivers/md/bcache/writeback.h |   9 +--
- 10 files changed, 206 insertions(+), 177 deletions(-)
+ 10 files changed, 207 insertions(+), 179 deletions(-)
 
 diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
-index 5e96650f8d39..54d68d5df28b 100644
+index fd74dd075951..0bd505c61943 100644
 --- a/drivers/md/bcache/bcache.h
 +++ b/drivers/md/bcache/bcache.h
 @@ -273,9 +273,10 @@ struct bcache_device {
@@ -47,7 +47,7 @@
  };
  
  struct io {
-@@ -923,40 +924,43 @@ static inline void wait_for_kthread_stop(void)
+@@ -925,41 +926,43 @@ static inline void wait_for_kthread_stop(void)
  /* Forward declarations */
  
  void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio);
@@ -60,7 +60,8 @@
 -struct bio *bch_bbio_alloc(struct cache_set *);
 -
 -void __bch_submit_bbio(struct bio *, struct cache_set *);
--void bch_submit_bbio(struct bio *, struct cache_set *, struct bkey *, unsigned);
+-void bch_submit_bbio(struct bio *, struct cache_set *,
+-		     struct bkey *, unsigned int);
 -
 -uint8_t bch_inc_gen(struct cache *, struct bucket *);
 -void bch_rescale_priorities(struct cache_set *, int);
@@ -89,7 +90,7 @@
 +
 +void __bch_submit_bbio(struct bio *bio, struct cache_set *c);
 +void bch_submit_bbio(struct bio *bio, struct cache_set *c,
-+		     struct bkey *k, unsigned ptr);
++		     struct bkey *k, unsigned int ptr);
 +
 +uint8_t bch_inc_gen(struct cache *ca, struct bucket *b);
 +void bch_rescale_priorities(struct cache_set *c, int sectors);
@@ -121,7 +122,7 @@
  
  extern struct workqueue_struct *bcache_wq;
  extern struct mutex bch_register_lock;
-@@ -968,35 +972,36 @@ extern struct kobj_type bch_cache_set_ktype;
+@@ -971,30 +974,31 @@ extern struct kobj_type bch_cache_set_ktype;
  extern struct kobj_type bch_cache_set_internal_ktype;
  extern struct kobj_type bch_cache_ktype;
  
@@ -145,23 +146,25 @@
 -void bch_cached_dev_detach(struct cached_dev *);
 -void bch_cached_dev_run(struct cached_dev *);
 -void bcache_device_stop(struct bcache_device *);
-+int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
-+			  uint8_t *set_uuid);
-+void bch_cached_dev_detach(struct cached_dev *dc);
-+void bch_cached_dev_run(struct cached_dev *dc);
-+void bcache_device_stop(struct bcache_device *d);
- 
+-
 -void bch_cache_set_unregister(struct cache_set *);
 -void bch_cache_set_stop(struct cache_set *);
-+void bch_cache_set_unregister(struct cache_set *c);
-+void bch_cache_set_stop(struct cache_set *c);
- 
+-
 -struct cache_set *bch_cache_set_alloc(struct cache_sb *);
 -void bch_btree_cache_free(struct cache_set *);
 -int bch_btree_cache_alloc(struct cache_set *);
 -void bch_moving_init_cache_set(struct cache_set *);
 -int bch_open_buckets_alloc(struct cache_set *);
 -void bch_open_buckets_free(struct cache_set *);
++int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
++			  uint8_t *set_uuid);
++void bch_cached_dev_detach(struct cached_dev *dc);
++void bch_cached_dev_run(struct cached_dev *dc);
++void bcache_device_stop(struct bcache_device *d);
++
++void bch_cache_set_unregister(struct cache_set *c);
++void bch_cache_set_stop(struct cache_set *c);
++
 +struct cache_set *bch_cache_set_alloc(struct cache_sb *sb);
 +void bch_btree_cache_free(struct cache_set *c);
 +int bch_btree_cache_alloc(struct cache_set *c);
@@ -171,12 +174,6 @@
  
  int bch_cache_allocator_start(struct cache *ca);
  
- void bch_debug_exit(void);
--int bch_debug_init(struct kobject *);
-+int bch_debug_init(struct kobject *kobj);
- void bch_request_exit(void);
- int bch_request_init(void);
- 
 diff --git a/drivers/md/bcache/bset.h b/drivers/md/bcache/bset.h
 index fdc296103113..f5bf333aa40d 100644
 --- a/drivers/md/bcache/bset.h
@@ -582,7 +579,7 @@
  
  #endif /* _BCACHE_STATS_H_ */
 diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
-index 9486104fe304..98e8f97a8484 100644
+index 484044231f21..707d7f0c034e 100644
 --- a/drivers/md/bcache/util.h
 +++ b/drivers/md/bcache/util.h
 @@ -288,10 +288,10 @@ do {									\
@@ -611,10 +608,10 @@
  
  #endif /* _BCACHE_UTIL_H */
 diff --git a/drivers/md/bcache/writeback.h b/drivers/md/bcache/writeback.h
-index 276696482c80..cd513a89c412 100644
+index 76b691850c98..d2b9fdbc8994 100644
 --- a/drivers/md/bcache/writeback.h
 +++ b/drivers/md/bcache/writeback.h
-@@ -115,10 +115,11 @@ static inline void bch_writeback_add(struct cached_dev *dc)
+@@ -96,10 +96,11 @@ static inline void bch_writeback_add(struct cached_dev *dc)
  	}
  }
  
diff --git a/for-test/checkpatches_fixes/0004-bcache-style-fixes-for-lines-over-80-characters.patch b/for-next/checkpatch/0004-bcache-style-fixes-for-lines-over-80-characters.patch
similarity index 89%
rename from for-test/checkpatches_fixes/0004-bcache-style-fixes-for-lines-over-80-characters.patch
rename to for-next/checkpatch/0004-bcache-style-fixes-for-lines-over-80-characters.patch
index 0b7e26b..6b1afdb 100644
--- a/for-test/checkpatches_fixes/0004-bcache-style-fixes-for-lines-over-80-characters.patch
+++ b/for-next/checkpatch/0004-bcache-style-fixes-for-lines-over-80-characters.patch
@@ -1,7 +1,7 @@
-From 46033696b761f575c915064c4136e7acac40d820 Mon Sep 17 00:00:00 2001
+From 791a0350c5765c86ecd5e26ec6d0665641ace612 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Mon, 23 Jul 2018 17:47:45 +0800
-Subject: [PATCH 04/18] bcache: style fixes for lines over 80 characters
+Subject: [PATCH 04/17] bcache: style fixes for lines over 80 characters
 
 This patch fixes the lines over 80 characters into more lines, to minimize
 warnings by checkpatch.pl. There are still some lines exceed 80 characters,
@@ -25,10 +25,10 @@
  13 files changed, 59 insertions(+), 28 deletions(-)
 
 diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
-index 54d68d5df28b..2c235772ee1e 100644
+index 0bd505c61943..031a75a25d3e 100644
 --- a/drivers/md/bcache/bcache.h
 +++ b/drivers/md/bcache/bcache.h
-@@ -612,8 +612,8 @@ struct cache_set {
+@@ -614,8 +614,8 @@ struct cache_set {
  	uint16_t		min_prio;
  
  	/*
@@ -40,7 +40,7 @@
  	uint8_t			need_gc;
  	struct gc_stat		gc_stats;
 diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
-index f24ea5a5dbd1..15a5de96e8eb 100644
+index 6fd5623b2e63..19b4febe5b45 100644
 --- a/drivers/md/bcache/bset.c
 +++ b/drivers/md/bcache/bset.c
 @@ -311,7 +311,9 @@ void bch_btree_keys_free(struct btree_keys *b)
@@ -54,7 +54,7 @@
  {
  	struct bset_tree *t = b->set;
  
-@@ -459,7 +461,8 @@ void inorder_test(void)
+@@ -475,7 +477,8 @@ void inorder_test(void)
  	for (unsigned int size = 2;
  	     size < 65536000;
  	     size++) {
@@ -64,7 +64,7 @@
  		unsigned int i = 1, j = rounddown_pow_of_two(size - 1);
  
  		if (!(size % 4096))
-@@ -776,7 +779,8 @@ static void bch_bset_fix_lookup_table(struct btree_keys *b,
+@@ -825,7 +828,8 @@ static void bch_bset_fix_lookup_table(struct btree_keys *b,
  	     k != bset_bkey_last(t->data);
  	     k = bkey_next(k))
  		if (t->size == bkey_to_cacheline(t, k)) {
@@ -96,10 +96,10 @@
  	return bset_byte_offset(b, i) >> 9;
  }
 diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
-index f10dacb4ce90..100ebce164b1 100644
+index 4003f92f4d2c..afd691b4cb6e 100644
 --- a/drivers/md/bcache/btree.c
 +++ b/drivers/md/bcache/btree.c
-@@ -433,7 +433,10 @@ static void do_btree_node_write(struct btree *b)
+@@ -436,7 +436,10 @@ static void do_btree_node_write(struct btree *b)
  
  		continue_at(cl, btree_node_write_done, NULL);
  	} else {
@@ -128,7 +128,7 @@
  void bch_update_bucket_in_use(struct cache_set *c, struct gc_stat *stats);
  #endif
 diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
-index cdcab6fdbd13..d913509dd9d2 100644
+index f0eb37a14dab..a8f70c916fdb 100644
 --- a/drivers/md/bcache/debug.c
 +++ b/drivers/md/bcache/debug.c
 @@ -67,7 +67,8 @@ void bch_btree_verify(struct btree *b)
@@ -157,7 +157,7 @@
  	struct btree *b = container_of(bk, struct btree, keys);
  	unsigned int i;
 diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
-index 6b992651d357..cab5f62ec7c3 100644
+index 301cbb43a78f..c0cb8ff187c2 100644
 --- a/drivers/md/bcache/journal.c
 +++ b/drivers/md/bcache/journal.c
 @@ -193,7 +193,8 @@ int bch_journal_read(struct cache_set *c, struct list_head *list)
@@ -171,7 +171,7 @@
  				goto bsearch;
  
 diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
-index 403bb58c117f..b6b22c4f3ce2 100644
+index d15d8c5778ed..50c0de5f95b4 100644
 --- a/drivers/md/bcache/request.c
 +++ b/drivers/md/bcache/request.c
 @@ -136,7 +136,9 @@ static void bch_data_invalidate(struct closure *cl)
@@ -185,7 +185,7 @@
  	}
  
  	op->insert_data_done = true;
-@@ -813,7 +815,8 @@ static void cached_dev_read_done(struct closure *cl)
+@@ -815,7 +817,8 @@ static void cached_dev_read_done(struct closure *cl)
  
  	if (s->iop.bio) {
  		bio_reset(s->iop.bio);
@@ -196,7 +196,7 @@
  		s->iop.bio->bi_iter.bi_size = s->insert_bio_sectors << 9;
  		bch_bio_map(s->iop.bio, NULL);
 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
-index 6a6be7c47429..c61a7c5669a6 100644
+index 83b578733b3b..8cba2378734a 100644
 --- a/drivers/md/bcache/super.c
 +++ b/drivers/md/bcache/super.c
 @@ -149,7 +149,8 @@ static const char *read_super(struct cache_sb *sb, struct block_device *bdev,
@@ -219,7 +219,7 @@
  				pr_warn("bad csum reading priorities");
  
  			if (p->magic != pset_magic(&ca->sb))
-@@ -1727,8 +1729,8 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)
+@@ -1740,8 +1742,8 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)
  	if (!(c->devices = kcalloc(c->nr_uuids, sizeof(void *), GFP_KERNEL)) ||
  	    mempool_init_slab_pool(&c->search, 32, bch_search_cache) ||
  	    mempool_init_kmalloc_pool(&c->bio_meta, 2,
@@ -230,7 +230,7 @@
  	    mempool_init_kmalloc_pool(&c->fill_iter, 1, iter_size) ||
  	    bioset_init(&c->bio_split, 4, offsetof(struct bbio, bio),
  			BIOSET_NEED_BVECS|BIOSET_NEED_RESCUER) ||
-@@ -1800,7 +1802,9 @@ static void run_cache_set(struct cache_set *c)
+@@ -1813,7 +1815,9 @@ static void run_cache_set(struct cache_set *c)
  			goto err;
  
  		err = "error reading btree root";
@@ -241,7 +241,7 @@
  		if (IS_ERR_OR_NULL(c->root))
  			goto err;
  
-@@ -2094,7 +2098,9 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page,
+@@ -2107,7 +2111,9 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page,
  		goto err;
  	}
  
@@ -253,7 +253,7 @@
  		ret = -ENOMEM;
  		goto out;
 diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
-index 7374b78e442e..5476ee74f301 100644
+index f8d7ceadb9ba..2ed503ab9e5c 100644
 --- a/drivers/md/bcache/sysfs.c
 +++ b/drivers/md/bcache/sysfs.c
 @@ -130,8 +130,10 @@ rw_attribute(btree_shrinker_disabled);
@@ -269,7 +269,7 @@
  {
  	char *out = buf;
  	size_t i;
-@@ -321,8 +323,9 @@ STORE(__cached_dev)
+@@ -334,8 +336,9 @@ STORE(__cached_dev)
  		add_uevent_var(env, "DRIVER=bcache");
  		add_uevent_var(env, "CACHED_UUID=%pU", dc->sb.uuid),
  		add_uevent_var(env, "CACHED_LABEL=%s", buf);
@@ -282,7 +282,7 @@
  	}
  
 diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
-index 98e8f97a8484..4afd3743da6b 100644
+index 707d7f0c034e..4e0ed19e32d3 100644
 --- a/drivers/md/bcache/util.h
 +++ b/drivers/md/bcache/util.h
 @@ -402,7 +402,8 @@ do {									\
@@ -296,10 +296,10 @@
  	sysfs_print(name ## _last_ ## frequency_units, (stats)->last	\
  		    ? div_s64(local_clock() - (stats)->last,		\
 diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
-index 89b56dd9f562..e8bd02061a11 100644
+index 44f1b0f1f4d9..e40bf0e403e7 100644
 --- a/drivers/md/bcache/writeback.c
 +++ b/drivers/md/bcache/writeback.c
-@@ -392,7 +392,8 @@ static void read_dirty(struct cached_dev *dc)
+@@ -444,7 +444,8 @@ static void read_dirty(struct cached_dev *dc)
  
  			io = kzalloc(sizeof(struct dirty_io) +
  				     sizeof(struct bio_vec) *
@@ -309,7 +309,7 @@
  				     GFP_KERNEL);
  			if (!io)
  				goto err;
-@@ -506,7 +507,9 @@ void bcache_dev_sectors_dirty_add(struct cache_set *c, unsigned int inode,
+@@ -540,7 +541,9 @@ void bcache_dev_sectors_dirty_add(struct cache_set *c, unsigned int inode,
  
  static bool dirty_pred(struct keybuf *buf, struct bkey *k)
  {
diff --git a/for-test/checkpatches_fixes/0005-bcache-replace-Symbolic-permissions-by-octal-permiss.patch b/for-next/checkpatch/0005-bcache-replace-Symbolic-permissions-by-octal-permiss.patch
similarity index 88%
rename from for-test/checkpatches_fixes/0005-bcache-replace-Symbolic-permissions-by-octal-permiss.patch
rename to for-next/checkpatch/0005-bcache-replace-Symbolic-permissions-by-octal-permiss.patch
index f934c53..ffc8b95 100644
--- a/for-test/checkpatches_fixes/0005-bcache-replace-Symbolic-permissions-by-octal-permiss.patch
+++ b/for-next/checkpatch/0005-bcache-replace-Symbolic-permissions-by-octal-permiss.patch
@@ -1,7 +1,7 @@
-From 16e58d576f558f80846b3e84bff0cd49580fa05c Mon Sep 17 00:00:00 2001
+From 44ebd72e06bb67ed28fc99bb1f822b59bac655f8 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Mon, 23 Jul 2018 18:41:00 +0800
-Subject: [PATCH 05/18] bcache: replace Symbolic permissions by octal
+Subject: [PATCH 05/17] bcache: replace Symbolic permissions by octal
  permission numbers
 
 Symbolic permission names are used in bcache, for now octal permission
@@ -15,10 +15,10 @@
  2 files changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
-index 2c235772ee1e..0a2c65842fd8 100644
+index 031a75a25d3e..66e6d5639b38 100644
 --- a/drivers/md/bcache/bcache.h
 +++ b/drivers/md/bcache/bcache.h
-@@ -879,11 +879,11 @@ static inline uint8_t bucket_gc_gen(struct bucket *b)
+@@ -881,11 +881,11 @@ static inline uint8_t bucket_gc_gen(struct bucket *b)
  #define BUCKET_GC_GEN_MAX	96U
  
  #define kobj_attribute_write(n, fn)					\
diff --git a/for-test/checkpatches_fixes/0006-bcache-replace-printk-by-pr_-routines.patch b/for-next/checkpatch/0006-bcache-replace-printk-by-pr_-routines.patch
similarity index 91%
rename from for-test/checkpatches_fixes/0006-bcache-replace-printk-by-pr_-routines.patch
rename to for-next/checkpatch/0006-bcache-replace-printk-by-pr_-routines.patch
index 47ffbf7..55cf17e 100644
--- a/for-test/checkpatches_fixes/0006-bcache-replace-printk-by-pr_-routines.patch
+++ b/for-next/checkpatch/0006-bcache-replace-printk-by-pr_-routines.patch
@@ -1,7 +1,7 @@
-From 6c2682ed9c475ff487403bfba1e9bf54a02055bd Mon Sep 17 00:00:00 2001
+From 328a45adf7a491d664404a6f3a8ec06695bcc35d Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Mon, 23 Jul 2018 23:32:05 +0800
-Subject: [PATCH 06/18] bcache: replace printk() by pr_*() routines
+Subject: [PATCH 06/17] bcache: replace printk() by pr_*() routines
 
 There are still many places in bcache use printk to display kernel
 message, which are suggested to be preplaced by pr_*() routines like
@@ -19,7 +19,7 @@
  4 files changed, 15 insertions(+), 15 deletions(-)
 
 diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
-index 15a5de96e8eb..ab4bcb3c155f 100644
+index 19b4febe5b45..b6a3f9d291a9 100644
 --- a/drivers/md/bcache/bset.c
 +++ b/drivers/md/bcache/bset.c
 @@ -25,18 +25,18 @@ void bch_dump_bset(struct btree_keys *b, struct bset *i, unsigned int set)
@@ -44,7 +44,7 @@
  	}
  }
  
-@@ -466,7 +466,7 @@ void inorder_test(void)
+@@ -482,7 +482,7 @@ void inorder_test(void)
  		unsigned int i = 1, j = rounddown_pow_of_two(size - 1);
  
  		if (!(size % 4096))
@@ -54,7 +54,7 @@
  
  		while (1) {
 diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
-index d913509dd9d2..1e4d4c6acc0b 100644
+index a8f70c916fdb..06da66b2488a 100644
 --- a/drivers/md/bcache/debug.c
 +++ b/drivers/md/bcache/debug.c
 @@ -74,28 +74,28 @@ void bch_btree_verify(struct btree *b)
@@ -119,10 +119,10 @@
  
  /* Btree ptrs */
 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
-index c61a7c5669a6..4b86f40e1ee9 100644
+index 8cba2378734a..eac0d5d1ada3 100644
 --- a/drivers/md/bcache/super.c
 +++ b/drivers/md/bcache/super.c
-@@ -1460,13 +1460,13 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...)
+@@ -1472,13 +1472,13 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...)
  	acquire_console_sem();
  	*/
  
diff --git a/for-test/checkpatches_fixes/0007-bcache-fix-indent-by-replacing-blank-by-tabs.patch b/for-next/checkpatch/0007-bcache-fix-indent-by-replacing-blank-by-tabs.patch
similarity index 76%
rename from for-test/checkpatches_fixes/0007-bcache-fix-indent-by-replacing-blank-by-tabs.patch
rename to for-next/checkpatch/0007-bcache-fix-indent-by-replacing-blank-by-tabs.patch
index 8e0bf33..27dd4b5 100644
--- a/for-test/checkpatches_fixes/0007-bcache-fix-indent-by-replacing-blank-by-tabs.patch
+++ b/for-next/checkpatch/0007-bcache-fix-indent-by-replacing-blank-by-tabs.patch
@@ -1,7 +1,7 @@
-From 39dc76caa58ad3f58b7fb6145f2ec7fc7dd40d47 Mon Sep 17 00:00:00 2001
+From b4609c74fff03a354cc95f33e20d21399b340790 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Mon, 23 Jul 2018 23:48:36 +0800
-Subject: [PATCH 07/18] bcache: fix indent by replacing blank by tabs
+Subject: [PATCH 07/17] bcache: fix indent by replacing blank by tabs
 
 bch_btree_insert_check_key() has unaligned indent, or indent by blank
 characters. This patch makes the indent aligned and replace blank by
@@ -13,10 +13,10 @@
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
-index 100ebce164b1..9b3866c80390 100644
+index afd691b4cb6e..a072e3a6c91d 100644
 --- a/drivers/md/bcache/btree.c
 +++ b/drivers/md/bcache/btree.c
-@@ -2184,10 +2184,10 @@ int bch_btree_insert_check_key(struct btree *b, struct btree_op *op,
+@@ -2229,10 +2229,10 @@ int bch_btree_insert_check_key(struct btree *b, struct btree_op *op,
  		rw_lock(true, b, b->level);
  
  		if (b->key.ptr[0] != btree_ptr ||
diff --git a/for-test/checkpatches_fixes/0008-bcache-replace-pF-by-pS-in-seq_printf.patch b/for-next/checkpatch/0008-bcache-replace-pF-by-pS-in-seq_printf.patch
similarity index 86%
rename from for-test/checkpatches_fixes/0008-bcache-replace-pF-by-pS-in-seq_printf.patch
rename to for-next/checkpatch/0008-bcache-replace-pF-by-pS-in-seq_printf.patch
index 119caae..cab91c7 100644
--- a/for-test/checkpatches_fixes/0008-bcache-replace-pF-by-pS-in-seq_printf.patch
+++ b/for-next/checkpatch/0008-bcache-replace-pF-by-pS-in-seq_printf.patch
@@ -1,7 +1,7 @@
-From 677e3ea7f841d448b34c6f73512a13cbe5f9a27b Mon Sep 17 00:00:00 2001
+From 824da360eb6859eb989e59a7cfb813861629371b Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Mon, 23 Jul 2018 23:57:40 +0800
-Subject: [PATCH 08/18] bcache: replace '%pF' by '%pS' in seq_printf()
+Subject: [PATCH 08/17] bcache: replace '%pF' by '%pS' in seq_printf()
 
 '%pF' and '%pf' are deprecated vsprintf pointer extensions, this patch
 replace them by '%pS', which is suggested by checkpatch.pl.
@@ -12,7 +12,7 @@
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c
-index 0af954884e19..2aab25122f3c 100644
+index 8570fc426e31..034067e0e9ce 100644
 --- a/drivers/md/bcache/closure.c
 +++ b/drivers/md/bcache/closure.c
 @@ -168,7 +168,7 @@ static int debug_seq_show(struct seq_file *f, void *data)
diff --git a/for-test/checkpatches_fixes/0009-bcache-fix-typo-succesfully-to-successfully.patch b/for-next/checkpatch/0009-bcache-fix-typo-succesfully-to-successfully.patch
similarity index 88%
rename from for-test/checkpatches_fixes/0009-bcache-fix-typo-succesfully-to-successfully.patch
rename to for-next/checkpatch/0009-bcache-fix-typo-succesfully-to-successfully.patch
index 09f4ac0..4fec628 100644
--- a/for-test/checkpatches_fixes/0009-bcache-fix-typo-succesfully-to-successfully.patch
+++ b/for-next/checkpatch/0009-bcache-fix-typo-succesfully-to-successfully.patch
@@ -1,7 +1,7 @@
-From f9be5591944e408c41728751439f16e5ae41b237 Mon Sep 17 00:00:00 2001
+From 731b838846832a4f000120de378af6308d6254c1 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Tue, 24 Jul 2018 00:05:37 +0800
-Subject: [PATCH 09/18] bcache: fix typo 'succesfully' to 'successfully'
+Subject: [PATCH 09/17] bcache: fix typo 'succesfully' to 'successfully'
 
 This patch fixes typo 'succesfully' to correct 'successfully', which is
 suggested by checkpatch.pl.
@@ -26,7 +26,7 @@
  
  			count = atomic_cmpxchg(&ca->io_count, old, new);
 diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
-index b6b22c4f3ce2..86313f1ad89c 100644
+index 50c0de5f95b4..449baec3fa19 100644
 --- a/drivers/md/bcache/request.c
 +++ b/drivers/md/bcache/request.c
 @@ -154,7 +154,7 @@ static void bch_data_insert_error(struct closure *cl)
diff --git a/for-test/checkpatches_fixes/0010-bcache-prefer-help-in-Kconfig.patch b/for-next/checkpatch/0010-bcache-prefer-help-in-Kconfig.patch
similarity index 91%
rename from for-test/checkpatches_fixes/0010-bcache-prefer-help-in-Kconfig.patch
rename to for-next/checkpatch/0010-bcache-prefer-help-in-Kconfig.patch
index 31ad29e..7ae4d02 100644
--- a/for-test/checkpatches_fixes/0010-bcache-prefer-help-in-Kconfig.patch
+++ b/for-next/checkpatch/0010-bcache-prefer-help-in-Kconfig.patch
@@ -1,7 +1,7 @@
-From 3ff465e44c9b2e59b14e95aa3004751bda27bd87 Mon Sep 17 00:00:00 2001
+From 3e6b1731ddc9c2ef2515792489f17dc3fa15332d Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Fri, 27 Jul 2018 13:15:11 +0800
-Subject: [PATCH 10/18] bcache: prefer 'help' in Kconfig
+Subject: [PATCH 10/17] bcache: prefer 'help' in Kconfig
 
 Current bcache Kconfig uses '---help---' as header of help information,
 for now 'help' is prefered. This patch fixes this style by replacing
diff --git a/for-test/checkpatches_fixes/0011-bcache-do-not-check-NULL-pointer-before-calling-kmem.patch b/for-next/checkpatch/0011-bcache-do-not-check-NULL-pointer-before-calling-kmem.patch
similarity index 76%
rename from for-test/checkpatches_fixes/0011-bcache-do-not-check-NULL-pointer-before-calling-kmem.patch
rename to for-next/checkpatch/0011-bcache-do-not-check-NULL-pointer-before-calling-kmem.patch
index ba308de..d2aa326 100644
--- a/for-test/checkpatches_fixes/0011-bcache-do-not-check-NULL-pointer-before-calling-kmem.patch
+++ b/for-next/checkpatch/0011-bcache-do-not-check-NULL-pointer-before-calling-kmem.patch
@@ -1,7 +1,7 @@
-From 7efbeb16f87dbae9e74cbd866bdc1787d88010b3 Mon Sep 17 00:00:00 2001
+From 6cd7a6f136a68042504d67a6045763808e16b2a0 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Fri, 27 Jul 2018 13:18:25 +0800
-Subject: [PATCH 11/18] bcache: do not check NULL pointer before calling
+Subject: [PATCH 11/17] bcache: do not check NULL pointer before calling
  kmem_cache_destroy
 
 kmem_cache_destroy() is safe for NULL pointer as input, the NULL pointer
@@ -14,10 +14,10 @@
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
-index 86313f1ad89c..788f5a3a4386 100644
+index 449baec3fa19..4bdcec9167a0 100644
 --- a/drivers/md/bcache/request.c
 +++ b/drivers/md/bcache/request.c
-@@ -1312,8 +1312,7 @@ void bch_flash_dev_request_init(struct bcache_device *d)
+@@ -1367,8 +1367,7 @@ void bch_flash_dev_request_init(struct bcache_device *d)
  
  void bch_request_exit(void)
  {
diff --git a/for-test/checkpatches_fixes/0012-bcache-fix-code-comments-style.patch b/for-next/checkpatch/0012-bcache-fix-code-comments-style.patch
similarity index 84%
rename from for-test/checkpatches_fixes/0012-bcache-fix-code-comments-style.patch
rename to for-next/checkpatch/0012-bcache-fix-code-comments-style.patch
index 1790d37..916076d 100644
--- a/for-test/checkpatches_fixes/0012-bcache-fix-code-comments-style.patch
+++ b/for-next/checkpatch/0012-bcache-fix-code-comments-style.patch
@@ -1,7 +1,7 @@
-From d2953308e388bea078fea88abb8fc64e42cf47da Mon Sep 17 00:00:00 2001
+From 44c5ef49d0bf742da2a56a28ec66d0974a3ae73a Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Fri, 27 Jul 2018 15:47:19 +0800
-Subject: [PATCH 12/18] bcache: fix code comments style
+Subject: [PATCH 12/17] bcache: fix code comments style
 
 This patch fixes 3 style issues warned by checkpatch.pl,
 - Comment lines are not aligned
@@ -14,7 +14,7 @@
  1 file changed, 13 insertions(+), 9 deletions(-)
 
 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
-index 4b86f40e1ee9..3bb0e8299e4c 100644
+index eac0d5d1ada3..a8b751ba3ebc 100644
 --- a/drivers/md/bcache/super.c
 +++ b/drivers/md/bcache/super.c
 @@ -465,8 +465,8 @@ static struct uuid_entry *uuid_find_empty(struct cache_set *c)
@@ -28,7 +28,7 @@
   *
   * See alloc.c for an explanation of the gen. The priority is used to implement
   * lru (and in the future other) cache replacement policies; for most purposes
-@@ -926,8 +926,10 @@ void bch_cached_dev_run(struct cached_dev *dc)
+@@ -934,8 +934,10 @@ void bch_cached_dev_run(struct cached_dev *dc)
  
  	add_disk(d->disk);
  	bd_link_disk_holder(dc->bdev, dc->disk.disk);
@@ -41,7 +41,7 @@
  	kobject_uevent_env(&disk_to_dev(d->disk)->kobj, KOBJ_CHANGE, env);
  	kfree(env[1]);
  	kfree(env[2]);
-@@ -1096,8 +1098,9 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
+@@ -1104,8 +1106,9 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
  		}
  	}
  
@@ -53,7 +53,7 @@
  	 */
  
  	if (bch_is_zero(u->uuid, 16)) {
-@@ -1456,9 +1459,10 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...)
+@@ -1468,9 +1471,10 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...)
  	if (test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags))
  		pr_info("CACHE_SET_IO_DISABLE already set");
  
diff --git a/for-test/checkpatches_fixes/0013-bcache-add-static-const-prefix-to-char-array-declara.patch b/for-next/checkpatch/0013-bcache-add-static-const-prefix-to-char-array-declara.patch
similarity index 79%
rename from for-test/checkpatches_fixes/0013-bcache-add-static-const-prefix-to-char-array-declara.patch
rename to for-next/checkpatch/0013-bcache-add-static-const-prefix-to-char-array-declara.patch
index b418692..3b91c74 100644
--- a/for-test/checkpatches_fixes/0013-bcache-add-static-const-prefix-to-char-array-declara.patch
+++ b/for-next/checkpatch/0013-bcache-add-static-const-prefix-to-char-array-declara.patch
@@ -1,7 +1,7 @@
-From f21d653b3c8deba8b1aa6ffa1b4382adab52b6ec Mon Sep 17 00:00:00 2001
+From 2a20dead01d5138c298f4ba6e9e36f055ce54886 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Sat, 28 Jul 2018 14:46:50 +0800
-Subject: [PATCH 13/18] bcache: add static const prefix to char * array
+Subject: [PATCH 13/17] bcache: add static const prefix to char * array
  declarations
 
 This patch declares char * array with const prefix in sysfs.c,
@@ -13,7 +13,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
-index 5476ee74f301..074978df5a1a 100644
+index 2ed503ab9e5c..543b06408321 100644
 --- a/drivers/md/bcache/sysfs.c
 +++ b/drivers/md/bcache/sysfs.c
 @@ -150,7 +150,7 @@ SHOW(__bch_cached_dev)
@@ -22,9 +22,9 @@
  					     disk.kobj);
 -	const char *states[] = { "no cache", "clean", "dirty", "inconsistent" };
 +	char const *states[] = { "no cache", "clean", "dirty", "inconsistent" };
+ 	int wb = dc->writeback_running;
  
  #define var(stat)		(dc->stat)
- 
 -- 
 2.18.0
 
diff --git a/for-test/checkpatches_fixes/0014-bcache-move-open-brace-at-end-of-function-definition.patch b/for-next/checkpatch/0014-bcache-move-open-brace-at-end-of-function-definition.patch
similarity index 78%
rename from for-test/checkpatches_fixes/0014-bcache-move-open-brace-at-end-of-function-definition.patch
rename to for-next/checkpatch/0014-bcache-move-open-brace-at-end-of-function-definition.patch
index b5750cb..740861d 100644
--- a/for-test/checkpatches_fixes/0014-bcache-move-open-brace-at-end-of-function-definition.patch
+++ b/for-next/checkpatch/0014-bcache-move-open-brace-at-end-of-function-definition.patch
@@ -1,7 +1,7 @@
-From ede892360eebc8275ad23a98ecb2c360cc23927a Mon Sep 17 00:00:00 2001
+From 85fecc05fafb1027dd51055ea3b6c0ffcc3017c3 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Sat, 28 Jul 2018 14:56:09 +0800
-Subject: [PATCH 14/18] bcache: move open brace at end of function definitions
+Subject: [PATCH 14/17] bcache: move open brace at end of function definitions
  to next line
 
 This is not a preferred style to place open brace '{' at the end of
@@ -14,10 +14,10 @@
  1 file changed, 6 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
-index 3bb0e8299e4c..7722662f18d1 100644
+index a8b751ba3ebc..1382c6afd271 100644
 --- a/drivers/md/bcache/super.c
 +++ b/drivers/md/bcache/super.c
-@@ -2139,7 +2139,8 @@ static ssize_t register_bcache(struct kobject *, struct kobj_attribute *,
+@@ -2152,7 +2152,8 @@ static ssize_t register_bcache(struct kobject *, struct kobj_attribute *,
  kobj_attribute_write(register,		register_bcache);
  kobj_attribute_write(register_quiet,	register_bcache);
  
@@ -27,7 +27,7 @@
  	struct cache_set *c, *tc;
  	struct cached_dev *dc, *t;
  
-@@ -2153,7 +2154,8 @@ static bool bch_is_open_backing(struct block_device *bdev) {
+@@ -2166,7 +2167,8 @@ static bool bch_is_open_backing(struct block_device *bdev) {
  	return false;
  }
  
@@ -37,7 +37,7 @@
  	struct cache_set *c, *tc;
  	struct cache *ca;
  	unsigned int i;
-@@ -2165,7 +2167,8 @@ static bool bch_is_open_cache(struct block_device *bdev) {
+@@ -2178,7 +2180,8 @@ static bool bch_is_open_cache(struct block_device *bdev) {
  	return false;
  }
  
diff --git a/for-test/checkpatches_fixes/0016-bcache-add-missing-SPDX-header.patch b/for-next/checkpatch/0015-bcache-add-missing-SPDX-header.patch
similarity index 82%
rename from for-test/checkpatches_fixes/0016-bcache-add-missing-SPDX-header.patch
rename to for-next/checkpatch/0015-bcache-add-missing-SPDX-header.patch
index b937adb..08421fb 100644
--- a/for-test/checkpatches_fixes/0016-bcache-add-missing-SPDX-header.patch
+++ b/for-next/checkpatch/0015-bcache-add-missing-SPDX-header.patch
@@ -1,7 +1,7 @@
-From 35c8fa66562f5108f94ff79ec78b3f36196d89d4 Mon Sep 17 00:00:00 2001
+From 5d15d927bc343d0d4bec9a9e574e0ed10ecc12a2 Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Sat, 28 Jul 2018 18:35:26 +0800
-Subject: [PATCH 16/18] bcache: add missing SPDX header
+Subject: [PATCH 15/17] bcache: add missing SPDX header
 
 The SPDX header is missing fro closure.c, super.c and util.c, this
 patch adds SPDX header for GPL-2.0 into these files.
@@ -14,7 +14,7 @@
  3 files changed, 3 insertions(+)
 
 diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c
-index 2aab25122f3c..3be7f5234f73 100644
+index 034067e0e9ce..73f5319295bc 100644
 --- a/drivers/md/bcache/closure.c
 +++ b/drivers/md/bcache/closure.c
 @@ -1,3 +1,4 @@
@@ -23,7 +23,7 @@
   * Asynchronous refcounty things
   *
 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
-index 7722662f18d1..688a6cc69752 100644
+index 1382c6afd271..f8fe39c72f99 100644
 --- a/drivers/md/bcache/super.c
 +++ b/drivers/md/bcache/super.c
 @@ -1,3 +1,4 @@
@@ -32,7 +32,7 @@
   * bcache setup/teardown code, and some metadata io - read a superblock and
   * figure out what to do with it.
 diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
-index 329ba90245ee..3246eaa28f5a 100644
+index 18016e7bb32c..e873b0f7a82a 100644
 --- a/drivers/md/bcache/util.c
 +++ b/drivers/md/bcache/util.c
 @@ -1,3 +1,4 @@
diff --git a/for-test/checkpatches_fixes/0017-bcache-remove-unnecessary-space-before-ioctl-functio.patch b/for-next/checkpatch/0016-bcache-remove-unnecessary-space-before-ioctl-functio.patch
similarity index 82%
rename from for-test/checkpatches_fixes/0017-bcache-remove-unnecessary-space-before-ioctl-functio.patch
rename to for-next/checkpatch/0016-bcache-remove-unnecessary-space-before-ioctl-functio.patch
index 14ba879..541c4f4 100644
--- a/for-test/checkpatches_fixes/0017-bcache-remove-unnecessary-space-before-ioctl-functio.patch
+++ b/for-next/checkpatch/0016-bcache-remove-unnecessary-space-before-ioctl-functio.patch
@@ -1,7 +1,7 @@
-From aa955aad8b2ff5733167b6be221a38f2b88be359 Mon Sep 17 00:00:00 2001
+From d1cab37c0b444a75936f4860b42029041f0d868b Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Sat, 28 Jul 2018 22:52:57 +0800
-Subject: [PATCH 17/18] bcache: remove unnecessary space before ioctl function
+Subject: [PATCH 16/17] bcache: remove unnecessary space before ioctl function
  pointer arguments
 
 This is warned by checkpatch.pl, this patch removes the extra space.
@@ -12,7 +12,7 @@
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
-index 0a2c65842fd8..8ff20b75480b 100644
+index 66e6d5639b38..83504dd8100a 100644
 --- a/drivers/md/bcache/bcache.h
 +++ b/drivers/md/bcache/bcache.h
 @@ -275,8 +275,8 @@ struct bcache_device {
diff --git a/for-test/checkpatches_fixes/0018-bcache-add-the-missing-code-comments-for-smp_mb.patch b/for-next/checkpatch/0017-bcache-add-the-missing-code-comments-for-smp_mb.patch
similarity index 83%
rename from for-test/checkpatches_fixes/0018-bcache-add-the-missing-code-comments-for-smp_mb.patch
rename to for-next/checkpatch/0017-bcache-add-the-missing-code-comments-for-smp_mb.patch
index f33d44f..d5b9d5f 100644
--- a/for-test/checkpatches_fixes/0018-bcache-add-the-missing-code-comments-for-smp_mb.patch
+++ b/for-next/checkpatch/0017-bcache-add-the-missing-code-comments-for-smp_mb.patch
@@ -1,7 +1,7 @@
-From 3963d925e5b72a43355ee3176528a6c858198945 Mon Sep 17 00:00:00 2001
+From 23ad3fbdd9c3e9ba80ec64cd8089416b81b7a5ad Mon Sep 17 00:00:00 2001
 From: Coly Li <colyli@suse.de>
 Date: Sat, 28 Jul 2018 22:58:34 +0800
-Subject: [PATCH 18/18] bcache: add the missing code comments for smp_mb()
+Subject: [PATCH 17/17] bcache: add the missing code comments for smp_mb()
 
 Checkpatch.pl warns there are 2 locations of smp_mb() without code
 comment. This patch adds the missing code comments for these smp_mb()
@@ -14,7 +14,7 @@
  2 files changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h
-index 07c631f1b7c7..b3617c797dff 100644
+index 7f3594c0be14..eca0d496b686 100644
 --- a/drivers/md/bcache/closure.h
 +++ b/drivers/md/bcache/closure.h
 @@ -289,10 +289,12 @@ static inline void closure_init_stack(struct closure *cl)
@@ -32,10 +32,10 @@
  	__closure_wake_up(list);
  }
 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
-index 688a6cc69752..33d8c2adacd5 100644
+index f8fe39c72f99..985e2f456081 100644
 --- a/drivers/md/bcache/super.c
 +++ b/drivers/md/bcache/super.c
-@@ -1128,11 +1128,11 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
+@@ -1136,11 +1136,11 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
  	list_move(&dc->list, &c->cached_devs);
  	calc_cached_dev_sectors(c);