Commit 32735425 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-input.bkbits.net/linux-input

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 26c69294 3197f480
......@@ -673,31 +673,22 @@ void blk_recount_segments(request_queue_t *q, struct bio *bio)
seg_size = nr_phys_segs = nr_hw_segs = 0;
bio_for_each_segment(bv, bio, i) {
if (bvprv && cluster) {
int phys, seg;
if (seg_size + bv->bv_len > q->max_segment_size) {
nr_phys_segs++;
if (seg_size + bv->bv_len > q->max_segment_size)
goto new_segment;
}
phys = BIOVEC_PHYS_MERGEABLE(bvprv, bv);
seg = BIOVEC_SEG_BOUNDARY(q, bvprv, bv);
if (!phys || !seg)
nr_phys_segs++;
if (!seg)
if (!BIOVEC_PHYS_MERGEABLE(bvprv, bv))
goto new_segment;
if (!BIOVEC_VIRT_MERGEABLE(bvprv, bv))
if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bv))
goto new_segment;
seg_size += bv->bv_len;
bvprv = bv;
continue;
} else {
nr_phys_segs++;
}
new_segment:
nr_hw_segs++;
if (!bvprv || !BIOVEC_VIRT_MERGEABLE(bvprv, bv))
nr_hw_segs++;
nr_phys_segs++;
bvprv = bv;
seg_size = bv->bv_len;
}
......
This diff is collapsed.
......@@ -5871,8 +5871,8 @@ int __init sbpcd_init(void)
disk->fops = &sbpcd_bdops;
strcpy(disk->disk_name, sbpcd_infop->name);
disk->flags = GENHD_FL_CD;
sprintf(nbuff, "c0t%d", p->drv_id);
disk->de = devfs_mk_dir(devfs_handle, nbuff, NULL);
sprintf(nbuff, "sbp/c0t%d", p->drv_id);
disk->de = devfs_mk_dir(NULL, nbuff, NULL);
p->disk = disk;
if (register_cdrom(sbpcd_infop))
{
......
......@@ -1047,7 +1047,6 @@ static int alloc_disks(ide_hwif_t *hwif)
static void init_gendisk (ide_hwif_t *hwif)
{
unsigned int unit;
extern devfs_handle_t ide_devfs_handle;
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t * drive = &hwif->drives[unit];
......@@ -1059,13 +1058,13 @@ static void init_gendisk (ide_hwif_t *hwif)
"%s","IDE Drive");
drive->gendev.parent = &hwif->gendev;
drive->gendev.bus = &ide_bus_type;
sprintf (name, "host%d/bus%d/target%d/lun%d",
sprintf (name, "ide/host%d/bus%d/target%d/lun%d",
(hwif->channel && hwif->mate) ?
hwif->mate->index : hwif->index,
hwif->channel, unit, drive->lun);
if (drive->present) {
device_register(&drive->gendev);
drive->de = devfs_mk_dir(ide_devfs_handle, name, NULL);
drive->de = devfs_mk_dir(NULL, name, NULL);
}
}
blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS,
......
......@@ -6122,6 +6122,7 @@ static int idetape_cleanup (ide_drive_t *drive)
drive->driver_data = NULL;
devfs_unregister(tape->de_r);
devfs_unregister(tape->de_n);
devfs_unregister_tape(drive->disk->number);
kfree (tape);
drive->disk->fops = ide_fops;
return 0;
......@@ -6269,7 +6270,7 @@ static int idetape_attach (ide_drive_t *drive)
HWIF(drive)->major, minor + 128,
S_IFCHR | S_IRUGO | S_IWUGO,
&idetape_fops, NULL);
devfs_register_tape(tape->de_r);
drive->disk->number = devfs_register_tape(drive->de);
drive->disk->fops = &idetape_block_ops;
return 0;
failed:
......
......@@ -169,15 +169,6 @@ static spinlock_t dv1394_cards_lock = SPIN_LOCK_UNLOCKED;
static struct hpsb_highlevel *hl_handle; /* = NULL; */
static LIST_HEAD(dv1394_devfs);
struct dv1394_devfs_entry {
struct list_head list;
devfs_handle_t devfs;
char name[32];
struct dv1394_devfs_entry *parent;
};
static spinlock_t dv1394_devfs_lock = SPIN_LOCK_UNLOCKED;
/* translate from a struct file* to the corresponding struct video_card* */
static inline struct video_card* file_to_video_card(struct file *file)
......@@ -2564,135 +2555,42 @@ static struct file_operations dv1394_fops=
/*** DEVFS HELPERS *********************************************************/
struct dv1394_devfs_entry *
dv1394_devfs_find( char *name)
{
struct list_head *lh;
struct dv1394_devfs_entry *p;
spin_lock( &dv1394_devfs_lock);
if(!list_empty(&dv1394_devfs)) {
list_for_each(lh, &dv1394_devfs) {
p = list_entry(lh, struct dv1394_devfs_entry, list);
if(!strncmp(p->name, name, sizeof(p->name))) {
goto found;
}
}
}
p = NULL;
found:
spin_unlock( &dv1394_devfs_lock);
return p;
}
#ifdef CONFIG_DEVFS_FS
static int dv1394_devfs_add_entry(struct video_card *video)
{
char buf[32];
struct dv1394_devfs_entry *p;
struct dv1394_devfs_entry *parent;
char buf[64];
snprintf(buf, sizeof(buf), "ieee1394/dv/host%d/%s/%s",
(video->id>>2),
(video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"),
(video->mode == MODE_RECEIVE ? "in" : "out"));
p = kmalloc(sizeof(struct dv1394_devfs_entry), GFP_KERNEL);
if(!p) {
printk(KERN_ERR "dv1394: cannot allocate dv1394_devfs_entry\n");
goto err;
}
memset(p, 0, sizeof(struct dv1394_devfs_entry));
snprintf(buf, sizeof(buf), "dv/host%d/%s", (video->id>>2),
(video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"));
parent = dv1394_devfs_find(buf);
if (parent == NULL) {
printk(KERN_ERR "dv1394: unable to locate parent devfs of %s\n", buf);
goto err_free;
}
video->devfs_handle = devfs_register(
parent->devfs,
(video->mode == MODE_RECEIVE ? "in" : "out"),
DEVFS_FL_NONE,
video->devfs_handle = devfs_register(NULL, buf, DEVFS_FL_NONE,
IEEE1394_MAJOR,
IEEE1394_MINOR_BLOCK_DV1394*16 + video->id,
S_IFCHR | S_IRUGO | S_IWUGO,
&dv1394_fops,
(void*) video);
p->devfs = video->devfs_handle;
if (p->devfs == NULL) {
printk(KERN_ERR "dv1394: unable to create /dev/ieee1394/%s/%s\n",
parent->name,
(video->mode == MODE_RECEIVE ? "in" : "out"));
goto err_free;
if (video->devfs_handle == NULL) {
printk(KERN_ERR "dv1394: unable to create /dev/%s\n", buf);
return -ENOMEM;
}
spin_lock( &dv1394_devfs_lock);
INIT_LIST_HEAD(&p->list);
list_add_tail(&p->list, &dv1394_devfs);
spin_unlock( &dv1394_devfs_lock);
return 0;
err_free:
kfree(p);
err:
return -ENOMEM;
}
static int
dv1394_devfs_add_dir( char *name,
struct dv1394_devfs_entry *parent,
struct dv1394_devfs_entry **out)
static int dv1394_devfs_add_dir(char *name)
{
struct dv1394_devfs_entry *p;
p = kmalloc(sizeof(struct dv1394_devfs_entry), GFP_KERNEL);
if(!p) {
printk(KERN_ERR "dv1394: cannot allocate dv1394_devfs_entry\n");
goto err;
}
memset(p, 0, sizeof(struct dv1394_devfs_entry));
if (parent == NULL) {
snprintf(p->name, sizeof(p->name), "%s", name);
p->devfs = devfs_mk_dir(ieee1394_devfs_handle, name, NULL);
} else {
snprintf(p->name, sizeof(p->name), "%s/%s", parent->name, name);
p->devfs = devfs_mk_dir(parent->devfs, name, NULL);
}
if (p->devfs == NULL) {
printk(KERN_ERR "dv1394: unable to create /dev/ieee1394/%s\n", p->name);
goto err_free;
if (!devfs_mk_dir(NULL, name, NULL))
printk(KERN_ERR "dv1394: unable to create /dev/%s\n", name);
return -ENOMEM;
}
p->parent = parent;
if (out != NULL) *out = p;
spin_lock( &dv1394_devfs_lock);
INIT_LIST_HEAD(&p->list);
list_add_tail(&p->list, &dv1394_devfs);
spin_unlock( &dv1394_devfs_lock);
return 0;
err_free:
kfree(p);
err:
return -ENOMEM;
}
void dv1394_devfs_del( char *name)
void dv1394_devfs_del(char *name)
{
struct dv1394_devfs_entry *p = dv1394_devfs_find(name);
if (p != NULL) {
devfs_unregister(p->devfs);
spin_lock( &dv1394_devfs_lock);
list_del(&p->list);
spin_unlock( &dv1394_devfs_lock);
kfree(p);
}
char s[64];
sprintf(s, "ieee1394/%s", name);
devfs_find_and_unregister(NULL, s, 0, 0, 0, 0);
}
#endif /* CONFIG_DEVFS_FS */
......@@ -2874,15 +2772,12 @@ static void dv1394_add_host (struct hpsb_host *host)
#endif
#ifdef CONFIG_DEVFS_FS
{
struct dv1394_devfs_entry *devfs_entry = dv1394_devfs_find("dv");
if (devfs_entry != NULL) {
snprintf(buf, sizeof(buf), "host%d", ohci->id);
dv1394_devfs_add_dir(buf, devfs_entry, &devfs_entry);
dv1394_devfs_add_dir("NTSC", devfs_entry, NULL);
dv1394_devfs_add_dir("PAL", devfs_entry, NULL);
}
}
snprintf(buf, sizeof(buf), "ieee1394/dv/host%d", ohci->id);
dv1394_devfs_add_dir(buf);
snprintf(buf, sizeof(buf), "ieee1394/dv/host%d/NTSC", ohci->id);
dv1394_devfs_add_dir(buf);
snprintf(buf, sizeof(buf), "ieee1394/dv/host%d/PAL", ohci->id);
dv1394_devfs_add_dir(buf);
#endif
dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE);
......@@ -3042,7 +2937,7 @@ static int __init dv1394_init_module(void)
}
#ifdef CONFIG_DEVFS_FS
if (dv1394_devfs_add_dir("dv", NULL, NULL) < 0) {
if (dv1394_devfs_add_dir("ieee1394/dv") < 0) {
printk(KERN_ERR "dv1394: unable to create /dev/ieee1394/dv\n");
ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394);
return -ENOMEM;
......
......@@ -1078,7 +1078,6 @@ static struct miscdevice _dm_misc = {
int __init dm_interface_init(void)
{
int r;
char rname[64];
r = dm_hash_init();
if (r)
......@@ -1091,25 +1090,12 @@ int __init dm_interface_init(void)
return r;
}
r = devfs_generate_path(_dm_misc.devfs_handle, rname + 3,
sizeof rname - 3);
if (r == -ENOSYS)
return 0; /* devfs not present */
if (r < 0) {
DMERR("devfs_generate_path failed for control device");
goto failed;
}
strncpy(rname + r, "../", 3);
r = devfs_mk_symlink(NULL, DM_DIR "/control",
DEVFS_FL_DEFAULT, rname + r, &_ctl_handle, NULL);
r = devfs_mk_symlink(NULL, DM_DIR "/control", DEVFS_FL_DEFAULT,
"../misc/" DM_NAME, &_ctl_handle, NULL);
if (r) {
DMERR("devfs_mk_symlink failed for control device");
goto failed;
}
devfs_auto_unregister(_dm_misc.devfs_handle, _ctl_handle);
DMINFO("%d.%d.%d%s initialised: %s", DM_VERSION_MAJOR,
DM_VERSION_MINOR, DM_VERSION_PATCHLEVEL, DM_VERSION_EXTRA,
DM_DRIVER_EMAIL);
......@@ -1125,6 +1111,8 @@ void dm_interface_exit(void)
{
dm_hash_exit();
devfs_find_and_unregister(NULL, DM_DIR "/control", 0, 0, 0, 0);
if (misc_deregister(&_dm_misc) < 0)
DMERR("misc_deregister failed for control device");
}
......@@ -350,7 +350,7 @@ int dvbdev_get_free_adapter_num (void)
int dvb_register_adapter(dvb_adapter_t **padap, char *name)
{
char dirname[10];
char dirname[16];
dvb_adapter_t *adap;
int num;
......@@ -374,8 +374,8 @@ int dvb_register_adapter(dvb_adapter_t **padap, char *name)
printk ("%s: registering new adapter (%s).\n", __FUNCTION__, name);
sprintf(dirname, "adapter%d", num);
adap->devfs_handle = devfs_mk_dir(dvb_devfs_handle, dirname, NULL);
sprintf(dirname, "dvb/adapter%d", num);
adap->devfs_handle = devfs_mk_dir(NULL, dirname, NULL);
adap->num = num;
list_add_tail (&adap->list_head, &dvb_adapter_list);
......
......@@ -283,7 +283,7 @@ dasd_free_device(dasd_device_t *device)
static inline int
dasd_state_new_to_known(dasd_device_t *device)
{
char buffer[5];
char buffer[10];
dasd_devmap_t *devmap;
umode_t devfs_perm;
devfs_handle_t dir;
......@@ -303,8 +303,8 @@ dasd_state_new_to_known(dasd_device_t *device)
return rc;
/* Add a proc directory and the dasd device entry to devfs. */
sprintf(buffer, "%04x", device->devinfo.devno);
dir = devfs_mk_dir(dasd_devfs_handle, buffer, device);
sprintf(buffer, "dasd/%04x", device->devinfo.devno);
dir = devfs_mk_dir(NULL, buffer, NULL);
device->gdp->de = dir;
if (devmap->features & DASD_FEATURE_READONLY)
devfs_perm = S_IFBLK | S_IRUSR;
......
......@@ -5486,7 +5486,7 @@ static int osst_attach(Scsi_Device * SDp)
0, 0, &osst_fops, NULL);
# endif
}
devfs_register_tape (tpnt->de_r[0]);
disk->number = devfs_register_tape(SDp->de);
#endif
tpnt->device = SDp;
......@@ -5647,6 +5647,7 @@ static void osst_detach(Scsi_Device * SDp)
devfs_unregister (tpnt->de_n[mode]);
tpnt->de_n[mode] = NULL;
}
devfs_unregister_tape(tpnt->disk->number);
#endif
put_disk(tpnt->disk);
kfree(tpnt);
......
......@@ -1323,7 +1323,6 @@ static int scsi_add_lun(Scsi_Device *sdevscan, Scsi_Device **sdevnew,
{
Scsi_Device *sdev;
char devname[64];
extern devfs_handle_t scsi_devfs_handle;
sdev = scsi_alloc_sdev(sdevscan->host, sdevscan->channel,
sdevscan->id, sdevscan->lun);
......@@ -1445,13 +1444,13 @@ static int scsi_add_lun(Scsi_Device *sdevscan, Scsi_Device **sdevnew,
*/
device_create_file(&sdev->sdev_driverfs_dev, &dev_attr_type);
sprintf(devname, "host%d/bus%d/target%d/lun%d",
sprintf(devname, "scsi/host%d/bus%d/target%d/lun%d",
sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
if (sdev->de)
printk(KERN_WARNING "scsi devfs dir: \"%s\" already exists\n",
devname);
else
sdev->de = devfs_mk_dir(scsi_devfs_handle, devname, NULL);
sdev->de = devfs_mk_dir(NULL, devname, NULL);
/*
* End driverfs/devfs code.
*/
......
......@@ -3874,7 +3874,7 @@ static int st_attach(Scsi_Device * SDp)
S_IFCHR | S_IRUGO | S_IWUGO,
&st_fops, NULL);
}
devfs_register_tape (tpnt->de_r[0]);
disk->number = devfs_register_tape(SDp->de);
printk(KERN_WARNING
"Attached scsi tape %s at scsi%d, channel %d, id %d, lun %d\n",
......@@ -3908,6 +3908,7 @@ static void st_detach(Scsi_Device * SDp)
devfs_unregister (tpnt->de_n[mode]);
tpnt->de_n[mode] = NULL;
}
devfs_unregister_tape(tpnt->disk->number);
scsi_tapes[i] = 0;
scsi_slave_detach(SDp);
st_nr_dev--;
......
......@@ -80,26 +80,33 @@
* @de: Any tape device entry in the device directory.
*/
void devfs_register_tape (devfs_handle_t de)
int devfs_register_tape (devfs_handle_t de)
{
int pos;
devfs_handle_t parent, slave;
char name[16], dest[64];
devfs_handle_t slave;
char name[32], dest[64];
static unsigned int tape_counter;
static devfs_handle_t tape_dir;
int n = tape_counter++;
if (tape_dir == NULL) tape_dir = devfs_mk_dir (NULL, "tapes", NULL);
parent = devfs_get_parent (de);
pos = devfs_generate_path (parent, dest + 3, sizeof dest - 3);
if (pos < 0) return;
pos = devfs_generate_path (de, dest + 3, sizeof dest - 3);
if (pos < 0) return -1;
strncpy (dest + pos, "../", 3);
sprintf (name, "tape%u", tape_counter++);
devfs_mk_symlink (tape_dir, name, DEVFS_FL_DEFAULT, dest + pos,
&slave, NULL);
devfs_auto_unregister (de, slave);
sprintf (name, "tapes/tape%u", n);
devfs_mk_symlink (NULL, name, DEVFS_FL_DEFAULT, dest + pos, &slave, NULL);
return n;
} /* End Function devfs_register_tape */
EXPORT_SYMBOL(devfs_register_tape);
void devfs_unregister_tape(int num)
{
if (num >= 0) {
char name[32];
sprintf(name, "tapes/tape%u", num);
devfs_find_and_unregister(NULL, name, 0, 0, 0, 0);
}
}
EXPORT_SYMBOL(devfs_unregister_tape);
/**
* devfs_register_series - Register a sequence of device entries.
......
This diff is collapsed.
......@@ -50,6 +50,7 @@ struct file * get_empty_filp(void)
file_list_unlock();
return NULL;
}
ep_init_file_struct(f);
atomic_set(&f->f_count,1);
f->f_version = 0;
f->f_uid = current->fsuid;
......@@ -94,6 +95,7 @@ struct file * get_empty_filp(void)
int init_private_file(struct file *filp, struct dentry *dentry, int mode)
{
memset(filp, 0, sizeof(*filp));
ep_init_file_struct(filp);
filp->f_mode = mode;
atomic_set(&filp->f_count, 1);
filp->f_dentry = dentry;
......@@ -121,6 +123,10 @@ void __fput(struct file * file)
struct vfsmount * mnt = file->f_vfsmnt;
struct inode * inode = dentry->d_inode;
/*
* The function ep_notify_file_close() should be the first called
* in the file cleanup chain.
*/
ep_notify_file_close(file);
locks_remove_flock(file);
......
......@@ -163,7 +163,7 @@ static void devfs_register_partition(struct gendisk *dev, int part)
if (p[part-1].de)
return;
dir = devfs_get_parent(dev->disk_de);
dir = dev->de;
if (!dir)
return;
if (dev->flags & GENHD_FL_REMOVABLE)
......@@ -178,7 +178,6 @@ static void devfs_register_partition(struct gendisk *dev, int part)
#ifdef CONFIG_DEVFS_FS
static struct unique_numspace disc_numspace = UNIQUE_NUMBERSPACE_INITIALISER;
static devfs_handle_t cdroms;
static struct unique_numspace cdrom_numspace = UNIQUE_NUMBERSPACE_INITIALISER;
#endif
......@@ -189,7 +188,6 @@ static void devfs_create_partitions(struct gendisk *dev)
devfs_handle_t dir, slave;
unsigned int devfs_flags = DEVFS_FL_DEFAULT;
char dirname[64], symlink[16];
static devfs_handle_t devfs_handle;
if (dev->flags & GENHD_FL_REMOVABLE)
devfs_flags |= DEVFS_FL_REMOVABLE;
......@@ -206,19 +204,15 @@ static void devfs_create_partitions(struct gendisk *dev)
sprintf(dirname, "../%s/disc%d", dev->disk_name,
dev->first_minor >> dev->minor_shift);
dir = devfs_mk_dir(NULL, dirname + 3, NULL);
dev->de = dir;
}
if (!devfs_handle)
devfs_handle = devfs_mk_dir(NULL, "discs", NULL);
dev->number = devfs_alloc_unique_number (&disc_numspace);
sprintf(symlink, "disc%d", dev->number);
devfs_mk_symlink (devfs_handle, symlink, DEVFS_FL_DEFAULT,
sprintf(symlink, "discs/disc%d", dev->number);
devfs_mk_symlink(NULL, symlink, DEVFS_FL_DEFAULT,
dirname + pos, &slave, NULL);
dev->disk_de = devfs_register(dir, "disc", devfs_flags,
dev->major, dev->first_minor,
S_IFBLK | S_IRUSR | S_IWUSR, dev->fops, NULL);
devfs_auto_unregister(dev->disk_de, slave);
if (!(dev->flags & GENHD_FL_DEVFS))
devfs_auto_unregister (slave, dir);
#endif
}
......@@ -227,11 +221,8 @@ static void devfs_create_cdrom(struct gendisk *dev)
#ifdef CONFIG_DEVFS_FS
char vname[23];
if (!cdroms)
cdroms = devfs_mk_dir (NULL, "cdroms", NULL);
dev->number = devfs_alloc_unique_number(&cdrom_numspace);
sprintf(vname, "cdrom%d", dev->number);
sprintf(vname, "cdroms/cdrom%d", dev->number);
if (dev->de) {
int pos;
devfs_handle_t slave;
......@@ -245,10 +236,8 @@ static void devfs_create_cdrom(struct gendisk *dev)
pos = devfs_generate_path(dev->disk_de, rname+3, sizeof(rname)-3);
if (pos >= 0) {
strncpy(rname + pos, "../", 3);
devfs_mk_symlink(cdroms, vname,
DEVFS_FL_DEFAULT,
devfs_mk_symlink(NULL, vname, DEVFS_FL_DEFAULT,
rname + pos, &slave, NULL);
devfs_auto_unregister(dev->de, slave);
}
} else {
dev->disk_de = devfs_register (NULL, vname, DEVFS_FL_DEFAULT,
......@@ -264,10 +253,22 @@ static void devfs_remove_partitions(struct gendisk *dev)
#ifdef CONFIG_DEVFS_FS
devfs_unregister(dev->disk_de);
dev->disk_de = NULL;
if (dev->flags & GENHD_FL_CD)
if (dev->flags & GENHD_FL_CD) {
char name[64];
sprintf(name, "cdroms/cdrom%d", dev->number);
if (dev->de)
devfs_find_and_unregister(NULL, name, 0, 0, 0, 0);
devfs_dealloc_unique_number(&cdrom_numspace, dev->number);
else
} else {
char name[64];
sprintf(name, "discs/disc%d", dev->number);
devfs_find_and_unregister(NULL, name, 0, 0, 0, 0);
if (!(dev->flags & GENHD_FL_DEVFS)) {
devfs_unregister(dev->de);
dev->de = NULL;
}
devfs_dealloc_unique_number(&disc_numspace, dev->number);
}
#endif
}
......
......@@ -54,7 +54,7 @@ struct poll_table_page {
* poll table.
*/
void poll_freewait(poll_table* pt)
void __pollfreewait(poll_table* pt)
{
struct poll_table_page * p = pt->table;
while (p) {
......
......@@ -88,7 +88,8 @@ extern void devfs_auto_unregister (devfs_handle_t master,devfs_handle_t slave);
extern devfs_handle_t devfs_get_unregister_slave (devfs_handle_t master);
extern const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen);
extern int devfs_only (void);
extern void devfs_register_tape (devfs_handle_t de);
extern int devfs_register_tape (devfs_handle_t de);
extern void devfs_unregister_tape(int num);
extern void devfs_register_series (devfs_handle_t dir, const char *format,
unsigned int num_entries,
unsigned int flags, unsigned int major,
......@@ -230,11 +231,13 @@ static inline int devfs_only (void)
{
return 0;
}
static inline void devfs_register_tape (devfs_handle_t de)
static inline int devfs_register_tape (devfs_handle_t de)
{
return -1;
}
static inline void devfs_unregister_tape(int num)
{
return;
}
static inline void devfs_register_series (devfs_handle_t dir,
const char *format,
unsigned int num_entries,
......
......@@ -34,6 +34,9 @@ asmlinkage int sys_epoll_ctl(int epfd, int op, int fd, unsigned int events);
asmlinkage int sys_epoll_wait(int epfd, struct pollfd *events, int maxevents,
int timeout);
/* Used to initialize the epoll bits inside the "struct file" */
void ep_init_file_struct(struct file *file);
/* Used in fs/file_table.c:__fput() to unlink files from the eventpoll interface */
void ep_notify_file_close(struct file *file);
......
......@@ -506,6 +506,10 @@ struct file {
/* needed for tty driver, and maybe others */
void *private_data;
/* Used by fs/eventpoll.c to link all the hooks to this file */
struct list_head f_ep_links;
spinlock_t f_ep_lock;
};
extern spinlock_t files_lock;
#define file_list_lock() spin_lock(&files_lock);
......
......@@ -14,14 +14,17 @@ struct poll_table_page;
struct poll_table_struct;
typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *);
typedef void (*poll_free_proc)(struct poll_table_struct *);
typedef struct poll_table_struct {
poll_queue_proc qproc;
poll_free_proc fproc;
int error;
struct poll_table_page * table;
} poll_table;
extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p);
extern void __pollfreewait(poll_table* pt);
static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
{
......@@ -29,9 +32,10 @@ static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_addres
p->qproc(filp, wait_address, p);
}
static inline void poll_initwait_ex(poll_table* pt, poll_queue_proc qproc)
static inline void poll_initwait_ex(poll_table* pt, poll_queue_proc qproc, poll_free_proc fproc)
{
pt->qproc = qproc;
pt->fproc = fproc;
pt->error = 0;
pt->table = NULL;
}
......@@ -39,10 +43,15 @@ static inline void poll_initwait_ex(poll_table* pt, poll_queue_proc qproc)
static inline void poll_initwait(poll_table* pt)
{
poll_initwait_ex(pt, __pollwait);
poll_initwait_ex(pt, __pollwait, __pollfreewait);
}
extern void poll_freewait(poll_table* pt);
static inline void poll_freewait(poll_table* pt)
{
if (pt && pt->fproc)
pt->fproc(pt);
}
/*
......
......@@ -269,7 +269,7 @@ EXPORT_SYMBOL(generic_file_llseek);
EXPORT_SYMBOL(remote_llseek);
EXPORT_SYMBOL(no_llseek);
EXPORT_SYMBOL(__pollwait);
EXPORT_SYMBOL(poll_freewait);
EXPORT_SYMBOL(__pollfreewait);
EXPORT_SYMBOL(ROOT_DEV);
EXPORT_SYMBOL(find_get_page);
EXPORT_SYMBOL(find_lock_page);
......
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