aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2018-08-11 01:19:47 -0400
committerJens Axboe <axboe@kernel.dk>2018-08-11 17:46:41 -0400
commitb0d30981c05f32d8cc032b209408ca3224f05f36 (patch)
tree580e66aa0b5d76d8a9d575a3db6b1b623097c974
parentfc2d5988b5972bced859944986fb36d902ac3698 (diff)
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, but it is better to be a single line and I don't change them. Signed-off-by: Coly Li <colyli@suse.de> Reviewed-by: Shenghui Wang <shhuiw@foxmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/md/bcache/bcache.h4
-rw-r--r--drivers/md/bcache/bset.c10
-rw-r--r--drivers/md/bcache/bset.h6
-rw-r--r--drivers/md/bcache/btree.c5
-rw-r--r--drivers/md/bcache/btree.h6
-rw-r--r--drivers/md/bcache/debug.c3
-rw-r--r--drivers/md/bcache/extents.c4
-rw-r--r--drivers/md/bcache/journal.c3
-rw-r--r--drivers/md/bcache/request.c7
-rw-r--r--drivers/md/bcache/super.c18
-rw-r--r--drivers/md/bcache/sysfs.c11
-rw-r--r--drivers/md/bcache/util.h3
-rw-r--r--drivers/md/bcache/writeback.c7
13 files changed, 59 insertions, 28 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 0bd505c61943..031a75a25d3e 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -614,8 +614,8 @@ struct cache_set {
614 uint16_t min_prio; 614 uint16_t min_prio;
615 615
616 /* 616 /*
617 * max(gen - last_gc) for all buckets. When it gets too big we have to gc 617 * max(gen - last_gc) for all buckets. When it gets too big we have to
618 * to keep gens from wrapping around. 618 * gc to keep gens from wrapping around.
619 */ 619 */
620 uint8_t need_gc; 620 uint8_t need_gc;
621 struct gc_stat gc_stats; 621 struct gc_stat gc_stats;
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
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)
311} 311}
312EXPORT_SYMBOL(bch_btree_keys_free); 312EXPORT_SYMBOL(bch_btree_keys_free);
313 313
314int bch_btree_keys_alloc(struct btree_keys *b, unsigned int page_order, gfp_t gfp) 314int bch_btree_keys_alloc(struct btree_keys *b,
315 unsigned int page_order,
316 gfp_t gfp)
315{ 317{
316 struct bset_tree *t = b->set; 318 struct bset_tree *t = b->set;
317 319
@@ -475,7 +477,8 @@ void inorder_test(void)
475 for (unsigned int size = 2; 477 for (unsigned int size = 2;
476 size < 65536000; 478 size < 65536000;
477 size++) { 479 size++) {
478 unsigned int extra = (size - rounddown_pow_of_two(size - 1)) << 1; 480 unsigned int extra =
481 (size - rounddown_pow_of_two(size - 1)) << 1;
479 unsigned int i = 1, j = rounddown_pow_of_two(size - 1); 482 unsigned int i = 1, j = rounddown_pow_of_two(size - 1);
480 483
481 if (!(size % 4096)) 484 if (!(size % 4096))
@@ -825,7 +828,8 @@ static void bch_bset_fix_lookup_table(struct btree_keys *b,
825 k != bset_bkey_last(t->data); 828 k != bset_bkey_last(t->data);
826 k = bkey_next(k)) 829 k = bkey_next(k))
827 if (t->size == bkey_to_cacheline(t, k)) { 830 if (t->size == bkey_to_cacheline(t, k)) {
828 t->prev[t->size] = bkey_to_cacheline_offset(t, t->size, k); 831 t->prev[t->size] =
832 bkey_to_cacheline_offset(t, t->size, k);
829 t->size++; 833 t->size++;
830 } 834 }
831} 835}
diff --git a/drivers/md/bcache/bset.h b/drivers/md/bcache/bset.h
index f5bf333aa40d..bac76aabca6d 100644
--- a/drivers/md/bcache/bset.h
+++ b/drivers/md/bcache/bset.h
@@ -246,12 +246,14 @@ static inline bool bkey_written(struct btree_keys *b, struct bkey *k)
246 return !b->last_set_unwritten || k < b->set[b->nsets].data->start; 246 return !b->last_set_unwritten || k < b->set[b->nsets].data->start;
247} 247}
248 248
249static inline unsigned int bset_byte_offset(struct btree_keys *b, struct bset *i) 249static inline unsigned int bset_byte_offset(struct btree_keys *b,
250 struct bset *i)
250{ 251{
251 return ((size_t) i) - ((size_t) b->set->data); 252 return ((size_t) i) - ((size_t) b->set->data);
252} 253}
253 254
254static inline unsigned int bset_sector_offset(struct btree_keys *b, struct bset *i) 255static inline unsigned int bset_sector_offset(struct btree_keys *b,
256 struct bset *i)
255{ 257{
256 return bset_byte_offset(b, i) >> 9; 258 return bset_byte_offset(b, i) >> 9;
257} 259}
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index a797ef359a21..c2e4174a2e03 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -436,7 +436,10 @@ static void do_btree_node_write(struct btree *b)
436 436
437 continue_at(cl, btree_node_write_done, NULL); 437 continue_at(cl, btree_node_write_done, NULL);
438 } else { 438 } else {
439 /* No problem for multipage bvec since the bio is just allocated */ 439 /*
440 * No problem for multipage bvec since the bio is
441 * just allocated
442 */
440 b->bio->bi_vcnt = 0; 443 b->bio->bi_vcnt = 0;
441 bch_bio_map(b->bio, i); 444 bch_bio_map(b->bio, i);
442 445
diff --git a/drivers/md/bcache/btree.h b/drivers/md/bcache/btree.h
index f13b71a0613a..a68d6c55783b 100644
--- a/drivers/md/bcache/btree.h
+++ b/drivers/md/bcache/btree.h
@@ -306,7 +306,9 @@ bool bch_keybuf_check_overlapping(struct keybuf *buf, struct bkey *start,
306 struct bkey *end); 306 struct bkey *end);
307void bch_keybuf_del(struct keybuf *buf, struct keybuf_key *w); 307void bch_keybuf_del(struct keybuf *buf, struct keybuf_key *w);
308struct keybuf_key *bch_keybuf_next(struct keybuf *buf); 308struct keybuf_key *bch_keybuf_next(struct keybuf *buf);
309struct keybuf_key *bch_keybuf_next_rescan(struct cache_set *c, struct keybuf *buf, 309struct keybuf_key *bch_keybuf_next_rescan(struct cache_set *c,
310 struct bkey *end, keybuf_pred_fn *pred); 310 struct keybuf *buf,
311 struct bkey *end,
312 keybuf_pred_fn *pred);
311void bch_update_bucket_in_use(struct cache_set *c, struct gc_stat *stats); 313void bch_update_bucket_in_use(struct cache_set *c, struct gc_stat *stats);
312#endif 314#endif
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
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)
67 if (inmemory->keys != sorted->keys || 67 if (inmemory->keys != sorted->keys ||
68 memcmp(inmemory->start, 68 memcmp(inmemory->start,
69 sorted->start, 69 sorted->start,
70 (void *) bset_bkey_last(inmemory) - (void *) inmemory->start)) { 70 (void *) bset_bkey_last(inmemory) -
71 (void *) inmemory->start)) {
71 struct bset *i; 72 struct bset *i;
72 unsigned int j; 73 unsigned int j;
73 74
diff --git a/drivers/md/bcache/extents.c b/drivers/md/bcache/extents.c
index 8f5de61e1a90..cb3b2c613ed6 100644
--- a/drivers/md/bcache/extents.c
+++ b/drivers/md/bcache/extents.c
@@ -577,7 +577,9 @@ static uint64_t merge_chksums(struct bkey *l, struct bkey *r)
577 ~((uint64_t)1 << 63); 577 ~((uint64_t)1 << 63);
578} 578}
579 579
580static bool bch_extent_merge(struct btree_keys *bk, struct bkey *l, struct bkey *r) 580static bool bch_extent_merge(struct btree_keys *bk,
581 struct bkey *l,
582 struct bkey *r)
581{ 583{
582 struct btree *b = container_of(bk, struct btree, keys); 584 struct btree *b = container_of(bk, struct btree, keys);
583 unsigned int i; 585 unsigned int i;
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
index a70126466fa8..6116bbf870d8 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)
193 193
194 for (l = find_first_zero_bit(bitmap, ca->sb.njournal_buckets); 194 for (l = find_first_zero_bit(bitmap, ca->sb.njournal_buckets);
195 l < ca->sb.njournal_buckets; 195 l < ca->sb.njournal_buckets;
196 l = find_next_zero_bit(bitmap, ca->sb.njournal_buckets, l + 1)) 196 l = find_next_zero_bit(bitmap, ca->sb.njournal_buckets,
197 l + 1))
197 if (read_bucket(l)) 198 if (read_bucket(l))
198 goto bsearch; 199 goto bsearch;
199 200
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index d7e6ee3d7dd2..858dd3da9dc5 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)
136 bio->bi_iter.bi_size -= sectors << 9; 136 bio->bi_iter.bi_size -= sectors << 9;
137 137
138 bch_keylist_add(&op->insert_keys, 138 bch_keylist_add(&op->insert_keys,
139 &KEY(op->inode, bio->bi_iter.bi_sector, sectors)); 139 &KEY(op->inode,
140 bio->bi_iter.bi_sector,
141 sectors));
140 } 142 }
141 143
142 op->insert_data_done = true; 144 op->insert_data_done = true;
@@ -815,7 +817,8 @@ static void cached_dev_read_done(struct closure *cl)
815 817
816 if (s->iop.bio) { 818 if (s->iop.bio) {
817 bio_reset(s->iop.bio); 819 bio_reset(s->iop.bio);
818 s->iop.bio->bi_iter.bi_sector = s->cache_miss->bi_iter.bi_sector; 820 s->iop.bio->bi_iter.bi_sector =
821 s->cache_miss->bi_iter.bi_sector;
819 bio_copy_dev(s->iop.bio, s->cache_miss); 822 bio_copy_dev(s->iop.bio, s->cache_miss);
820 s->iop.bio->bi_iter.bi_size = s->insert_bio_sectors << 9; 823 s->iop.bio->bi_iter.bi_size = s->insert_bio_sectors << 9;
821 bch_bio_map(s->iop.bio, NULL); 824 bch_bio_map(s->iop.bio, NULL);
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 6a80069650c7..296fc8c31c6c 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,
149 goto err; 149 goto err;
150 150
151 err = "Invalid superblock: device too small"; 151 err = "Invalid superblock: device too small";
152 if (get_capacity(bdev->bd_disk) < sb->bucket_size * sb->nbuckets) 152 if (get_capacity(bdev->bd_disk) <
153 sb->bucket_size * sb->nbuckets)
153 goto err; 154 goto err;
154 155
155 err = "Bad UUID"; 156 err = "Bad UUID";
@@ -600,7 +601,8 @@ static void prio_read(struct cache *ca, uint64_t bucket)
600 601
601 prio_io(ca, bucket, REQ_OP_READ, 0); 602 prio_io(ca, bucket, REQ_OP_READ, 0);
602 603
603 if (p->csum != bch_crc64(&p->magic, bucket_bytes(ca) - 8)) 604 if (p->csum !=
605 bch_crc64(&p->magic, bucket_bytes(ca) - 8))
604 pr_warn("bad csum reading priorities"); 606 pr_warn("bad csum reading priorities");
605 607
606 if (p->magic != pset_magic(&ca->sb)) 608 if (p->magic != pset_magic(&ca->sb))
@@ -1740,8 +1742,8 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)
1740 if (!(c->devices = kcalloc(c->nr_uuids, sizeof(void *), GFP_KERNEL)) || 1742 if (!(c->devices = kcalloc(c->nr_uuids, sizeof(void *), GFP_KERNEL)) ||
1741 mempool_init_slab_pool(&c->search, 32, bch_search_cache) || 1743 mempool_init_slab_pool(&c->search, 32, bch_search_cache) ||
1742 mempool_init_kmalloc_pool(&c->bio_meta, 2, 1744 mempool_init_kmalloc_pool(&c->bio_meta, 2,
1743 sizeof(struct bbio) + sizeof(struct bio_vec) * 1745 sizeof(struct bbio) + sizeof(struct bio_vec) *
1744 bucket_pages(c)) || 1746 bucket_pages(c)) ||
1745 mempool_init_kmalloc_pool(&c->fill_iter, 1, iter_size) || 1747 mempool_init_kmalloc_pool(&c->fill_iter, 1, iter_size) ||
1746 bioset_init(&c->bio_split, 4, offsetof(struct bbio, bio), 1748 bioset_init(&c->bio_split, 4, offsetof(struct bbio, bio),
1747 BIOSET_NEED_BVECS|BIOSET_NEED_RESCUER) || 1749 BIOSET_NEED_BVECS|BIOSET_NEED_RESCUER) ||
@@ -1813,7 +1815,9 @@ static void run_cache_set(struct cache_set *c)
1813 goto err; 1815 goto err;
1814 1816
1815 err = "error reading btree root"; 1817 err = "error reading btree root";
1816 c->root = bch_btree_node_get(c, NULL, k, j->btree_level, true, NULL); 1818 c->root = bch_btree_node_get(c, NULL, k,
1819 j->btree_level,
1820 true, NULL);
1817 if (IS_ERR_OR_NULL(c->root)) 1821 if (IS_ERR_OR_NULL(c->root))
1818 goto err; 1822 goto err;
1819 1823
@@ -2107,7 +2111,9 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page,
2107 goto err; 2111 goto err;
2108 } 2112 }
2109 2113
2110 if (kobject_add(&ca->kobj, &part_to_dev(bdev->bd_part)->kobj, "bcache")) { 2114 if (kobject_add(&ca->kobj,
2115 &part_to_dev(bdev->bd_part)->kobj,
2116 "bcache")) {
2111 err = "error calling kobject_add"; 2117 err = "error calling kobject_add";
2112 ret = -ENOMEM; 2118 ret = -ENOMEM;
2113 goto out; 2119 goto out;
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index ba4cd7efca8e..f0faaeaec57f 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -130,8 +130,10 @@ rw_attribute(btree_shrinker_disabled);
130rw_attribute(copy_gc_enabled); 130rw_attribute(copy_gc_enabled);
131rw_attribute(size); 131rw_attribute(size);
132 132
133static ssize_t bch_snprint_string_list(char *buf, size_t size, const char * const list[], 133static ssize_t bch_snprint_string_list(char *buf,
134 size_t selected) 134 size_t size,
135 const char * const list[],
136 size_t selected)
135{ 137{
136 char *out = buf; 138 char *out = buf;
137 size_t i; 139 size_t i;
@@ -341,8 +343,9 @@ STORE(__cached_dev)
341 add_uevent_var(env, "DRIVER=bcache"); 343 add_uevent_var(env, "DRIVER=bcache");
342 add_uevent_var(env, "CACHED_UUID=%pU", dc->sb.uuid), 344 add_uevent_var(env, "CACHED_UUID=%pU", dc->sb.uuid),
343 add_uevent_var(env, "CACHED_LABEL=%s", buf); 345 add_uevent_var(env, "CACHED_LABEL=%s", buf);
344 kobject_uevent_env( 346 kobject_uevent_env(&disk_to_dev(dc->disk.disk)->kobj,
345 &disk_to_dev(dc->disk.disk)->kobj, KOBJ_CHANGE, env->envp); 347 KOBJ_CHANGE,
348 env->envp);
346 kfree(env); 349 kfree(env);
347 } 350 }
348 351
diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
index 707d7f0c034e..4e0ed19e32d3 100644
--- a/drivers/md/bcache/util.h
+++ b/drivers/md/bcache/util.h
@@ -402,7 +402,8 @@ do { \
402 __print_time_stat(stats, name, \ 402 __print_time_stat(stats, name, \
403 average_duration, duration_units); \ 403 average_duration, duration_units); \
404 sysfs_print(name ## _ ##max_duration ## _ ## duration_units, \ 404 sysfs_print(name ## _ ##max_duration ## _ ## duration_units, \
405 div_u64((stats)->max_duration, NSEC_PER_ ## duration_units));\ 405 div_u64((stats)->max_duration, \
406 NSEC_PER_ ## duration_units)); \
406 \ 407 \
407 sysfs_print(name ## _last_ ## frequency_units, (stats)->last \ 408 sysfs_print(name ## _last_ ## frequency_units, (stats)->last \
408 ? div_s64(local_clock() - (stats)->last, \ 409 ? div_s64(local_clock() - (stats)->last, \
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index 44f1b0f1f4d9..e40bf0e403e7 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -444,7 +444,8 @@ static void read_dirty(struct cached_dev *dc)
444 444
445 io = kzalloc(sizeof(struct dirty_io) + 445 io = kzalloc(sizeof(struct dirty_io) +
446 sizeof(struct bio_vec) * 446 sizeof(struct bio_vec) *
447 DIV_ROUND_UP(KEY_SIZE(&w->key), PAGE_SECTORS), 447 DIV_ROUND_UP(KEY_SIZE(&w->key),
448 PAGE_SECTORS),
448 GFP_KERNEL); 449 GFP_KERNEL);
449 if (!io) 450 if (!io)
450 goto err; 451 goto err;
@@ -540,7 +541,9 @@ void bcache_dev_sectors_dirty_add(struct cache_set *c, unsigned int inode,
540 541
541static bool dirty_pred(struct keybuf *buf, struct bkey *k) 542static bool dirty_pred(struct keybuf *buf, struct bkey *k)
542{ 543{
543 struct cached_dev *dc = container_of(buf, struct cached_dev, writeback_keys); 544 struct cached_dev *dc = container_of(buf,
545 struct cached_dev,
546 writeback_keys);
544 547
545 BUG_ON(KEY_INODE(k) != dc->disk.id); 548 BUG_ON(KEY_INODE(k) != dc->disk.id);
546 549