linux/block/partitions/check.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2#include <linux/pagemap.h>
   3#include <linux/blkdev.h>
   4#include <linux/genhd.h>
   5#include "../blk.h"
   6
   7/*
   8 * add_gd_partition adds a partitions details to the devices partition
   9 * description.
  10 */
  11struct parsed_partitions {
  12        struct block_device *bdev;
  13        char name[BDEVNAME_SIZE];
  14        struct {
  15                sector_t from;
  16                sector_t size;
  17                int flags;
  18                bool has_info;
  19                struct partition_meta_info info;
  20        } *parts;
  21        int next;
  22        int limit;
  23        bool access_beyond_eod;
  24        char *pp_buf;
  25};
  26
  27typedef struct {
  28        struct page *v;
  29} Sector;
  30
  31void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p);
  32static inline void put_dev_sector(Sector p)
  33{
  34        put_page(p.v);
  35}
  36
  37static inline void
  38put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size)
  39{
  40        if (n < p->limit) {
  41                char tmp[1 + BDEVNAME_SIZE + 10 + 1];
  42
  43                p->parts[n].from = from;
  44                p->parts[n].size = size;
  45                snprintf(tmp, sizeof(tmp), " %s%d", p->name, n);
  46                strlcat(p->pp_buf, tmp, PAGE_SIZE);
  47        }
  48}
  49
  50/* detection routines go here in alphabetical order: */
  51int adfspart_check_ADFS(struct parsed_partitions *state);
  52int adfspart_check_CUMANA(struct parsed_partitions *state);
  53int adfspart_check_EESOX(struct parsed_partitions *state);
  54int adfspart_check_ICS(struct parsed_partitions *state);
  55int adfspart_check_POWERTEC(struct parsed_partitions *state);
  56int aix_partition(struct parsed_partitions *state);
  57int amiga_partition(struct parsed_partitions *state);
  58int atari_partition(struct parsed_partitions *state);
  59int cmdline_partition(struct parsed_partitions *state);
  60int efi_partition(struct parsed_partitions *state);
  61int ibm_partition(struct parsed_partitions *);
  62int karma_partition(struct parsed_partitions *state);
  63int ldm_partition(struct parsed_partitions *state);
  64int mac_partition(struct parsed_partitions *state);
  65int msdos_partition(struct parsed_partitions *state);
  66int osf_partition(struct parsed_partitions *state);
  67int sgi_partition(struct parsed_partitions *state);
  68int sun_partition(struct parsed_partitions *state);
  69int sysv68_partition(struct parsed_partitions *state);
  70int ultrix_partition(struct parsed_partitions *state);
  71