cache.c revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted - a library for manipulating disk partitions
Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DISCOVER_ONLY
#include <config.h>
#include <stdint.h>
#if ENABLE_NLS
# include <libintl.h>
#else
#endif /* ENABLE_NLS */
#include "hfs.h"
#include "cache.h"
static HfsCPrivateCacheTable*
hfsc_new_cachetable(unsigned int size)
{
ret->table_first_free = 0;
return ret;
}
{
unsigned int cachetable_size, i;
/* following code avoid integer overflow */
;
* ret->linked_ref_size );
if (!ret->table_list) {
return NULL;
}
for (i = 0; i < ret->linked_ref_size; ++i)
ret->needed_alloc_size = 0;
return ret;
}
static void
{
while (list) {
}
}
void
{
}
{
if (ext) {
_("Trying to register an extent starting at block "
"0x%X, but another one already exists at this "
"position. You should check the file system!"),
start);
return NULL;
}
/ CR_NEW_ALLOC_DIV )
+ CR_ADD_CST );
return NULL;
}
(unsigned) PED_SECTOR_SIZE_DEFAULT * sbb ?
(unsigned) PED_SECTOR_SIZE_DEFAULT * sbb;
return ext;
}
{
return ret;
}
/* Can't fail if extent begining at old_start exists */
/* Returns 0 if no such extent, or on error */
{
if (pext) {
_("Trying to move an extent from block Ox%X to block "
"Ox%X, but another one already exists at this "
"position. This should not happen!"),
return NULL;
}
/* removing the extent from the cache */
/* change ext_start and insert the extent again */
return pext;
}
#endif /* DISCOVER_ONLY */