Commit Graph

41 Commits

Author SHA1 Message Date
Jacob Malevich
0fca0e5502 Add multiple bucket_sizes to make-bcache
This is needed since libbcache expects an array of bucket sizes to be passed in. This is just so the tests can continue to use make-bcache until we can change them over to bcacheadm.

Change-Id: I1002e3d8355d45ffa914e6577569a5adfd1d6ccf
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-10-27 12:14:44 -07:00
Jacob Malevich
e8c1cee578 Create libbcache.a.
Move make-bcache, probe-bcache, and bcache-super-show functions into a
static library called libbcache.

Change-Id: Ieed626225e08507a8ccd12f6bb0c07f64480de9b
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-10-27 12:13:52 -07:00
Kent Overstreet
02c47b0373 Superblock version 6
Change-Id: Iba976c8c5a4a91dcac06145471fc70baa6a6393e
2014-08-29 21:48:17 +00:00
rk
039b45dfe9 make-bcache.c: Added support for storing "label" information for the
the devices in the super-block.
bcache.h:       Bring version information to the latest kernel version.
bcache-super-show.c: Add setsize for caching devices. This indicates
                     the number of devices in caching set.

Testing done:

1.0  make-bcache with --label option and checking back to see if
     bcache-super-show shows the devices.
2.0  bcache-super-show does not bail if version is 5.
3.0  bcache-super-show shows the correct setsize.

Change-Id: If0f1ec6204b233b34ff4c8a57a8809d2c8dbe3e3
2014-06-03 10:24:10 -07:00
Slava Pestov
9115b9a7ba make-bcache: update --help 2014-05-01 11:00:30 -07:00
Kent Overstreet
214dd0cb2d Add support for setting cache tier field 2014-03-20 13:46:04 -07:00
Kent Overstreet
a1aa5961dc Merge remote-tracking branch 'remotes/angband/master'
Conflicts:
	make-bcache.c
2014-03-20 13:38:08 -07:00
Nicholas Swenson
f5cf644def bcache: writes correct superblock for multiple cache devs
Signed-off-by: Nicholas Swenson <nks@daterainc.com>
2013-10-31 16:15:49 -07:00
Gabriel
b15fb776c9 make-bcache: Prevent stray superblocks
Fail if the device has any leftover superblock or partition table label.

Add a --wipe-bcache flag to overwrite bcache superblocks and recommend
wipefs for non-bcache superblocks.

Once the device is safe to write, always zero immediately before the
bcache superblock.

Make sure errors go to stderr.  Use pkg-config.
2013-09-01 12:38:11 +02:00
Lars Ellenberg
7721b11a60 fix make-bcache to use logical_block_size, not stat.st_blocksize
As discussed on irc yesterday.

Cheers,
	Lars

From 791a4b7b2c25e21ffeb4184da5e61f18cde86246 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars@linbit.com>
Date: Wed, 17 Jul 2013 11:49:12 +0200
Subject: [PATCH] make-bcache: fix guessing of "block_size" to use BLKSSZGET

Using stat.st_blocksize is wrong:
that is the linux buffer cache granularity,
it is tunable, and defaults to 4k.

This caused bcache to default to create devices with
logical_block_size = 4k, potentially breaking otherwise healthy disk
or file system images unnecessarily.

e.g. some xfs image previously created with 512 byte "sector size"
would, once bcache'd, refuse to mount with
	mount: function not implemented
	device supports 4096 byte sectors (not 512)

We want the logical_block_size here.
2013-07-17 13:13:31 -07:00
Kent Overstreet
557c79518c bcache-tools are GPL 2013-07-17 13:13:31 -07:00
Gabriel
315ab92e58 super-show: print cache mode (writethrough, writeback, writearound, none) 2013-05-08 09:40:46 +02:00
Gabriel
13df67cd20 make-bdev: print the correct offset in the default case 2013-04-30 11:25:23 +02:00
Kent Overstreet
ebb76d0c4a Get blocksize from the devices if it's not specified 2013-04-23 17:43:47 -07:00
Gabriel
94755cc757 Update data offset format and warn about the previous one.
Also update the macro to select a bdev.
Also reindent.
2013-04-15 12:48:39 -07:00
Gabriel
1407bb0c2a Trivial build fix. 2013-04-12 02:30:04 +02:00
Gabriel
dc405a8f94 Add a flag to pick the cache set uuid. 2013-04-11 17:19:10 -07:00
Kent Overstreet
3088f201ed Update for new superblock version for data_offset 2013-04-11 16:56:27 -07:00
Kent Overstreet
335ac31ba5 Fix option parsing so that passing --bucket_size after the device works
This makes supporting -U more annoying; dropping that for the moment,
unless someone complains
2013-04-09 13:29:06 -07:00
Gabriel
3b6ae63e49 Fix offsets, cache and backing are two different cases. 2013-03-09 15:51:17 +01:00
Kent Overstreet
133c859a24 Better validation, and use O_EXCL when opening block device 2012-11-21 15:31:49 -08:00
Kent Overstreet
f2a9bace37 Change default blocksize to one sector 2012-08-15 13:04:46 -07:00
Kent Overstreet
7f023533a8 Add --discard and --cache_replacement_policy 2012-01-18 16:05:32 -08:00
Kent Overstreet
d1bc71ca43 The --writeback switch did nothing; fixed 2011-09-01 14:37:48 -07:00
Kent Overstreet
18e46dc1c3 Add more long options and improve usage() 2011-08-09 17:33:03 -07:00
Kent Overstreet
e8c85bb806 Add a --writeback switch to make-bcache 2011-07-31 19:29:22 -07:00
Ricky Benitez
a02bc8df01 Add checksum to superblock
Add checksum to the superblock to prevent warning messages when
registering devices.
2011-07-26 10:02:15 -07:00
Kent Overstreet
02614b5c81 Give make-bcache the ability to format multiple devices at once 2011-07-25 11:28:05 -07:00
Kent Overstreet
c798b43ade New superblock format 2011-07-25 00:18:42 -07:00
Kent Overstreet
4f88b8efe2 Add an option for setting the set uuid 2011-07-12 15:42:37 -07:00
Kent Overstreet
9e6daaffa7 Don't overwrite priorities that aren't there on a backing device 2011-05-24 14:12:00 -07:00
Kent Overstreet
eb9054a32e Updates for backing devices 2011-05-19 20:25:14 -07:00
Kent Overstreet
1a7ae034f6 New superblock fields for multiple cache devices 2011-04-15 13:22:09 -07:00
Kent Overstreet
0b4b6fe2d3 Stuff 2011-02-13 07:01:10 -08:00
Kent Overstreet
04a54144fd Documentation 2010-12-16 01:22:45 -08:00
Kent Overstreet
7e97901075 UUIDs 2010-10-08 07:04:49 -07:00
Kent Overstreet
e7b1ba1bd0 Cleanups 2010-07-29 23:05:51 -07:00
Kent Overstreet
41ad07857e sync 2010-06-15 05:15:32 -07:00
Kent Overstreet
11a1a3ca52 Checksum test 2010-05-14 08:54:26 -08:00
Kent Overstreet
5936daea26 Should work on 32 bit 2010-05-08 10:31:53 -08:00
Kent Overstreet
625ca7f8fb Initial commit 2010-05-04 17:58:22 -08:00