Lines Matching refs:g

67 	struct gendisk *g;  in add_partition()  local
82 g = get_gendisk(dev); in add_partition()
83 if (!g) in add_partition()
87 drive = (MINOR(dev) >> g->minor_shift); in add_partition()
88 first_minor = (drive << g->minor_shift); in add_partition()
89 end_minor = first_minor + g->max_p; in add_partition()
90 if (drive >= g->nr_real) in add_partition()
94 if (first_minor != MINOR(dev) || p->pno <= 0 || p->pno >= g->max_p) in add_partition()
99 if (g->part[minor].nr_sects != 0) in add_partition()
104 if (!(pstart+plength <= g->part[i].start_sect || in add_partition()
105 pstart >= g->part[i].start_sect + g->part[i].nr_sects)) in add_partition()
109 g->part[minor].start_sect = pstart; in add_partition()
110 g->part[minor].nr_sects = plength; in add_partition()
111 if (g->sizes) in add_partition()
112 g->sizes[minor] = (plength >> (BLOCK_SIZE_BITS - 9)); in add_partition()
113 devfs_register_partitions (g, first_minor, 0); in add_partition()
128 struct gendisk *g; in del_partition() local
133 g = get_gendisk(dev); in del_partition()
134 if (!g) in del_partition()
138 drive = (MINOR(dev) >> g->minor_shift); in del_partition()
139 first_minor = (drive << g->minor_shift); in del_partition()
140 if (first_minor != MINOR(dev) || p->pno <= 0 || p->pno >= g->max_p) in del_partition()
145 if (drive >= g->nr_real || g->part[minor].nr_sects == 0) in del_partition()
157 g->part[minor].start_sect = 0; in del_partition()
158 g->part[minor].nr_sects = 0; in del_partition()
159 if (g->sizes) in del_partition()
160 g->sizes[minor] = 0; in del_partition()
161 devfs_register_partitions (g, first_minor, 0); in del_partition()
200 struct gendisk *g; in blk_ioctl() local
245 g = get_gendisk(dev); in blk_ioctl()
246 if (g) in blk_ioctl()
247 ullval = g->part[MINOR(dev)].nr_sects; in blk_ioctl()