Add virtual move method to FileSystem class

This is preparation work for the following bug report:
Bug #589555 - Moving a swap partition needlessly copies
              all "data" on it
This commit is contained in:
Curtis Gedak 2010-10-19 13:35:53 -06:00
parent 42dafa2e6a
commit ca30f986f7
31 changed files with 203 additions and 17 deletions

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,6 +42,10 @@ public:
virtual bool resize( const Partition & partition_new,
OperationDetail & operationdetail,
bool fill_partition = false ) = 0 ;
virtual bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) = 0 ;
virtual bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) = 0 ;

View file

@ -1,4 +1,5 @@
/* Copyright (C) 2009,2010 Luca Bruno <lucab@debian.org>
* Copyright (C) 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -32,6 +33,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2008 Curtis Gedak
/* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -33,6 +33,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -34,6 +34,10 @@ public:
bool write_label( const Partition & partition, OperationDetail & operationdetail ) ;
bool create( const Partition & new_partition, OperationDetail & operationdetail ) ;
bool resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition = false ) ;
bool move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
) ;
bool copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail ) ;

View file

@ -1,4 +1,5 @@
/* Copyright (C) 2009,2010 Luca Bruno <lucab@debian.org>
* Copyright (C) 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -106,6 +107,14 @@ bool btrfs::write_label( const Partition & partition, OperationDetail & operatio
return true ;
}
bool btrfs::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool btrfs::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -121,6 +121,14 @@ bool ext2::resize( const Partition & partition_new, OperationDetail & operationd
return ! execute_command( str_temp, operationdetail ) ;
}
bool ext2::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool ext2::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -122,6 +122,14 @@ bool ext3::resize( const Partition & partition_new, OperationDetail & operationd
return ! execute_command( str_temp, operationdetail ) ;
}
bool ext3::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool ext3::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -125,6 +125,14 @@ bool ext4::resize( const Partition & partition_new, OperationDetail & operationd
return ! execute_command( str_temp, operationdetail ) ;
}
bool ext4::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool ext4::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -161,6 +161,14 @@ bool fat16::resize( const Partition & partition_new, OperationDetail & operation
return true ;
}
bool fat16::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool fat16::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -160,6 +160,14 @@ bool fat32::resize( const Partition & partition_new, OperationDetail & operation
return true ;
}
bool fat32::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool fat32::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -91,6 +91,14 @@ bool hfs::resize( const Partition & partition_new, OperationDetail & operationde
return true ;
}
bool hfs::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool hfs::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -89,6 +89,14 @@ bool hfsplus::resize( const Partition & partition_new, OperationDetail & operati
return true ;
}
bool hfsplus::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool hfsplus::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -216,6 +216,14 @@ bool jfs::resize( const Partition & partition_new, OperationDetail & operationde
return return_value ;
}
bool jfs::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool jfs::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -93,6 +93,14 @@ bool linux_swap::resize( const Partition & partition_new, OperationDetail & oper
return exit_status ;
}
bool linux_swap::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool linux_swap::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -149,6 +149,14 @@ bool ntfs::resize( const Partition & partition_new, OperationDetail & operationd
return return_value ;
}
bool ntfs::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool ntfs::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -112,6 +112,14 @@ bool reiser4::resize( const Partition & partition_new, OperationDetail & operati
return true ;
}
bool reiser4::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool reiser4::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -133,6 +133,14 @@ bool reiserfs::resize( const Partition & partition_new, OperationDetail & operat
return ( exit_status == 0 || exit_status == 256 ) ;
}
bool reiserfs::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool reiserfs::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2004 Bart
* Copyright (C) 2008 Curtis Gedak
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -57,6 +57,14 @@ bool ufs::resize( const Partition & partition_new, OperationDetail & operationde
return true ;
}
bool ufs::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool ufs::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )

View file

@ -222,6 +222,14 @@ bool xfs::resize( const Partition & partition_new, OperationDetail & operationde
return return_value ;
}
bool xfs::move( const Partition & partition_new
, const Partition & partition_old
, OperationDetail & operationdetail
)
{
return true ;
}
bool xfs::copy( const Glib::ustring & src_part_path,
const Glib::ustring & dest_part_path,
OperationDetail & operationdetail )