Loading...
Searching...
No Matches
PedFileSystem

## Files

file | filesys.h

## Data Structures

struct | _PedFileSystem
| Structure describing file system. More...
struct | _PedFileSystemAlias
| Structure describing a file system alias. More...
struct | _PedFileSystemOps
struct | _PedFileSystemType
| Structure describing type of file system. More...

## Macros

#define | _(String)
#define | _(String)
#define | BUFFER_SIZE 4096 /* in sectors */
#define | MIN(a, b)
#define | STREQ(a, b)

## Typedefs

typedef int(* | close_fn_t) (PedFileSystem *)
typedef PedFileSystem *(* | open_fn_t) (PedGeometry *)
typedef struct _PedFileSystem | PedFileSystem
typedef struct _PedFileSystem | PedFileSystem
typedef struct _PedFileSystemAlias | PedFileSystemAlias
typedef struct _PedFileSystemAlias | PedFileSystemAlias
typedef const struct _PedFileSystemOps | PedFileSystemOps
typedef const struct _PedFileSystemOps | PedFileSystemOps
typedef struct _PedFileSystemType | PedFileSystemType
typedef struct _PedFileSystemType | PedFileSystemType
typedef PedConstraint *(* | resize_constraint_fn_t) (PedFileSystem const *fs)
typedef int(* | resize_fn_t) (PedFileSystem *fs, PedGeometry *geom, PedTimer *timer)

## Functions

int | fat_close (PedFileSystem *)
PedConstraint * | fat_get_resize_constraint (PedFileSystem const *fs)
PedFileSystem * | fat_open (PedGeometry *)
int | fat_resize (PedFileSystem *fs, PedGeometry *geom, PedTimer *timer)
int | hfs_close (PedFileSystem *)
PedConstraint * | hfs_get_resize_constraint (PedFileSystem const *fs)
PedFileSystem * | hfs_open (PedGeometry *)
int | hfs_resize (PedFileSystem *fs, PedGeometry *geom, PedTimer *timer)
int | hfsplus_close (PedFileSystem *)
PedConstraint * | hfsplus_get_resize_constraint (PedFileSystem const *fs)
PedFileSystem * | hfsplus_open (PedGeometry *)
int | hfsplus_resize (PedFileSystem *fs, PedGeometry *geom, PedTimer *timer)
PedFileSystemAlias * | ped_file_system_alias_get_next (const PedFileSystemAlias *fs_alias)
| Get the next PedFileSystemAlias after `fs_alias`.
void | ped_file_system_alias_register (PedFileSystemType *type, const char *alias, int deprecated)
void | ped_file_system_alias_unregister (PedFileSystemType *type, const char *alias)
int | ped_file_system_close (PedFileSystem *fs)
| Close file system `fs`.
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().
PedFileSystem * | ped_file_system_open (PedGeometry *geom)
| This function opens the file system stored on `geom`, if it can find one.
PedFileSystemType * | ped_file_system_probe (PedGeometry *geom)
| Attempt to detect a file system in region `geom`.
PedGeometry * | ped_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`.
PedFileSystemType * | ped_file_system_type_get (const char *name)
| Get a PedFileSystemType by its `name`.
PedFileSystemType * | ped_file_system_type_get_next (const PedFileSystemType *fs_type)
| Get the next PedFileSystemType after `fs_type`.
void | ped_file_system_type_register (PedFileSystemType *type)
void | ped_file_system_type_unregister (PedFileSystemType *type)

## Detailed Description

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

## Macro Definition Documentation

## _ [1/2]

#define _ | ( |  | String | ) |

Value:
(String)

## _ [2/2]

#define _ | ( |  | String | ) |

Value:
(String)

## BUFFER_SIZE

#define BUFFER_SIZE 4096 /* in sectors */

## MIN

#define MIN | ( |  | a,
|  |  | b )

Value:
(((a) < (b)) ? (a) : (b))

## STREQ

#define STREQ | ( |  | a,
|  |  | b )

Value:
(strcmp (a, b) == 0)

## Typedef Documentation

## close_fn_t

typedef int(* close_fn_t) (PedFileSystem *)

## open_fn_t

typedef PedFileSystem *(* open_fn_t) (PedGeometry *)

## PedFileSystem [1/2]

typedef struct _PedFileSystem PedFileSystem

## PedFileSystem [2/2]

typedef struct _PedFileSystem PedFileSystem

## PedFileSystemAlias [1/2]

typedef struct _PedFileSystemAlias PedFileSystemAlias

## PedFileSystemAlias [2/2]

typedef struct _PedFileSystemAlias PedFileSystemAlias

## PedFileSystemOps [1/2]

typedef const struct _PedFileSystemOps PedFileSystemOps

## PedFileSystemOps [2/2]

typedef const struct _PedFileSystemOps PedFileSystemOps

## PedFileSystemType [1/2]

typedef struct _PedFileSystemType PedFileSystemType

## PedFileSystemType [2/2]

typedef struct _PedFileSystemType PedFileSystemType

## resize_constraint_fn_t

typedef PedConstraint *(* resize_constraint_fn_t) (PedFileSystem const *fs)

## resize_fn_t

typedef int(* resize_fn_t) (PedFileSystem *fs, PedGeometry *geom, PedTimer *timer)

## Function Documentation

## fat_close()

int fat_close | ( | PedFileSystem * | fs | ) |

extern

## fat_get_resize_constraint()

PedConstraint * fat_get_resize_constraint | ( | PedFileSystem const * | fs | ) |

extern

## fat_open()

PedFileSystem * fat_open | ( | PedGeometry * | geom | ) |

extern

## fat_resize()

int fat_resize | ( | PedFileSystem * | fs,
|  | PedGeometry * | geom,
|  | PedTimer * | timer )

extern

## hfs_close()

int hfs_close | ( | PedFileSystem * | fs | ) |

extern

## hfs_get_resize_constraint()

PedConstraint * hfs_get_resize_constraint | ( | PedFileSystem const * | fs | ) |

extern

## hfs_open()

PedFileSystem * hfs_open | ( | PedGeometry * | geom | ) |

extern

## hfs_resize()

int hfs_resize | ( | PedFileSystem * | fs,
|  | PedGeometry * | geom,
|  | PedTimer * | timer )

extern

## hfsplus_close()

int hfsplus_close | ( | PedFileSystem * | fs | ) |

extern

## hfsplus_get_resize_constraint()

PedConstraint * hfsplus_get_resize_constraint | ( | PedFileSystem const * | fs | ) |

extern

## hfsplus_open()

PedFileSystem * hfsplus_open | ( | PedGeometry * | geom | ) |

extern

## hfsplus_resize()

int hfsplus_resize | ( | PedFileSystem * | fs,
|  | PedGeometry * | geom,
|  | PedTimer * | timer )

extern

## ped_file_system_alias_get_next()

PedFileSystemAlias * ped_file_system_alias_get_next | ( | const PedFileSystemAlias * | fs_alias | ) |

extern

Get the next PedFileSystemAlias after `fs_alias`.

Returns
  `NULL` if `fs_alias` is the last item in the list.

## ped_file_system_alias_register()

void ped_file_system_alias_register | ( | PedFileSystemType * | type,
|  | const char * | alias,
|  | int | deprecated )

extern

## ped_file_system_alias_unregister()

void ped_file_system_alias_unregister | ( | PedFileSystemType * | type,
|  | const char * | alias )

extern

## ped_file_system_close()

int ped_file_system_close | ( | PedFileSystem * | fs | ) |

Close file system `fs`.

Returns
  `1` on success, `0` on failure

## ped_file_system_get_resize_constraint()

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 cannot 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

## ped_file_system_open()

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)
ped_file_system_open
PedFileSystem * ped_file_system_open(PedGeometry *geom)
This function opens the file system stored on geom, if it can find one.
Definition filesys.c:142

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.

## ped_file_system_probe()

PedFileSystemType * ped_file_system_probe | ( | PedGeometry * | geom | ) |

extern

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

## ped_file_system_probe_specific()

PedGeometry * ped_file_system_probe_specific | ( | const PedFileSystemType * | fs_type,
|  | PedGeometry * | geom )

extern

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

## ped_file_system_resize()

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

## ped_file_system_type_get()

PedFileSystemType * ped_file_system_type_get | ( | const char * | name | ) |

extern

Get a PedFileSystemType by its `name`.

Returns
  `NULL` if none found.

## ped_file_system_type_get_next()

PedFileSystemType * ped_file_system_type_get_next | ( | const PedFileSystemType * | fs_type | ) |

extern

Get the next PedFileSystemType after `fs_type`.

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

## ped_file_system_type_register()

void ped_file_system_type_register | ( | PedFileSystemType * | type | ) |

extern

## ped_file_system_type_unregister()

void ped_file_system_type_unregister | ( | PedFileSystemType * | type | ) |

extern