linux/block/partitions/check.c
<<
>>
Prefs
   1/*
   2 *  fs/partitions/check.c
   3 *
   4 *  Code extracted from drivers/block/genhd.c
   5 *  Copyright (C) 1991-1998  Linus Torvalds
   6 *  Re-organised Feb 1998 Russell King
   7 *
   8 *  We now have independent partition support from the
   9 *  block drivers, which allows all the partition code to
  10 *  be grouped in one location, and it to be mostly self
  11 *  contained.
  12 *
  13 *  Added needed MAJORS for new pairs, {hdi,hdj}, {hdk,hdl}
  14 */
  15
  16#include <linux/slab.h>
  17#include <linux/ctype.h>
  18#include <linux/genhd.h>
  19
  20#include "check.h"
  21
  22#include "acorn.h"
  23#include "amiga.h"
  24#include "atari.h"
  25#include "ldm.h"
  26#include "mac.h"
  27#include "msdos.h"
  28#include "osf.h"
  29#include "sgi.h"
  30#include "sun.h"
  31#include "ibm.h"
  32#include "ultrix.h"
  33#include "efi.h"
  34#include "karma.h"
  35#include "sysv68.h"
  36
  37int warn_no_part = 1; /*This is ugly: should make genhd removable media aware*/
  38
  39static int (*check_part[])(struct parsed_partitions *) = {
  40        /*
  41         * Probe partition formats with tables at disk address 0
  42         * that also have an ADFS boot block at 0xdc0.
  43         */
  44#ifdef CONFIG_ACORN_PARTITION_ICS
  45        adfspart_check_ICS,
  46#endif
  47#ifdef CONFIG_ACORN_PARTITION_POWERTEC
  48        adfspart_check_POWERTEC,
  49#endif
  50#ifdef CONFIG_ACORN_PARTITION_EESOX
  51        adfspart_check_EESOX,
  52#endif
  53
  54        /*
  55         * Now move on to formats that only have partition info at
  56         * disk address 0xdc0.  Since these may also have stale
  57         * PC/BIOS partition tables, they need to come before
  58         * the msdos entry.
  59         */
  60#ifdef CONFIG_ACORN_PARTITION_CUMANA
  61        adfspart_check_CUMANA,
  62#endif
  63#ifdef CONFIG_ACORN_PARTITION_ADFS
  64        adfspart_check_ADFS,
  65#endif
  66
  67#ifdef CONFIG_EFI_PARTITION
  68        efi_partition,          /* this must come before msdos */
  69#endif
  70#ifdef CONFIG_SGI_PARTITION
  71        sgi_partition,
  72#endif
  73#ifdef CONFIG_LDM_PARTITION
  74        ldm_partition,          /* this must come before msdos */
  75#endif
  76#ifdef CONFIG_MSDOS_PARTITION
  77        msdos_partition,
  78#endif
  79#ifdef CONFIG_OSF_PARTITION
  80        osf_partition,
  81#endif
  82#ifdef CONFIG_SUN_PARTITION
  83        sun_partition,
  84#endif
  85#ifdef CONFIG_AMIGA_PARTITION
  86        amiga_partition,
  87#endif
  88#ifdef CONFIG_ATARI_PARTITION
  89        atari_partition,
  90#endif
  91#ifdef CONFIG_MAC_PARTITION
  92        mac_partition,
  93#endif
  94#ifdef CONFIG_ULTRIX_PARTITION
  95        ultrix_partition,
  96#endif
  97#ifdef CONFIG_IBM_PARTITION
  98        ibm_partition,
  99#endif
 100#ifdef CONFIG_KARMA_PARTITION
 101        karma_partition,
 102#endif
 103#ifdef CONFIG_SYSV68_PARTITION
 104        sysv68_partition,
 105#endif
 106        NULL
 107};
 108
 109struct parsed_partitions *
 110check_partition(struct gendisk *hd, struct block_device *bdev)
 111{
 112        struct parsed_partitions *state;
 113        int i, res, err;
 114
 115        state = kzalloc(sizeof(struct parsed_partitions), GFP_KERNEL);
 116        if (!state)
 117                return NULL;
 118        state->pp_buf = (char *)__get_free_page(GFP_KERNEL);
 119        if (!state->pp_buf) {
 120                kfree(state);
 121                return NULL;
 122        }
 123        state->pp_buf[0] = '\0';
 124
 125        state->bdev = bdev;
 126        disk_name(hd, 0, state->state" c);
  78#endif
&tlass="sref">pp_bsnp">&tl(state);
<;pp_buf[0]  href="+code=statPAGE_SIZEass="sref">pp_bPAGE_SIZE[0]  hr class="string">';
;
state->state" c);
1  28<128        if (!checlsdigil(state);
<;state" c);
<[ref="+code=state"rlelass="sref">sysv6"rlel(state);
<;state" c);
<)-1]) href="block/partitions/check.c#L117" id="L29" 1class="line" name="L29">1  29<129                returef="+code=statep">&tlass="sref">pp_bsp">&tl(state);
<;state" c);
< hr class="string">';
;
1  30<1a>#inchref="block/partitions/check.c#L12"liid="L121" class="line" name="L31">1  31<13>        state);
<;checlimil = pars_namemartitiol(hd, 0,a href="block/partitions/check.c#L12"liid="L122" class="line" name="L32">1  32<13>        i, res, err;
  123        res, check_part[])(sref="+code=mac_lass="sref">i, 1  34<134                returef="+code=statmemselass="sref">checmemsel(state);
<;parsitiol(state);
<;parsitiol(1  35<135                returef="+code=stat class="sref">res, check_part[])(sref="+code=mac_lass="sref">i, state);
1  36<136                retu!res,  class="line" name="L37">1  37<13>                retu    retur class="comment">/* thisWee stalhitADFSI/O /a>orch allowe don;
1  38<13>         * thhhhhhhhhhhhhhhh* Buturncor to d it tlet msdoomsdrs do msdir jobpan>
1  39<13>         */
1  40<14>                err;
res, 1  41<14>                retu    returef="+code=stat class="sref">res, 1  42<142                retu href="block/partitions/check.c#L123" id="L43" 1class="line" name="L43">1  43<14>
1  44<144             href="block/partitions/check.c#L123" id="L125" class="line" name="L45">1  45<1a>        res, 1  46<146                returef="+code=pp_bu">&tlass="sref">gendu">&tl(gendEL';
;
state->pp_buf) {
< href="block/partitions/check.c#L12"liie" na8"> class="line" name="L47">1  47<1a>#ifdhref="block/partitions/check.c#L12"liid="L38" 1class="line" name="L48">1  48<1a>        __ge_page(state->pp_buf) {
< href="block/partitions/check.c#L12"liid="L29" 1class="line" name="L49">1  49<149                return state;
1  50<150             href="block/partitions/check.c#L123" id="L51" 1class="line" name="L51">1  51<1a>        state->hd1  52<152                returef="+code=stat class="sref">err;
adfsENOSPl;
1  53<153        err;
1  54<1a>        /*orsh!
1artit15s="line" name="L36">1  36<136                retu!1  5">1artit15s="l2 id="L52" class="line" name="L52"> k.c#L1562heck.c#L53" id="L53" class="line" nhref="block/partitions/check.c#L113" id="L
"L54">1  5" id="L43" 1class="line" name="L53">1 5err;
pp_buf[0]  href="+code=statPAGE_SIZEass="sref">pp_bPAGE_SIZE[0]  hr class="string">';
->pp_buf) {
< h;
               return state);
<;pp_buf[0]  href="+code=statPAGE_SIZEass="sref">pp_bPAGE_SIZE[0]  hr class="string">';
->pp_buf) {
< h;
               return CONFIG_AC1ORN_P163>        adfspart_check_C1UMANA1/a>,
';
;
state->pp_buf) {
< href="block/partitions/check.c#L12"liie" na8"> class="line" name="L47">1  47<1a>#ifdhref="block/partitions/checlass="sreN="sref">e63" class="line" name="L163"> 163dhref="block/partitions/checlass="sreNef">errCONFIG_ACOR1N_PAR16ass="sref">pp_buf[0] = <>state->pp_buf) {
< href="block/partitions/check.c#L12"liid="L29" 1class="line" name="L49">1  49<149                return adfspart_check_ADF1S1
 121                return  16titions/checkL113" id="L50" 1class=ERR_PTRe" name="L53">1 RR_PTR121" id="L121" class 1class="line" name="L53">              return linux/slab.h>heck.#ifdef      CONFIG_EFI_PARTITI1ON

<

9e46b08119ef0">CONFIfooter">
="bloriginal LXR soft 38< bys="li    LXR pan>unity

lxr@l"L19.no
CONFIsubfooter">
lxr.l"L19.no kind"linosss="bys    Redpill"L6"pro A#endif provider of"L6">x12">id="f="9" 1coperclasss ser#L11s slass=1995.
9e46b0811/body081/html
<