函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:block\partitions\ibm.c Create Date:2022-07-27 19:06:06
首页 Copyright©Brick

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * compute the block number from a
 * cyl-cyl-head-head structure
 */
static sector_t cchh2blk(struct vtoc_cchh *ptr, struct hd_geometry *geo)
{
    sector_t cyl;
    __u16 head;
 
    /* decode cylinder and heads for large volumes */
    cyl = ptr->hh & 0xFFF0;
    cyl <<= 12;
    cyl |= ptr->cc;
    head = ptr->hh & 0x000F;
    return cyl * geo->heads * geo->sectors +
           head * geo->sectors;
}