Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
vmt.c File Reference
#include <linux/err.h>
#include <linux/math64.h>
#include <linux/slab.h>
#include <linux/export.h>
#include "ubi.h"

Go to the source code of this file.

Functions

int ubi_create_volume (struct ubi_device *ubi, struct ubi_mkvol_req *req)
 
int ubi_remove_volume (struct ubi_volume_desc *desc, int no_vtbl)
 
int ubi_resize_volume (struct ubi_volume_desc *desc, int reserved_pebs)
 
int ubi_rename_volumes (struct ubi_device *ubi, struct list_head *rename_list)
 
int ubi_add_volume (struct ubi_device *ubi, struct ubi_volume *vol)
 
void ubi_free_volume (struct ubi_device *ubi, struct ubi_volume *vol)
 

Function Documentation

int ubi_add_volume ( struct ubi_device ubi,
struct ubi_volume vol 
)

ubi_add_volume - add volume. : UBI device description object : volume description object

This function adds an existing volume and initializes all its data structures. Returns zero in case of success and a negative error code in case of failure.

Definition at line 633 of file vmt.c.

int ubi_create_volume ( struct ubi_device ubi,
struct ubi_mkvol_req req 
)

ubi_create_volume - create volume. : UBI device description object : volume creation request

This function creates volume described by . If ->vol_id id UBI_VOL_NUM_AUTO, this function automatically assign ID to the new volume and saves it in ->vol_id. Returns zero in case of success and a negative error code in case of failure. Note, the caller has to have the ->device_mutex locked.

Definition at line 201 of file vmt.c.

void ubi_free_volume ( struct ubi_device ubi,
struct ubi_volume vol 
)

ubi_free_volume - free volume. : UBI device description object : volume description object

This function frees all resources for volume but does not remove it. Used only when the UBI device is detached.

Definition at line 683 of file vmt.c.

int ubi_remove_volume ( struct ubi_volume_desc desc,
int  no_vtbl 
)

ubi_remove_volume - remove volume. : volume descriptor : do not change volume table if not zero

This function removes volume described by . The volume has to be opened in "exclusive" mode. Returns zero in case of success and a negative error code in case of failure. The caller has to have the ->device_mutex locked.

Definition at line 403 of file vmt.c.

int ubi_rename_volumes ( struct ubi_device ubi,
struct list_head rename_list 
)

ubi_rename_volumes - re-name UBI volumes. : UBI device description object : list of &struct ubi_rename_entry objects

This function re-names or removes volumes specified in the re-name list. Returns zero in case of success and a negative error code in case of failure.

Definition at line 594 of file vmt.c.

int ubi_resize_volume ( struct ubi_volume_desc desc,
int  reserved_pebs 
)

ubi_resize_volume - re-size volume. : volume descriptor : new size in physical eraseblocks

This function re-sizes the volume and returns zero in case of success, and a negative error code in case of failure. The caller has to have the ->device_mutex locked.

Definition at line 474 of file vmt.c.