Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mtdpart.c File Reference
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/kmod.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/err.h>
#include "mtdcore.h"

Go to the source code of this file.

Data Structures

struct  mtd_part


#define PART(x)   ((struct mtd_part *)(x))
#define put_partition_parser(p)   do { module_put((p)->owner); } while (0)


void mtd_erase_callback (struct erase_info *instr)
 EXPORT_SYMBOL_GPL (mtd_erase_callback)
int del_mtd_partitions (struct mtd_info *master)
int mtd_add_partition (struct mtd_info *master, char *name, long long offset, long long length)
 EXPORT_SYMBOL_GPL (mtd_add_partition)
int mtd_del_partition (struct mtd_info *master, int partno)
 EXPORT_SYMBOL_GPL (mtd_del_partition)
int add_mtd_partitions (struct mtd_info *master, const struct mtd_partition *parts, int nbparts)
int register_mtd_parser (struct mtd_part_parser *p)
 EXPORT_SYMBOL_GPL (register_mtd_parser)
int deregister_mtd_parser (struct mtd_part_parser *p)
 EXPORT_SYMBOL_GPL (deregister_mtd_parser)
int parse_mtd_partitions (struct mtd_info *master, const char **types, struct mtd_partition **pparts, struct mtd_part_parser_data *data)
int mtd_is_partition (const struct mtd_info *mtd)
 EXPORT_SYMBOL_GPL (mtd_is_partition)
uint64_t mtd_get_device_size (const struct mtd_info *mtd)
 EXPORT_SYMBOL_GPL (mtd_get_device_size)

Macro Definition Documentation

#define PART (   x)    ((struct mtd_part *)(x))

Definition at line 52 of file mtdpart.c.

#define put_partition_parser (   p)    do { module_put((p)->owner); } while (0)

Definition at line 672 of file mtdpart.c.

Function Documentation

int add_mtd_partitions ( struct mtd_info master,
const struct mtd_partition parts,
int  nbparts 

Definition at line 625 of file mtdpart.c.

int del_mtd_partitions ( struct mtd_info master)

Definition at line 321 of file mtdpart.c.

int deregister_mtd_parser ( struct mtd_part_parser p)

Definition at line 684 of file mtdpart.c.

EXPORT_SYMBOL_GPL ( mtd_erase_callback  )
EXPORT_SYMBOL_GPL ( mtd_add_partition  )
EXPORT_SYMBOL_GPL ( mtd_del_partition  )
EXPORT_SYMBOL_GPL ( register_mtd_parser  )
EXPORT_SYMBOL_GPL ( deregister_mtd_parser  )
EXPORT_SYMBOL_GPL ( mtd_is_partition  )
EXPORT_SYMBOL_GPL ( mtd_get_device_size  )
int mtd_add_partition ( struct mtd_info master,
char name,
long long  offset,
long long  length 

Definition at line 536 of file mtdpart.c.

int mtd_del_partition ( struct mtd_info master,
int  partno 

Definition at line 593 of file mtdpart.c.

void mtd_erase_callback ( struct erase_info instr)

Definition at line 241 of file mtdpart.c.

uint64_t mtd_get_device_size ( const struct mtd_info mtd)

Definition at line 768 of file mtdpart.c.

int mtd_is_partition ( const struct mtd_info mtd)

Definition at line 750 of file mtdpart.c.

int parse_mtd_partitions ( struct mtd_info master,
const char **  types,
struct mtd_partition **  pparts,
struct mtd_part_parser_data data 

parse_mtd_partitions - parse MTD partitions : the master partition (describes whole MTD device) : names of partition parsers to try or NULL : array of partitions found is returned here : MTD partition parser-specific data

This function tries to find partition on MTD device . It uses MTD partition parsers, specified in . However, if is NULL, then the default list of parsers is used. The default list contains only the "cmdlinepart" and "ofpart" parsers ATM. Note: If there are more then one parser in , the kernel only takes the partitions parsed out by the first parser.

This function may return: o a negative error code in case of failure o zero if no partitions were found o a positive number of found partitions, in which case on exit will point to an array containing this number of &struct mtd_info objects.

Definition at line 723 of file mtdpart.c.

int register_mtd_parser ( struct mtd_part_parser p)

Definition at line 674 of file mtdpart.c.