Skip to content

Commit

Permalink
Merge pull request #13 from AhmedKamal1432/test-v0.5
Browse files Browse the repository at this point in the history
Implement fast formatting
  • Loading branch information
cpg committed Aug 22, 2015
2 parents 7dc6ed4 + e34a302 commit 1888b3a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/disk_wizard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def confirmation
# Expected key:values in @params:
# :debug => Integer value(1) if debug mode has selected in fourth step(confirmation), else nil
def progress
Device.progress = 0
debug_mode = params[:debug]
self.user_selections = {debug: debug_mode}
end
Expand All @@ -113,7 +114,6 @@ def process_disk

jobs_queue = JobQueue.new(user_selections.length)
jobs_queue.enqueue({job_name: :pre_checks_job, job_para: {path: path}})
Device.progress = 0

if user_selections['format']
para = {path: path, fs_type: user_selections['fs_type'], label: label}
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
match 'manage' => 'disk_wizard#manage_disk',via: [:get,:post]
match 'confirmation' => 'disk_wizard#confirmation',via: [:get,:post]
get 'complete' => 'disk_wizard#done'
get 'get_progress' => 'disk_wizard#operations_progress'
get 'error' => 'disk_wizard#error'
get 'debug_info' => 'disk_wizard#debug_info'
post 'process' => 'disk_wizard#progress'
Expand Down
6 changes: 3 additions & 3 deletions lib/disk_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ def mount mount_point, disk
def format device, fstype
case fstype
when Partition.FilesystemType[:TYPE_EXT4]
params = " -q #{device.path}"
params = " -q -E lazy_itable_init #{device.path}"
program_name = 'ext4'
when Partition.FilesystemType[:TYPE_EXT3]
params = " -q #{device.path}"
params = " -q -E lazy_itable_init #{device.path}"
program_name = 'ext3'
when Partition.FilesystemType[:TYPE_NTFS]
params = " -q -f #{device.path}" # Perform quick (fast) format and -q for quiet execution
params = " -q -f -Q #{device.path}" # Perform quick (fast) format and -q for quiet execution
program_name = 'ntfs'
when Partition.FilesystemType[:TYPE_FAT32]
params = " #{device.path}"
Expand Down

0 comments on commit 1888b3a

Please sign in to comment.