Ejemplo n.º 1
0
Archivo: pd.c Proyecto: TitaniumBoy/lin
static int pd_probe_drive( int unit )
{
	if (PD.drive == -1) {
		for (PD.drive=0;PD.drive<=1;PD.drive++)
			if (pd_identify(unit))
				return 1;
		return 0;
	}
	return pd_identify(unit);
}
Ejemplo n.º 2
0
Archivo: pd.c Proyecto: TitaniumBoy/lin
static int pd_revalidate(kdev_t dev)

{       int p, unit, minor;
        long flags;

        unit = DEVICE_NR(dev);
        if ((unit >= PD_UNITS) || (!PD.present)) return -ENODEV;

        save_flags(flags);
        cli(); 
        if (PD.access > 1) {
                restore_flags(flags);
                return -EBUSY;
        }
        pd_valid = 0;
        restore_flags(flags);   

        for (p=(PD_PARTNS-1);p>=0;p--) {
		minor = p + unit*PD_PARTNS;
                invalidate_device(MKDEV(MAJOR_NR, minor), 1);
                pd_hd[minor].start_sect = 0;
                pd_hd[minor].nr_sects = 0;
        }

	if (pd_identify(unit))
		grok_partitions(&pd_gendisk,unit,1<<PD_BITS,PD.capacity);

        pd_valid = 1;
        wake_up(&pd_wait_open);

        return 0;
}
Ejemplo n.º 3
0
static int pd_revalidate(kdev_t dev)
{
	int unit, res;
	long flags;

	unit = DEVICE_NR(dev);
	if ((unit >= PD_UNITS) || !PD.present)
		return -ENODEV;

	save_flags(flags);
	cli(); 
	if (PD.access > 1) {
		restore_flags(flags);
		return -EBUSY;
	}
	pd_valid = 0;
	restore_flags(flags);   

	res = wipe_partitions(dev);

	if (res == 0 && pd_identify(unit))
		grok_partitions(dev, PD.capacity);

	pd_valid = 1;
	wake_up(&pd_wait_open);
 
        return res;
}