PedFileSystem

Note:
File systems exist on a PedGeometry - NOT a PedPartition.
More...

Files

file  filesys.h

Data Structures

struct  _PedFileSystem
 Structure describing file system. More...
struct  _PedFileSystemOps
struct  _PedFileSystemType
 Structure describing type of file system. More...

Defines

#define _(String)   (String)
#define BUFFER_SIZE   4096

Typedefs

typedef _PedFileSystem PedFileSystem
typedef _PedFileSystemOps PedFileSystemOps
typedef _PedFileSystemType PedFileSystemType

Functions

int ped_file_system_check (PedFileSystem *fs, PedTimer *timer)
 Check fs file system for errors.
int ped_file_system_clobber (PedGeometry *geom)
 This function erases all file system signatures that indicate that a file system occupies a given region described by geom.
int ped_file_system_close (PedFileSystem *fs)
 Close file system fs.
PedFileSystemped_file_system_copy (PedFileSystem *fs, PedGeometry *geom, PedTimer *timer)
 Create a new file system (of the same type) on geom, and copy the contents of fs into the new filesystem.
PedFileSystemped_file_system_create (PedGeometry *geom, const PedFileSystemType *type, PedTimer *timer)
 This function initializes a new file system of type type on a region described by geom, writing out appropriate metadata and signatures.
PedConstraint * ped_file_system_get_copy_constraint (const PedFileSystem *fs, const PedDevice *dev)
 Get the constraint on copying fs with ped_file_system_copy() to somewhere on dev.
PedConstraint * ped_file_system_get_create_constraint (const PedFileSystemType *fs_type, const PedDevice *dev)
 This function returns a constraint on the region that all file systems of a particular type fs_type created on device dev with ped_file_system_create() must satisfy.
PedConstraint * ped_file_system_get_resize_constraint (const PedFileSystem *fs)
 Return a constraint, that represents all of the possible ways the file system fs can be resized with ped_file_system_resize().
PedFileSystemped_file_system_open (PedGeometry *geom)
 This function opens the file system stored on geom, if it can find one.
PedFileSystemTypeped_file_system_probe (PedGeometry *geom)
 Attempt to detect a file system in region geom.
PedGeometryped_file_system_probe_specific (const PedFileSystemType *fs_type, PedGeometry *geom)
 Attempt to find a file system and return the region it occupies.
int ped_file_system_resize (PedFileSystem *fs, PedGeometry *geom, PedTimer *timer)
 Resize fs to new geometry geom.
PedFileSystemTypeped_file_system_type_get (const char *name)
 Get a PedFileSystemType by its name.
PedFileSystemTypeped_file_system_type_get_next (const PedFileSystemType *fs_type)
 Get the next PedFileSystemType after fs_type.
void ped_file_system_type_register (PedFileSystemType *fs_type)
void ped_file_system_type_unregister (PedFileSystemType *fs_type)

Detailed Description

Note:
File systems exist on a PedGeometry - NOT a PedPartition.


Function Documentation

int ped_file_system_check ( PedFileSystem fs,
PedTimer *  timer 
)

Check fs file system for errors.

Exceptions:
PED_EXCEPTION_NO_FEATURE if checking file system fs is not implemented yet
Returns:
0 on failure (i.e. unfixed errors)

int ped_file_system_clobber ( PedGeometry geom  ) 

This function erases all file system signatures that indicate that a file system occupies a given region described by geom.

After this operation ped_file_system_probe() won't detect any file system.

Note:
ped_file_system_create() calls this before creating a new file system.
Returns:
1 on success, 0 on failure

int ped_file_system_close ( PedFileSystem fs  ) 

Close file system fs.

Returns:
1 on success, 0 on failure

PedFileSystem * ped_file_system_copy ( PedFileSystem fs,
PedGeometry geom,
PedTimer *  timer 
)

Create a new file system (of the same type) on geom, and copy the contents of fs into the new filesystem.

If timer is non-NULL, it is used as the progress meter.

Exceptions:
PED_EXCEPTION_ERROR when trying to copy onto an overlapping partition
PED_EXCEPTION_NO_FEATURE if copying of file system fs is not implemented yet
Returns:
a new PedFileSystem on success, NULL on failure

PedFileSystem * ped_file_system_create ( PedGeometry geom,
const PedFileSystemType type,
PedTimer *  timer 
)

This function initializes a new file system of type type on a region described by geom, writing out appropriate metadata and signatures.

If timer is non-NULL, it is used as the progress meter.

Exceptions:
PED_EXCEPTION_NO_FEATURE if creating file system type type is not implemented yet
Returns:
a PedFileSystem on success, NULL on failure

PedConstraint * ped_file_system_get_copy_constraint ( const PedFileSystem fs,
const PedDevice dev 
)

Get the constraint on copying fs with ped_file_system_copy() to somewhere on dev.

Returns:
a PedConstraint on success, NULL on failure

PedConstraint * ped_file_system_get_create_constraint ( const PedFileSystemType fs_type,
const PedDevice dev 
)

This function returns a constraint on the region that all file systems of a particular type fs_type created on device dev with ped_file_system_create() must satisfy.

For example, FAT16 file systems must be at least 32 megabytes.

Returns:
NULL on failure

PedConstraint * ped_file_system_get_resize_constraint ( const PedFileSystem fs  ) 

Return a constraint, that represents all of the possible ways the file system fs can be resized with ped_file_system_resize().

This takes into account the amount of used space on the filesystem fs and the capabilities of the resize algorithm. Hints:

  1. if constraint->start_align->grain_size == 0, or constraint->start_geom->length == 1, then the start can not be moved
  2. constraint->min_size is the minimum size you can resize the partition to. You might want to tell the user this ;-).

Returns:
a PedConstraint on success, NULL on failure

PedFileSystem * ped_file_system_open ( PedGeometry geom  ) 

This function opens the file system stored on geom, if it can find one.

It is often called in the following manner:

        fs = ped_file_system_open (&part.geom)

Exceptions:
PED_EXCEPTION_ERROR if file system could not be detected
PED_EXCEPTION_ERROR if the file system is bigger than its volume
PED_EXCEPTION_NO_FEATURE if opening of a file system stored on geom is not implemented
Returns:
a PedFileSystem on success, NULL on failure.

PedFileSystemType * ped_file_system_probe ( PedGeometry geom  ) 

Attempt to detect a file system in region geom.

This function tries to be clever at dealing with ambiguous situations, such as when one file system was not completely erased before a new file system was created on top of it.

Returns:
a new PedFileSystem on success, NULL on failure

PedGeometry * ped_file_system_probe_specific ( const PedFileSystemType fs_type,
PedGeometry geom 
)

Attempt to find a file system and return the region it occupies.

Parameters:
fs_type The file system type to probe for.
geom The region to be searched.
Returns:
NULL if fs_type file system wasn't detected

int ped_file_system_resize ( PedFileSystem fs,
PedGeometry geom,
PedTimer *  timer 
)

Resize fs to new geometry geom.

geom should satisfy the ped_file_system_get_resize_constraint(). (This isn't asserted, so it's not a bug not to... just it's likely to fail ;) If timer is non-NULL, it is used as the progress meter.

Exceptions:
PED_EXCEPTION_NO_FEATURE if resizing of file system fs is not implemented yet
Returns:
0 on failure

PedFileSystemType * ped_file_system_type_get ( const char *  name  ) 

Get a PedFileSystemType by its name.

Returns:
NULL if none found.

PedFileSystemType * ped_file_system_type_get_next ( const PedFileSystemType fs_type  ) 

Get the next PedFileSystemType after fs_type.

Returns:
NULL if fs_type is the last item in the list.


Generated on Fri May 4 05:15:31 2007 for libparted by  doxygen 1.5.2