linux/block/partitions/cmdline.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2013 HUAWEI
 * Author: Cai Zhiyong <[email protected]>
 *
 * Read block device partition table from the command line.
 * Typically used for fixed block (eMMC) embedded devices.
 * It has no MBR, so saves storage space. Bootloader can be easily accessed
 * by absolute address of data on the block device.
 * Users can easily change the partition.
 *
 * The format for the command line is just like mtdparts.
 *
 * For further information, see "Documentation/block/cmdline-partition.rst"
 *
 */
#include <linux/blkdev.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include "check.h"


/* partition flags */
#define PF_RDONLY
#define PF_POWERUP_LOCK

struct cmdline_subpart {};

struct cmdline_parts {};

static int parse_subpart(struct cmdline_subpart **subpart, char *partdef)
{}

static void free_subpart(struct cmdline_parts *parts)
{}

static int parse_parts(struct cmdline_parts **parts, char *bdevdef)
{}

static void cmdline_parts_free(struct cmdline_parts **parts)
{}

static int cmdline_parts_parse(struct cmdline_parts **parts,
		const char *cmdline)
{}

static struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
					 const char *bdev)
{}

static char *cmdline;
static struct cmdline_parts *bdev_parts;

static int add_part(int slot, struct cmdline_subpart *subpart,
		struct parsed_partitions *state)
{}

static int cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
		struct parsed_partitions *state)
{}

static int __init cmdline_parts_setup(char *s)
{}
__setup();

static bool has_overlaps(sector_t from, sector_t size,
			 sector_t from2, sector_t size2)
{}

static inline void overlaps_warns_header(void)
{}

static void cmdline_parts_verifier(int slot, struct parsed_partitions *state)
{}

/*
 * Purpose: allocate cmdline partitions.
 * Returns:
 * -1 if unable to read the partition table
 *  0 if this isn't our partition table
 *  1 if successful
 */
int cmdline_partition(struct parsed_partitions *state)
{}