Commit Graph

255 Commits

Author SHA1 Message Date
jenkins
f0457007f1 Merge branch 'master' of ssh://gits.daterainc.com:2984/project/2013.CONTROL/bcache-tools 2014-12-31 15:26:48 -08:00
Jacob Malevich
10d4938f07 bcacheadm: Fix bcacheadm status segfault if no devs given
Fixes DAT-1655

Change-Id: I79cfc78fb8513f3e751332d65310d65020c15e3e
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-31 15:17:12 -08:00
Jacob Malevich
474f0889f0 bcacheadm: fix status and query-devs
Previously we were reading old superblocks stuck in the cache.
Pass in O_DIRECT when opening the device. This requires that
the dest buffer be memaligned.
If we are unable to read the entire superblock then increase
the buffer and try again.

Also since we now have to alloc the sb, make sure it is freed
everywhere in bcacheadm.

Fixes DAT-1609 DAT-1626

Change-Id: I04b5337b992a8569809835b5826a2656df753214
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-31 15:17:12 -08:00
Jacob Malevich
45d1cb0527 bcacheadm: fix list-cachesets --list-devs
list-cachesets now searches through all cache# symlinks
instead of iterating with i++. This is because bcache
doesn't immediately reuse a cache# symlink when a dev
gets removed.

Fixes DAT-1635
Progress DAT-1646

Change-Id: I6901e29dc13f4e2a76bdc49871e87f07667ec786
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-31 15:17:12 -08:00
Jacob Malevich
4a5a769050 bcacheadm: only fail csum check when -f is passed
Change-Id: I710f2b59940414830d08c7d018b53b84c6cbde05
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-31 15:17:12 -08:00
Jacob Malevich
5ec1b6cb6c bcacheadm: add capacity command
prints the device capacity, and free space for a cacheset

example:
bcacheadm capacity -u UUID --devs

Device Name    Capacity (512 Blocks)    Free (512 Blocks)
/dev/sdb       1048576.00               1024128.00
/dev/sdc       1048576.00               1024128.00
/dev/sdd       1048576.00               1024128.00
Total          3145728.00               3072384.00

Also did some bcacheadm stats refactoring.

Change-Id: Iff5562191478c5fd9f03399a9479d3d75740904d
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-31 15:17:12 -08:00
Jacob Malevich
d8e72eb615 bcacheadm: add query-devs --brief command
bcacheadm query-devs --brief /dev/sdb /dev/sdc /dev/sdd
will output table showing only the dev name, dev uuid,
server uuid, and cluster uuid for each device

Change-Id: I47a375c9a8f9284942befa0151fae32b0b856a53
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-31 15:17:11 -08:00
Jacob Malevich
1c113a126b bcacheadm: add command to modify sysfs attributes for
a cache or cacheset

bcacheadm modify -u csetuuid -d cacheuuid attr val
bcacheadm modify -u csetuuid attr val
bcacheadm modify --list

Change-Id: I7b8ddfb6a7cd12a7bc71870dcc10787a7d3d9e8d
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-31 15:17:11 -08:00
Jacob Malevich
e977913cc8 bcacheadm: fix status command
previously it wasn't properly looking through the list of
member info in the cache that has the highest seq.

Change-Id: I2a6ebf6bd0814055ec1247d0f4d79dab683115d3
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-31 15:17:11 -08:00
Jacob Malevich
c43d8cf683 bcacheadm: add-devs and rm-dev options
Option to add multiple devices and remove single devices.

bcacheadm add-devs --set=uuid <list of devices>
bcacheadm rm-dev <dev>

Change-Id: I4f0a287c02dfad76d8263554e455c408191ea7ba
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-31 15:17:11 -08:00
Kent Overstreet
27ff3c134c bcacheadm fixes
Change-Id: I3f6024d54aee263ef843705a0e9a02869e2a53e9
2014-12-31 15:17:11 -08:00
jenkins
8b82f11df2 Merge branch 'master' of ssh://gits.daterainc.com:2984/project/2013.MAIN/bcache-tools 2014-12-31 11:15:37 -08:00
jenkins
771dd69b85 Merge branch 'master' of ssh://gits.daterainc.com:2984/project/2013.MAIN/bcache-tools 2014-12-29 17:51:09 -08:00
Claudio Fleiner
75a34da9d0 exclude some files from rpm that gets installed
Change-Id: Id7b749358dcae30f448acc5c1c71e42b2687395b
2014-12-27 20:13:20 -08:00
Claudio Fleiner
5a71c13062 update version and build
Change-Id: I2f9e09ee6a927f7f89207914745ef50b6493e4b9
2014-12-24 10:18:26 -08:00
Jacob Malevich
f8d3f7da8f bcacheadm: Fix bcacheadm status segfault if no devs given
Fixes DAT-1655

Change-Id: I79cfc78fb8513f3e751332d65310d65020c15e3e
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-19 15:35:40 -08:00
Jacob Malevich
be4e8676b6 Merge ssh://gits.daterainc.com:2984/project/2013.KERNEL/bcache-tools 2014-12-19 15:21:51 -08:00
Jacob Malevich
ff6acc10b4 bcacheadm: fix status and query-devs
Previously we were reading old superblocks stuck in the cache.
Pass in O_DIRECT when opening the device. This requires that
the dest buffer be memaligned.
If we are unable to read the entire superblock then increase
the buffer and try again.

Also since we now have to alloc the sb, make sure it is freed
everywhere in bcacheadm.

Fixes DAT-1609 DAT-1626

Change-Id: I04b5337b992a8569809835b5826a2656df753214
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-19 14:44:24 -08:00
Jacob Malevich
34f6746c33 bcacheadm: fix list-cachesets --list-devs
list-cachesets now searches through all cache# symlinks
instead of iterating with i++. This is because bcache
doesn't immediately reuse a cache# symlink when a dev
gets removed.

Fixes DAT-1635
Progress DAT-1646

Change-Id: I6901e29dc13f4e2a76bdc49871e87f07667ec786
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-19 14:44:24 -08:00
Jacob Malevich
62345dac62 bcacheadm: only fail csum check when -f is passed
Change-Id: I710f2b59940414830d08c7d018b53b84c6cbde05
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-19 14:44:24 -08:00
Jacob Malevich
91ba18738e bcacheadm: add capacity command
prints the device capacity, and free space for a cacheset

example:
bcacheadm capacity -u UUID --devs

Device Name    Capacity (512 Blocks)    Free (512 Blocks)
/dev/sdb       1048576.00               1024128.00
/dev/sdc       1048576.00               1024128.00
/dev/sdd       1048576.00               1024128.00
Total          3145728.00               3072384.00

Also did some bcacheadm stats refactoring.

Change-Id: Iff5562191478c5fd9f03399a9479d3d75740904d
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-19 14:43:34 -08:00
jenkins
4c7c1f088e Merge branch 'master' of ssh://gits.daterainc.com:2984/project/2013.MAIN/bcache-tools 2014-12-13 05:04:36 -08:00
Jacob Malevich
6401e32229 bcacheadm: add query-devs --brief command
bcacheadm query-devs --brief /dev/sdb /dev/sdc /dev/sdd
will output table showing only the dev name, dev uuid,
server uuid, and cluster uuid for each device

Change-Id: I47a375c9a8f9284942befa0151fae32b0b856a53
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-11 14:12:21 -08:00
Jacob Malevich
8389c1f5da bcacheadm: add command to modify sysfs attributes for
a cache or cacheset

bcacheadm modify -u csetuuid -d cacheuuid attr val
bcacheadm modify -u csetuuid attr val
bcacheadm modify --list

Change-Id: I7b8ddfb6a7cd12a7bc71870dcc10787a7d3d9e8d
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-11 14:12:16 -08:00
Jacob Malevich
52789b5673 bcacheadm: fix status command
previously it wasn't properly looking through the list of
member info in the cache that has the highest seq.

Change-Id: I2a6ebf6bd0814055ec1247d0f4d79dab683115d3
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-10 14:19:17 -08:00
Jacob Malevich
b375ed9755 bcacheadm: add-devs and rm-dev options
Option to add multiple devices and remove single devices.

bcacheadm add-devs --set=uuid <list of devices>
bcacheadm rm-dev <dev>

Change-Id: I4f0a287c02dfad76d8263554e455c408191ea7ba
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-12-09 18:29:20 -08:00
Raghu Krishnamurthy
6145b37851 Set the label field in the cache set superblock if label is
specified.

Change-Id: Ic1b2d45c9544acfbabd8ee99cfe59c4ae6fb4183
2014-12-08 19:23:39 -08:00
Claudio Fleiner
06a26b58fe manual merge
Change-Id: I75355d4671c46edbb2a6a64a7a8b6217d02d4c12
2014-12-08 00:57:16 -08:00
Kent Overstreet
7916b2eb3b bcacheadm fixes
Change-Id: I3f6024d54aee263ef843705a0e9a02869e2a53e9
2014-12-05 19:20:03 -08:00
Claudio Fleiner
aab57f35bc rpmify
Change-Id: Iffa28034d4228366565c762b4103fae2a54b2518
2014-12-05 15:11:28 -08:00
Jacob Malevich
7763a86ca8 Remove exit points from libbache and return error messages instead.
Change-Id: Ibd238bb63354dae841c2a70e5ded550b3c603d4b
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-25 14:19:28 -08:00
Jacob Malevich
0098187201 Fix string parsing
Change-Id: I0edd8f1e247ae802cdccf871a40b50d8a8714433
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-24 15:53:35 -08:00
Jacob Malevich
7a80b660c2 bcacheadm unregister devices
uses unregister ioctl to unregister a cacheset that the device
belongs to

Change-Id: I01772de3471888c4951f050b3e92f41b58c5d103
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-21 14:42:07 -08:00
Jacob Malevich
6ad19a812b bcacheadm: add ability to find a dev uuid within a cacheset
simplifies input for finding stats for a single dev

Change-Id: I5d879aaa8cb68aaaedabd2bc780fbea4994e2541
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-18 14:45:18 -08:00
Jacob Malevich
34980cc0df bcacheadm: dev path parsing
Parse out the dev name for list-cachesets --list-devs
This gives the dev path that will be needed for query-dev
to get the superblock

Change-Id: I333cd8a0e593e02d7635111309b8aff14050cc41
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-18 14:23:02 -08:00
Jacob Malevich
4603dcf36b Option for returning only the uuid of the dev when doing a
query-dev

Change-Id: Ia055da0516bc7baac836642fa1405b77adfc5139
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-14 11:24:02 -08:00
Jacob Malevich
28271115d7 bcache query-dev fixes, and don't print the sb out for status
Change-Id: I909ac15ca32a9cdecd6c7455e884d14f30ab0188
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-13 17:31:39 -08:00
Jacob Malevich
3fda6adc19 bcacheadm: list-cachesets --list-devs option
lists the devices in each cacheset

Change-Id: Ie3beb38203eefc3ab64b2a3d37652964f7021e54
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-13 17:08:20 -08:00
Jacob Malevich
7d34cf342e bcacheadm: register bcache ioctl already takes an argv, no need to parse it
Change-Id: I0295ebde998c038feb40332ea303935035b8e2bd
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-13 12:46:03 -08:00
Jacob Malevich
34f54790d5 bcacheadm: fix tiering and backing device bugs
TODO: Support multiple devices for a single -C or -B flag

Change-Id: I73b18a39a0e0ff564600c2fc7386a785d3a10870
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-12 17:51:42 -08:00
Jacob Malevich
552dc9fa7d bcacheadm: format bug fixes
bcacheadm format is now working in replacement of make-bcache

Change-Id: Ib152dde3b8dc1418d1508020529dd58e4cf5d222
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-12 15:22:38 -08:00
Jacob Malevich
84eb67c6a6 Initial template for bcacheadm man page.
TODO: Work with Kent to fill in descriptions for several items

Change-Id: Iea4fe9e6a99842bf40b0213eecb61d48952aa1bb
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-10 18:42:36 -08:00
Jacob Malevich
b602f0bf6a Update some bcacheadm error messages
Change-Id: Iddc638dacb7c68b621d686ba632da16fbe39bc15
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-10 15:37:58 -08:00
Jacob Malevich
bae9ea7bbd bcacheadm stats, add flags
-c cache# displays stats for a specific cache in the cacheset
--stats-five-min,hour,day,total specific stats for the cacheset

Change-Id: I436d36d0853a250fe773573126c7a50a7251c72d
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-06 18:11:31 -08:00
Jacob Malevich
269761b11f bcacheadm status [FLAGS] <list of stats>
FLAGS:
--list	-list all stats in the uuid directory
--all	-list all stats/values in the uuid directory
--uuid	-must pass in a uuid for the cacheset

TODO:	-subdirectory stats for individual caches
	-subdirectory stats for over time stats

Change-Id: Ic7126a511fb17aa8c9ac7bf89e014ddbb719f46d
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-06 15:36:38 -08:00
Jacob Malevich
637b614630 bcacheadm status <list of devs>
provides status for the newest sb version for each tier for all
the devs passed in

Change-Id: Ib6e5b08e65b5c36e7b1af0e9806efc39d069f94c
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-11-05 17:45:57 -08:00
Jacob Malevich
bc69c8fe04 bcacheadm add list-cachesets and query-devs
Change-Id: Ie2bc7ba8293d1d493c0a215119456e4bb9e659aa
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-10-27 17:37:25 -07:00
Jacob Malevich
82ac2a0338 bcacheadm tool
bcacheadm is a combination of make-bcache, probe-bcache, bcache-super-show, and bcachectl(register).

Change-Id: Ia4f4cdd5f882516358eb0e26a75296d2103af1d0
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-10-27 17:37:05 -07:00
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
ee44c4f509 set btree_node_size for the cache_sb based on bucket_size
Change-Id: I98dab6e9a221cd8781095039d653ace84ffae806
Signed-off-by: Jacob Malevich <jam@daterainc.com>
2014-10-27 12:14:38 -07:00