OSDN Git Service

lib-fs-resize: rewrite ped_file_system_clobber
authorJim Meyering <meyering@redhat.com>
Tue, 20 Dec 2011 09:27:45 +0000 (10:27 +0100)
committerJim Meyering <meyering@redhat.com>
Fri, 10 Feb 2012 19:05:49 +0000 (20:05 +0100)
commitf5308e408980443b20cb35696b09e1f6e6e60966
tree264c3485b8bd94bfd8ee0d7131a392f72a910b9c
parent4792baed9f00107cedd162271a9ef75195c63fe2
lib-fs-resize: rewrite ped_file_system_clobber

Before, it would probe for an existing file system type and then,
according to what it found, call the corresponding <FS_TYPE>_clobber
function.  Now that we have restored only HFS and FAT FS-writing
support, only those few types have a corresponding _clobber function.
We would obviously fail to clear common types of file systems, and even
if we were to restore all previous _clobber functions, none of those
were able to handle sector sizes larger than 512.  Not worth it.
* libparted/fs/r/filesys.c: Include pt-tools.h.
(MIN): Define.
(ped_file_system_clobber): Rewrite not to use hfs*_clobber or
fat_clobber.  Instead, simply clear the first three and last two
sectors of the specified "device".
* libparted/fs/Makefile.am (INCLUDES): Add
-I$(top_srcdir)/libparted/labels for new use of a ptt_* function.
libparted/fs/Makefile.am
libparted/fs/r/filesys.c