]> git.baikalelectronics.ru Git - kernel.git/commit
block: introduce partition 0
authorTejun Heo <tj@kernel.org>
Wed, 3 Sep 2008 07:06:42 +0000 (09:06 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 9 Oct 2008 06:56:07 +0000 (08:56 +0200)
commitfcea35a172b54bcc69bd8060d217a81f84358f91
treed3347c1cfc59cf5d38c2c9adc2423f9d9b4cf818
parentc213be9b09d3e54b5b9d665f9da475ec4dcf205e
block: introduce partition 0

genhd and partition code handled disk and partitions separately.  All
information about the whole disk was in struct genhd and partitions in
struct hd_struct.  However, the whole disk (part0) and other
partitions have a lot in common and the data structures end up having
good number of common fields and thus separate code paths doing the
same thing.  Also, the partition array was indexed by partno - 1 which
gets pretty confusing at times.

This patch introduces partition 0 and makes the partition array
indexed by partno.  Following patches will unify the handling of disk
and parts piece-by-piece.

This patch also implements disk_partitionable() which tests whether a
disk is partitionable.  With coming dynamic partition array change,
the most common usage of disk_max_parts() will be testing whether a
disk is partitionable and the number of max partitions will become
much less important.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/genhd.c
block/ioctl.c
fs/block_dev.c
fs/partitions/check.c
include/linux/genhd.h