mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 21:24:08 +08:00
689d6fac40
With previous changes, it's meaningless to limit the number of partitions. Replace @ext_minors with GENHD_FL_EXT_DEVT such that setting the flag allows the disk to have maximum number of allowed partitions (only limited by the number of entries in parsed_partitions as determined by MAX_PART constant). This kills not-too-pretty alloc_disk_ext[_node]() functions and makes @minors parameter to alloc_disk[_node]() unnecessary. The parameter is left alone to avoid disturbing the users. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
31 lines
551 B
C
31 lines
551 B
C
#include <linux/pagemap.h>
|
|
#include <linux/blkdev.h>
|
|
|
|
/*
|
|
* add_gd_partition adds a partitions details to the devices partition
|
|
* description.
|
|
*/
|
|
struct parsed_partitions {
|
|
char name[BDEVNAME_SIZE];
|
|
struct {
|
|
sector_t from;
|
|
sector_t size;
|
|
int flags;
|
|
} parts[DISK_MAX_PARTS];
|
|
int next;
|
|
int limit;
|
|
};
|
|
|
|
static inline void
|
|
put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size)
|
|
{
|
|
if (n < p->limit) {
|
|
p->parts[n].from = from;
|
|
p->parts[n].size = size;
|
|
printk(" %s%d", p->name, n);
|
|
}
|
|
}
|
|
|
|
extern int warn_no_part;
|
|
|