method renamed to use the same semantic like duperemove (dedupe_extent)

This commit is contained in:
Denis Knauf 2021-09-06 09:48:16 +02:00
parent 3cc57e2e78
commit 01b3ebe04f
2 changed files with 11 additions and 11 deletions

View file

@ -9,14 +9,13 @@ Gem::Specification.new do |s|
s.homepage = 'https://git.denkn.at/deac/deduperemoverb' s.homepage = 'https://git.denkn.at/deac/deduperemoverb'
s.summary = 'Deduplication of file junks of found files by deduperemove.' s.summary = 'Deduplication of file junks of found files by deduperemove.'
s.files = s.files =
FileList[ FileList[ %w[
'lib/**/*.rb', lib/**/*.rb
'bin/*', bin/*
'Gemfile', Gemfile Gemfile.lock
'Gemfile.lock', ext/*/*.c ext/*/extconf.rb
'ext/*/*.c', ]]
'ext/*/extconf.rb' s.bindir = %w[bin]
]
s.require_paths = %w[lib] s.require_paths = %w[lib]
s.extensions = %w[ext/deduperemoverb/extconf.rb] s.extensions = %w[ext/deduperemoverb/extconf.rb]
@ -24,5 +23,6 @@ Gem::Specification.new do |s|
s.add_dependency "ffi", '~> 1.15' s.add_dependency "ffi", '~> 1.15'
s.add_dependency "sqlite3", '~> 1.4' s.add_dependency "sqlite3", '~> 1.4'
#s.install_tasks name: 'compile' s.requirements << 'cc'
s.requirements << 'ruby-dev'
end end

View file

@ -111,7 +111,7 @@ class Duperemove
end end
def self.duperemove fd, offset, length, dupes def self.dedupe_extent fd, offset, length, dupes
rr = FileDedupeRange[dupes.size].new offset, length rr = FileDedupeRange[dupes.size].new offset, length
fds = [] fds = []
dupes.each_with_index do |(fd,os),i| dupes.each_with_index do |(fd,os),i|
@ -224,7 +224,7 @@ class Duperemove
begin begin
t1 = Time.now t1 = Time.now
rs = rs =
Duperemove.duperemove fst.file, Duperemove.dedupe_extent fst.file,
fst.offset, fst.offset,
[ fst.size - fst.offset, block_size ].min, [ fst.size - fst.offset, block_size ].min,
fs.map {|f| [f.file, f.offset] }.to_h fs.map {|f| [f.file, f.offset] }.to_h