Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcache: drop discard sysfs interface

Since discard code is removed, now the sysfs interface to enable discard
is useless. This patch removes the corresponding sysfs entry, and remove
bool variable 'discard' from struct cache as well.

Signed-off-by: Coly Li <colyli@fnnas.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Coly Li and committed by
Jens Axboe
73a004f8 b4056afb

+2 -24
+1 -4
drivers/md/bcache/bcache.h
··· 447 447 * free_inc: Incoming buckets - these are buckets that currently have 448 448 * cached data in them, and we can't reuse them until after we write 449 449 * their new gen to disk. After prio_write() finishes writing the new 450 - * gens/prios, they'll be moved to the free list (and possibly discarded 451 - * in the process) 450 + * gens/prios, they'll be moved to the free list. 452 451 */ 453 452 DECLARE_FIFO(long, free)[RESERVE_NR]; 454 453 DECLARE_FIFO(long, free_inc); ··· 465 466 * cpu 466 467 */ 467 468 unsigned int invalidate_needs_gc; 468 - 469 - bool discard; /* Get rid of? */ 470 469 471 470 struct journal_device journal; 472 471
-3
drivers/md/bcache/super.c
··· 2382 2382 ca->bdev = file_bdev(bdev_file); 2383 2383 ca->sb_disk = sb_disk; 2384 2384 2385 - if (bdev_max_discard_sectors(file_bdev(bdev_file))) 2386 - ca->discard = CACHE_DISCARD(&ca->sb); 2387 - 2388 2385 ret = cache_alloc(ca); 2389 2386 if (ret != 0) { 2390 2387 if (ret == -ENOMEM)
-15
drivers/md/bcache/sysfs.c
··· 134 134 rw_attribute(synchronous); 135 135 rw_attribute(journal_delay_ms); 136 136 rw_attribute(io_disable); 137 - rw_attribute(discard); 138 137 rw_attribute(running); 139 138 rw_attribute(label); 140 139 rw_attribute(errors); ··· 1035 1036 sysfs_hprint(bucket_size, bucket_bytes(ca)); 1036 1037 sysfs_hprint(block_size, block_bytes(ca)); 1037 1038 sysfs_print(nbuckets, ca->sb.nbuckets); 1038 - sysfs_print(discard, ca->discard); 1039 1039 sysfs_hprint(written, atomic_long_read(&ca->sectors_written) << 9); 1040 1040 sysfs_hprint(btree_written, 1041 1041 atomic_long_read(&ca->btree_sectors_written) << 9); ··· 1140 1142 if (bcache_is_reboot) 1141 1143 return -EBUSY; 1142 1144 1143 - if (attr == &sysfs_discard) { 1144 - bool v = strtoul_or_return(buf); 1145 - 1146 - if (bdev_max_discard_sectors(ca->bdev)) 1147 - ca->discard = v; 1148 - 1149 - if (v != CACHE_DISCARD(&ca->sb)) { 1150 - SET_CACHE_DISCARD(&ca->sb, v); 1151 - bcache_write_super(ca->set); 1152 - } 1153 - } 1154 - 1155 1145 if (attr == &sysfs_cache_replacement_policy) { 1156 1146 v = __sysfs_match_string(cache_replacement_policies, -1, buf); 1157 1147 if (v < 0) ··· 1171 1185 &sysfs_block_size, 1172 1186 &sysfs_nbuckets, 1173 1187 &sysfs_priority_stats, 1174 - &sysfs_discard, 1175 1188 &sysfs_written, 1176 1189 &sysfs_btree_written, 1177 1190 &sysfs_metadata_written,
+1 -2
drivers/md/bcache/writeback.c
··· 805 805 * may set BCH_ENABLE_AUTO_GC via sysfs, then when 806 806 * BCH_DO_AUTO_GC is set, garbage collection thread 807 807 * will be wake up here. After moving gc, the shrunk 808 - * btree and discarded free buckets SSD space may be 809 - * helpful for following write requests. 808 + * btree may be helpful for following write requests. 810 809 */ 811 810 if (c->gc_after_writeback == 812 811 (BCH_ENABLE_AUTO_GC|BCH_DO_AUTO_GC)) {