Lines Matching defs:unit
713 static struct mddev *mddev_find_locked(dev_t unit)
718 if (mddev->unit == unit)
724 static struct mddev *mddev_find(dev_t unit)
728 if (MAJOR(unit) != MD_MAJOR)
729 unit &= ~((1 << MdpMinorShift) - 1);
732 mddev = mddev_find_locked(unit);
740 static struct mddev *mddev_find_or_alloc(dev_t unit)
744 if (unit && MAJOR(unit) != MD_MAJOR)
745 unit &= ~((1<<MdpMinorShift)-1);
750 if (unit) {
751 mddev = mddev_find_locked(unit);
766 /* find an unused unit number */
785 new->unit = dev;
798 new->unit = unit;
799 if (MAJOR(unit) == MD_MAJOR)
800 new->md_minor = MINOR(unit);
802 new->md_minor = MINOR(unit) >> MdpMinorShift;
3880 * However we internally use a a much smaller unit such as
5711 int unit;
5717 partitioned = (MAJOR(mddev->unit) != MD_MAJOR);
5719 unit = MINOR(mddev->unit) >> shift;
5765 disk->major = MAJOR(mddev->unit);
5766 disk->first_minor = unit << shift;
5770 sprintf(disk->disk_name, "md_d%d", unit);
5772 sprintf(disk->disk_name, "md%d", unit);
6539 * If "unit" is allocated, then bump its reference count
6549 int unit;
6571 unit = MINOR(dev) >> MdpMinorShift;
6574 unit = MINOR(dev);
6576 if (rdev0->preferred_minor != unit) {
6577 pr_warn("md: unit number in %s is bad: %d\n",