Commit d9c70898 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jeff Garzik

[PATCH] devfs: cleanup partition handling interaction

Always pass around the pathnames for the devfs entries / directories
instead of the devfs_handle_ts.  Cleanes up the code massivly.
parent 22e07d66
...@@ -400,7 +400,6 @@ static int __init cpqarray_init(void) ...@@ -400,7 +400,6 @@ static int __init cpqarray_init(void)
sprintf(disk->disk_name, "ida/c%dd%d", i, j); sprintf(disk->disk_name, "ida/c%dd%d", i, j);
disk->major = COMPAQ_SMART2_MAJOR + i; disk->major = COMPAQ_SMART2_MAJOR + i;
disk->first_minor = j<<NWD_SHIFT; disk->first_minor = j<<NWD_SHIFT;
disk->flags = GENHD_FL_DEVFS;
disk->fops = &ida_fops; disk->fops = &ida_fops;
if (!drv->nr_blks) if (!drv->nr_blks)
continue; continue;
...@@ -1678,10 +1677,9 @@ static void getgeometry(int ctlr) ...@@ -1678,10 +1677,9 @@ static void getgeometry(int ctlr)
return; return;
} }
if (!disk->de) {
disk->de = devfs_mk_dir("ida/c%dd%d", sprintf(disk->devfs_name, "ida/c%dd%d", ctlr, log_unit);
ctlr, log_unit);
}
info_p->phys_drives = info_p->phys_drives =
sense_config_buf->ctlr_phys_drv; sense_config_buf->ctlr_phys_drv;
info_p->drv_assign_map info_p->drv_assign_map
......
...@@ -5645,7 +5645,6 @@ int __init __sbpcd_init(void) ...@@ -5645,7 +5645,6 @@ int __init __sbpcd_init(void)
int __init sbpcd_init(void) int __init sbpcd_init(void)
#endif #endif
{ {
char nbuff[16];
int i=0, j=0; int i=0, j=0;
int addr[2]={1, CDROM_PORT}; int addr[2]={1, CDROM_PORT};
int port_index; int port_index;
...@@ -5869,8 +5868,7 @@ int __init sbpcd_init(void) ...@@ -5869,8 +5868,7 @@ int __init sbpcd_init(void)
disk->fops = &sbpcd_bdops; disk->fops = &sbpcd_bdops;
strcpy(disk->disk_name, sbpcd_infop->name); strcpy(disk->disk_name, sbpcd_infop->name);
disk->flags = GENHD_FL_CD; disk->flags = GENHD_FL_CD;
sprintf(nbuff, "sbp/c0t%d", p->drv_id); sprintf(disk->devfs_name, "sbp/c0t%d", p->drv_id);
disk->de = devfs_mk_dir(NULL, nbuff, NULL);
p->disk = disk; p->disk = disk;
if (register_cdrom(sbpcd_infop)) if (register_cdrom(sbpcd_infop))
{ {
......
...@@ -3366,7 +3366,7 @@ static int ide_cdrom_attach (ide_drive_t *drive) ...@@ -3366,7 +3366,7 @@ static int ide_cdrom_attach (ide_drive_t *drive)
DRIVER(drive)->busy++; DRIVER(drive)->busy++;
g->minors = 1; g->minors = 1;
g->minor_shift = 0; g->minor_shift = 0;
g->de = drive->de; strcpy(g->devfs_name, drive->devfs_name);
g->driverfs_dev = &drive->gendev; g->driverfs_dev = &drive->gendev;
g->flags = GENHD_FL_CD; g->flags = GENHD_FL_CD;
if (ide_cdrom_setup(drive)) { if (ide_cdrom_setup(drive)) {
......
...@@ -1816,10 +1816,9 @@ static int idedisk_attach(ide_drive_t *drive) ...@@ -1816,10 +1816,9 @@ static int idedisk_attach(ide_drive_t *drive)
DRIVER(drive)->busy--; DRIVER(drive)->busy--;
g->minors = 1 << PARTN_BITS; g->minors = 1 << PARTN_BITS;
g->minor_shift = PARTN_BITS; g->minor_shift = PARTN_BITS;
g->de = drive->de; strcpy(g->devfs_name, drive->devfs_name);
g->driverfs_dev = &drive->gendev; g->driverfs_dev = &drive->gendev;
g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0;
g->flags |= GENHD_FL_DEVFS;
set_capacity(g, current_capacity(drive)); set_capacity(g, current_capacity(drive));
g->fops = &idedisk_ops; g->fops = &idedisk_ops;
add_disk(g); add_disk(g);
......
...@@ -2059,9 +2059,8 @@ static int idefloppy_attach (ide_drive_t *drive) ...@@ -2059,9 +2059,8 @@ static int idefloppy_attach (ide_drive_t *drive)
g->minors = 1 << PARTN_BITS; g->minors = 1 << PARTN_BITS;
g->minor_shift = PARTN_BITS; g->minor_shift = PARTN_BITS;
g->driverfs_dev = &drive->gendev; g->driverfs_dev = &drive->gendev;
g->de = drive->de; strcpy(g->devfs_name, drive->devfs_name);
g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0;
g->flags |= GENHD_FL_DEVFS;
g->fops = &idefloppy_ops; g->fops = &idefloppy_ops;
add_disk(g); add_disk(g);
return 0; return 0;
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
......
...@@ -1303,7 +1303,6 @@ static void init_gendisk (ide_hwif_t *hwif) ...@@ -1303,7 +1303,6 @@ static void init_gendisk (ide_hwif_t *hwif)
(hwif->channel && hwif->mate) ? (hwif->channel && hwif->mate) ?
hwif->mate->index : hwif->index, hwif->mate->index : hwif->index,
hwif->channel, unit, drive->lun); hwif->channel, unit, drive->lun);
drive->de = devfs_mk_dir(drive->devfs_name);
} }
} }
blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS, blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS,
......
...@@ -157,9 +157,10 @@ dasd_state_new_to_known(struct dasd_device *device) ...@@ -157,9 +157,10 @@ dasd_state_new_to_known(struct dasd_device *device)
#ifdef CONFIG_DEVFS_FS #ifdef CONFIG_DEVFS_FS
/* Add a proc directory and the dasd device entry to devfs. */ /* Add a proc directory and the dasd device entry to devfs. */
device->gdp->de = devfs_mk_dir("dasd/%04x", sprintf(device->gdp->devfs_name, "dasd/%04x",
_ccw_device_get_device_number(device->cdev)); _ccw_device_get_device_number(device->cdev));
#endif #endif
if (device->ro_flag) if (device->ro_flag)
devfs_perm = S_IFBLK | S_IRUSR; devfs_perm = S_IFBLK | S_IRUSR;
else else
......
...@@ -137,7 +137,6 @@ dasd_gendisk_alloc(int devindex) ...@@ -137,7 +137,6 @@ dasd_gendisk_alloc(int devindex)
gdp->major = mi->major; gdp->major = mi->major;
gdp->first_minor = index << DASD_PARTN_BITS; gdp->first_minor = index << DASD_PARTN_BITS;
gdp->fops = &dasd_device_operations; gdp->fops = &dasd_device_operations;
gdp->flags |= GENHD_FL_DEVFS;
/* /*
* Set device name. * Set device name.
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#define _SCSI_H #define _SCSI_H
#include <linux/config.h> /* for CONFIG_SCSI_LOGGING */ #include <linux/config.h> /* for CONFIG_SCSI_LOGGING */
#include <linux/devfs_fs_kernel.h> /* some morons don't know struct pointers */
#include <scsi/scsi.h> #include <scsi/scsi.h>
...@@ -589,7 +588,6 @@ struct scsi_device { ...@@ -589,7 +588,6 @@ struct scsi_device {
void *hostdata; /* available to low-level driver */ void *hostdata; /* available to low-level driver */
char devfs_name[256]; /* devfs junk */ char devfs_name[256]; /* devfs junk */
devfs_handle_t de; /* will go away soon */
char type; char type;
char scsi_level; char scsi_level;
unsigned char inquiry_len; /* valid bytes in 'inquiry' */ unsigned char inquiry_len; /* valid bytes in 'inquiry' */
......
...@@ -1247,7 +1247,6 @@ static int scsi_add_lun(Scsi_Device *sdev, Scsi_Request *sreq, ...@@ -1247,7 +1247,6 @@ static int scsi_add_lun(Scsi_Device *sdev, Scsi_Request *sreq,
sprintf(sdev->devfs_name, "scsi/host%d/bus%d/target%d/lun%d", sprintf(sdev->devfs_name, "scsi/host%d/bus%d/target%d/lun%d",
sdev->host->host_no, sdev->channel, sdev->host->host_no, sdev->channel,
sdev->id, sdev->lun); sdev->id, sdev->lun);
sdev->de = devfs_mk_dir(sdev->devfs_name);
/* /*
* End driverfs/devfs code. * End driverfs/devfs code.
......
...@@ -1327,7 +1327,6 @@ static int sd_attach(struct scsi_device * sdp) ...@@ -1327,7 +1327,6 @@ static int sd_attach(struct scsi_device * sdp)
sdkp->disk = gd; sdkp->disk = gd;
sdkp->index = index; sdkp->index = index;
gd->de = sdp->de;
gd->major = sd_major(index >> 4); gd->major = sd_major(index >> 4);
gd->first_minor = (index & 15) << 4; gd->first_minor = (index & 15) << 4;
gd->minors = 16; gd->minors = 16;
...@@ -1340,10 +1339,12 @@ static int sd_attach(struct scsi_device * sdp) ...@@ -1340,10 +1339,12 @@ static int sd_attach(struct scsi_device * sdp)
sprintf(gd->disk_name, "sd%c", 'a' + index % 26); sprintf(gd->disk_name, "sd%c", 'a' + index % 26);
} }
strcpy(gd->devfs_name, sdp->devfs_name);
sd_init_onedisk(sdkp, gd); sd_init_onedisk(sdkp, gd);
gd->driverfs_dev = &sdp->sdev_driverfs_dev; gd->driverfs_dev = &sdp->sdev_driverfs_dev;
gd->flags = GENHD_FL_DRIVERFS | GENHD_FL_DEVFS; gd->flags = GENHD_FL_DRIVERFS;
if (sdp->removable) if (sdp->removable)
gd->flags |= GENHD_FL_REMOVABLE; gd->flags |= GENHD_FL_REMOVABLE;
gd->private_data = &sdkp->driver; gd->private_data = &sdkp->driver;
......
...@@ -569,7 +569,7 @@ static int sr_attach(struct scsi_device *sdev) ...@@ -569,7 +569,7 @@ static int sr_attach(struct scsi_device *sdev)
get_capabilities(cd); get_capabilities(cd);
sr_vendor_init(cd); sr_vendor_init(cd);
disk->de = sdev->de; strcpy(disk->devfs_name, sdev->devfs_name);
disk->driverfs_dev = &sdev->sdev_driverfs_dev; disk->driverfs_dev = &sdev->sdev_driverfs_dev;
register_cdrom(&cd->cdi); register_cdrom(&cd->cdi);
set_capacity(disk, cd->capacity); set_capacity(disk, cd->capacity);
......
...@@ -346,78 +346,71 @@ EXPORT_SYMBOL(devfs_dealloc_unique_number); ...@@ -346,78 +346,71 @@ EXPORT_SYMBOL(devfs_dealloc_unique_number);
static struct unique_numspace disc_numspace = UNIQUE_NUMBERSPACE_INITIALISER; static struct unique_numspace disc_numspace = UNIQUE_NUMBERSPACE_INITIALISER;
static struct unique_numspace cdrom_numspace = UNIQUE_NUMBERSPACE_INITIALISER; static struct unique_numspace cdrom_numspace = UNIQUE_NUMBERSPACE_INITIALISER;
void devfs_create_partitions(struct gendisk *dev) void devfs_create_partitions(struct gendisk *disk)
{ {
int pos = 0; char dirname[64], diskname[64], symlink[16];
devfs_handle_t dir;
char dirname[64], symlink[16]; if (!disk->devfs_name)
sprintf(disk->devfs_name, "%s/disc%d", disk->disk_name,
disk->first_minor >> disk->minor_shift);
devfs_mk_dir(disk->devfs_name);
disk->number = devfs_alloc_unique_number(&disc_numspace);
sprintf(diskname, "%s/disc", disk->devfs_name);
devfs_register(NULL, diskname, 0,
disk->major, disk->first_minor,
S_IFBLK | S_IRUSR | S_IWUSR,
disk->fops, NULL);
sprintf(symlink, "discs/disc%d", disk->number);
sprintf(dirname, "../%s", disk->devfs_name);
devfs_mk_symlink(symlink, dirname);
if (dev->flags & GENHD_FL_DEVFS) {
dir = dev->de;
if (!dir) /* Aware driver wants to block disc management */
return;
pos = devfs_generate_path(dir, dirname + 3, sizeof dirname-3);
if (pos < 0)
return;
strncpy(dirname + pos, "../", 3);
} else {
/* Unaware driver: construct "real" directory */
sprintf(dirname, "../%s/disc%d", dev->disk_name,
dev->first_minor >> dev->minor_shift);
dir = devfs_mk_dir(dirname + 3);
dev->de = dir;
}
dev->number = devfs_alloc_unique_number (&disc_numspace);
sprintf(symlink, "discs/disc%d", dev->number);
devfs_mk_symlink(symlink, dirname + pos);
dev->disk_de = devfs_register(dir, "disc", 0,
dev->major, dev->first_minor,
S_IFBLK | S_IRUSR | S_IWUSR, dev->fops, NULL);
} }
void devfs_create_cdrom(struct gendisk *dev) void devfs_create_cdrom(struct gendisk *disk)
{ {
char vname[23]; char dirname[64], cdname[64], symlink[16];
dev->number = devfs_alloc_unique_number(&cdrom_numspace); if (!disk->devfs_name)
sprintf(vname, "cdroms/cdrom%d", dev->number); strcat(disk->devfs_name, disk->disk_name);
if (dev->de) {
int pos;
char rname[64];
dev->disk_de = devfs_register(dev->de, "cd", DEVFS_FL_DEFAULT, devfs_mk_dir(disk->devfs_name);
dev->major, dev->first_minor, disk->number = devfs_alloc_unique_number(&cdrom_numspace);
S_IFBLK | S_IRUGO | S_IWUGO,
dev->fops, NULL);
pos = devfs_generate_path(dev->disk_de, rname+3, sizeof(rname)-3); sprintf(cdname, "%s/cd", disk->devfs_name);
if (pos >= 0) { devfs_register(NULL, cdname, 0,
strncpy(rname + pos, "../", 3); disk->major, disk->first_minor,
devfs_mk_symlink(vname, rname + pos);
}
} else {
dev->disk_de = devfs_register (NULL, vname, DEVFS_FL_DEFAULT,
dev->major, dev->first_minor,
S_IFBLK | S_IRUGO | S_IWUGO, S_IFBLK | S_IRUGO | S_IWUGO,
disk->fops, NULL);
sprintf(symlink, "cdroms/cdrom%d", disk->number);
sprintf(dirname, "../%s", disk->devfs_name);
devfs_mk_symlink(symlink, dirname);
}
void devfs_register_partition(struct gendisk *dev, int part)
{
char devname[64];
sprintf(devname, "%s/part%d", dev->devfs_name, part);
devfs_register(NULL, devname, 0,
dev->major, dev->first_minor + part,
S_IFBLK | S_IRUSR | S_IWUSR,
dev->fops, NULL); dev->fops, NULL);
}
} }
void devfs_remove_partitions(struct gendisk *dev) void devfs_remove_partitions(struct gendisk *disk)
{ {
devfs_unregister(dev->disk_de); devfs_remove("discs/disc%d", disk->number);
dev->disk_de = NULL; devfs_remove(disk->devfs_name);
devfs_dealloc_unique_number(&disc_numspace, disk->number);
}
if (dev->flags & GENHD_FL_CD) { void devfs_remove_cdrom(struct gendisk *disk)
if (dev->de) {
devfs_remove("cdroms/cdrom%d", dev->number); devfs_remove("cdroms/cdrom%d", disk->number);
devfs_dealloc_unique_number(&cdrom_numspace, dev->number); devfs_remove(disk->devfs_name);
} else { devfs_dealloc_unique_number(&cdrom_numspace, disk->number);
devfs_remove("discs/disc%d", dev->number);
if (!(dev->flags & GENHD_FL_DEVFS)) {
devfs_unregister(dev->de);
dev->de = NULL;
}
devfs_dealloc_unique_number(&disc_numspace, dev->number);
}
} }
...@@ -94,25 +94,26 @@ static int (*check_part[])(struct parsed_partitions *, struct block_device *) = ...@@ -94,25 +94,26 @@ static int (*check_part[])(struct parsed_partitions *, struct block_device *) =
char *disk_name(struct gendisk *hd, int part, char *buf) char *disk_name(struct gendisk *hd, int part, char *buf)
{ {
int pos;
if (!part) { if (!part) {
if (hd->disk_de) { #ifdef CONFIG_DEVFS_FS
pos = devfs_generate_path(hd->disk_de, buf, 64); if (hd->devfs_name)
if (pos >= 0) sprintf(buf, "%s/%s", hd->devfs_name,
return buf + pos; (hd->flags & GENHD_FL_CD) ? "cd" : "disc");
} else
#endif
sprintf(buf, "%s", hd->disk_name); sprintf(buf, "%s", hd->disk_name);
} else { } else {
if (hd->part[part-1].de) { #ifdef CONFIG_DEVFS_FS
pos = devfs_generate_path(hd->part[part-1].de, buf, 64); if (hd->devfs_name)
if (pos >= 0) sprintf(buf, "%s/part%d", hd->devfs_name, part);
return buf + pos; else
} #endif
if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) if (isdigit(hd->disk_name[strlen(hd->disk_name)-1]))
sprintf(buf, "%sp%d", hd->disk_name, part); sprintf(buf, "%sp%d", hd->disk_name, part);
else else
sprintf(buf, "%s%d", hd->disk_name, part); sprintf(buf, "%s%d", hd->disk_name, part);
} }
return buf; return buf;
} }
...@@ -120,21 +121,19 @@ static struct parsed_partitions * ...@@ -120,21 +121,19 @@ static struct parsed_partitions *
check_partition(struct gendisk *hd, struct block_device *bdev) check_partition(struct gendisk *hd, struct block_device *bdev)
{ {
struct parsed_partitions *state; struct parsed_partitions *state;
devfs_handle_t de = NULL;
char buf[64];
int i, res; int i, res;
state = kmalloc(sizeof(struct parsed_partitions), GFP_KERNEL); state = kmalloc(sizeof(struct parsed_partitions), GFP_KERNEL);
if (!state) if (!state)
return NULL; return NULL;
if (hd->flags & GENHD_FL_DEVFS) #ifdef CONFIG_DEVFS_FS
de = hd->de; if (hd->devfs_name) {
i = devfs_generate_path (de, buf, sizeof buf); printk(KERN_INFO " /dev/%s:", hd->devfs_name);
if (i >= 0) {
printk(KERN_INFO " /dev/%s:", buf + i);
sprintf(state->name, "p"); sprintf(state->name, "p");
} else { }
#endif
else {
disk_name(hd, 0, state->name); disk_name(hd, 0, state->name);
printk(KERN_INFO " %s:", state->name); printk(KERN_INFO " %s:", state->name);
if (isdigit(state->name[strlen(state->name)-1])) if (isdigit(state->name[strlen(state->name)-1]))
...@@ -156,26 +155,6 @@ check_partition(struct gendisk *hd, struct block_device *bdev) ...@@ -156,26 +155,6 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
return NULL; return NULL;
} }
static void devfs_register_partition(struct gendisk *dev, int part)
{
#ifdef CONFIG_DEVFS_FS
devfs_handle_t dir;
struct hd_struct *p = dev->part;
char devname[16];
if (p[part-1].de)
return;
dir = dev->de;
if (!dir)
return;
sprintf(devname, "part%d", part);
p[part-1].de = devfs_register (dir, devname, 0,
dev->major, dev->first_minor + part,
S_IFBLK | S_IRUSR | S_IWUSR,
dev->fops, NULL);
#endif
}
/* /*
* sysfs bindings for partitions * sysfs bindings for partitions
*/ */
...@@ -261,8 +240,7 @@ void delete_partition(struct gendisk *disk, int part) ...@@ -261,8 +240,7 @@ void delete_partition(struct gendisk *disk, int part)
p->start_sect = 0; p->start_sect = 0;
p->nr_sects = 0; p->nr_sects = 0;
p->reads = p->writes = p->read_sectors = p->write_sectors = 0; p->reads = p->writes = p->read_sectors = p->write_sectors = 0;
devfs_unregister(p->de); devfs_remove("%s/part%d", disk->devfs_name, part);
p->de = NULL;
kobject_unregister(&p->kobj); kobject_unregister(&p->kobj);
} }
...@@ -414,6 +392,9 @@ void del_gendisk(struct gendisk *disk) ...@@ -414,6 +392,9 @@ void del_gendisk(struct gendisk *disk)
unlink_gendisk(disk); unlink_gendisk(disk);
disk_stat_set_all(disk, 0); disk_stat_set_all(disk, 0);
disk->stamp = disk->stamp_idle = 0; disk->stamp = disk->stamp_idle = 0;
if (disk->flags & GENHD_FL_CD)
devfs_remove_cdrom(disk);
else
devfs_remove_partitions(disk); devfs_remove_partitions(disk);
if (disk->driverfs_dev) { if (disk->driverfs_dev) {
sysfs_remove_link(&disk->kobj, "device"); sysfs_remove_link(&disk->kobj, "device");
......
...@@ -37,7 +37,9 @@ extern void devfs_unregister_tape(int num); ...@@ -37,7 +37,9 @@ extern void devfs_unregister_tape(int num);
extern void devfs_create_partitions(struct gendisk *dev); extern void devfs_create_partitions(struct gendisk *dev);
extern void devfs_create_cdrom(struct gendisk *dev); extern void devfs_create_cdrom(struct gendisk *dev);
extern void devfs_remove_partitions(struct gendisk *dev); extern void devfs_remove_partitions(struct gendisk *dev);
extern void mount_devfs_fs (void); extern void devfs_remove_cdrom(struct gendisk *dev);
extern void devfs_register_partition(struct gendisk *dev, int part);
extern void mount_devfs_fs(void);
#else /* CONFIG_DEVFS_FS */ #else /* CONFIG_DEVFS_FS */
static inline devfs_handle_t devfs_register (devfs_handle_t dir, static inline devfs_handle_t devfs_register (devfs_handle_t dir,
const char *name, const char *name,
...@@ -85,6 +87,12 @@ static inline void devfs_create_cdrom(struct gendisk *dev) ...@@ -85,6 +87,12 @@ static inline void devfs_create_cdrom(struct gendisk *dev)
static inline void devfs_remove_partitions(struct gendisk *dev) static inline void devfs_remove_partitions(struct gendisk *dev)
{ {
} }
static inline void devfs_remove_cdrom(struct gendisk *dev)
{
}
static inline void devfs_register_partition(struct gendisk *dev, int part)
{
}
static inline void mount_devfs_fs (void) static inline void mount_devfs_fs (void)
{ {
return; return;
......
...@@ -55,12 +55,13 @@ struct partition { ...@@ -55,12 +55,13 @@ struct partition {
} __attribute__((packed)); } __attribute__((packed));
#ifdef __KERNEL__ #ifdef __KERNEL__
# include <linux/devfs_fs_kernel.h> #include <linux/devfs_fs_kernel.h> /* we don't need any devfs crap
here, but some of the implicitly
included headers. will clean
this mess up later. --hch */
struct hd_struct { struct hd_struct {
sector_t start_sect; sector_t start_sect;
sector_t nr_sects; sector_t nr_sects;
devfs_handle_t de; /* primary (master) devfs entry */
struct kobject kobj; struct kobject kobj;
unsigned reads, read_sectors, writes, write_sectors; unsigned reads, read_sectors, writes, write_sectors;
int policy; int policy;
...@@ -68,7 +69,6 @@ struct hd_struct { ...@@ -68,7 +69,6 @@ struct hd_struct {
#define GENHD_FL_REMOVABLE 1 #define GENHD_FL_REMOVABLE 1
#define GENHD_FL_DRIVERFS 2 #define GENHD_FL_DRIVERFS 2
#define GENHD_FL_DEVFS 4
#define GENHD_FL_CD 8 #define GENHD_FL_CD 8
#define GENHD_FL_UP 16 #define GENHD_FL_UP 16
...@@ -96,9 +96,8 @@ struct gendisk { ...@@ -96,9 +96,8 @@ struct gendisk {
sector_t capacity; sector_t capacity;
int flags; int flags;
int number; /* devfs crap */ char devfs_name[64]; /* devfs crap */
devfs_handle_t de; /* more of the same */ int number; /* more of the same */
devfs_handle_t disk_de; /* piled higher and deeper */
struct device *driverfs_dev; struct device *driverfs_dev;
struct kobject kobj; struct kobject kobj;
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/hdsmart.h> #include <linux/hdsmart.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/bio.h> #include <linux/bio.h>
...@@ -700,7 +699,6 @@ typedef struct ide_drive_s { ...@@ -700,7 +699,6 @@ typedef struct ide_drive_s {
struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ struct proc_dir_entry *proc; /* /proc/ide/ directory entry */
struct ide_settings_s *settings;/* /proc/ide/ drive settings */ struct ide_settings_s *settings;/* /proc/ide/ drive settings */
char devfs_name[64]; /* devfs crap */ char devfs_name[64]; /* devfs crap */
devfs_handle_t de; /* will go away soon */
struct hwif_s *hwif; /* actually (ide_hwif_t *) */ struct hwif_s *hwif; /* actually (ide_hwif_t *) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment