Permalink
Browse files

:data_size option to with_standard_cache

  • Loading branch information...
1 parent e9f33e6 commit 0ffe5347f3517a9033c2f31137d5ea2e76cc878b @jthornber committed Sep 19, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/thinp-mixin.rb
View
@@ -143,6 +143,7 @@ def with_standard_cache(opts = Hash.new, &block)
block_size = opts.fetch(:block_size, @data_block_size)
format = opts.fetch(:format, false)
policy = opts.fetch(:policy, 'arc')
+ data_size = opts.fetch(:data_size, dev_size(@data_dev))
# we set up a small linear device, made out of the metadata dev.
# That is at most a 8th the size of the data dev.
@@ -160,7 +161,7 @@ def with_standard_cache(opts = Hash.new, &block)
tvm.add_volume(linear_vol('cache', cache_size))
with_dev(tvm.table('cache')) do |cache|
- table = Table.new(CacheTarget.new(dev_size(@data_dev), md, @data_dev, cache,
+ table = Table.new(CacheTarget.new(data_size, md, @data_dev, cache,
block_size, policy))
with_dev(table, &block)
end

0 comments on commit 0ffe534

Please sign in to comment.