Improve reiser4 file system uuid reading method

Previously used "fsck.reiser4" to perform a file system check with a by
product of outputting the uuid.  However this performs a lot of disk I/O
and takes a while to complete.  Instead use the much faster and less
resource intensive "debugfs.reiser4" tool to retrieve the uuid.
This commit is contained in:
Mike Fleetwood 2012-03-13 01:12:37 +00:00 committed by Curtis Gedak
parent 3a41a30fcd
commit 2919057abd
1 changed files with 5 additions and 6 deletions

View File

@ -28,7 +28,10 @@ FS reiser4::get_filesystem_support()
fs .filesystem = GParted::FS_REISER4 ; fs .filesystem = GParted::FS_REISER4 ;
if ( ! Glib::find_program_in_path( "debugfs.reiser4" ) .empty() ) if ( ! Glib::find_program_in_path( "debugfs.reiser4" ) .empty() )
{
fs .read = GParted::FS::EXTERNAL ; fs .read = GParted::FS::EXTERNAL ;
fs .read_uuid = GParted::FS::EXTERNAL ;
}
if ( ! Glib::find_program_in_path( "vol_id" ) .empty() ) if ( ! Glib::find_program_in_path( "vol_id" ) .empty() )
fs .read_label = FS::EXTERNAL ; fs .read_label = FS::EXTERNAL ;
@ -37,11 +40,7 @@ FS reiser4::get_filesystem_support()
fs .create = GParted::FS::EXTERNAL ; fs .create = GParted::FS::EXTERNAL ;
if ( ! Glib::find_program_in_path( "fsck.reiser4" ) .empty() ) if ( ! Glib::find_program_in_path( "fsck.reiser4" ) .empty() )
{
fs .read_uuid = GParted::FS::EXTERNAL ;
fs .check = GParted::FS::EXTERNAL ; fs .check = GParted::FS::EXTERNAL ;
}
if ( fs .check ) if ( fs .check )
{ {
@ -107,9 +106,9 @@ bool reiser4::write_label( const Partition & partition, OperationDetail & operat
void reiser4::read_uuid( Partition & partition ) void reiser4::read_uuid( Partition & partition )
{ {
if ( ! Utils::execute_command( "fsck.reiser4 --check --yes " + partition .get_path(), output, error, true ) ) if ( ! Utils::execute_command( "debugfs.reiser4 " + partition .get_path(), output, error, true ) )
{ {
partition .uuid = Utils::regexp_label( error, "uuid:[[:blank:]]*([^[:space:]]*)" ) ; partition .uuid = Utils::regexp_label( output, "uuid:[[:blank:]]*([^[:space:]]*)" ) ;
} }
else else
{ {