Re: PATCH: combo 30,000fd, 2Gig swap, dynamic superblock, async I/O patch

Alan Cox (alan@lxorguk.ukuu.org.uk)
Mon, 27 Jul 1998 18:54:40 +0100 (BST)


> I get an error in drivers/char/tty_io.c about fasync_helper() being of
> wrong type, and it is. It seems like all the calls to the function
> have changed prototype but the function itself is the same?

Oops well caught. I think the following will fix it.

> Also grep'ing around, it seems that dn_keyb.c (whatever that is) was
> not updated.

I'll check that one out in a bit.

Alan

diff -u --new-file --recursive --exclude-from ../exclude linux.vanilla/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- linux.vanilla/drivers/char/tty_io.c Tue Jul 21 14:19:23 1998
+++ linux/drivers/char/tty_io.c Sun Jul 26 00:42:38 1998
@@ -122,7 +122,7 @@
static int tty_release(struct inode *, struct file *);
static int tty_ioctl(struct inode * inode, struct file * file,
unsigned int cmd, unsigned long arg);
-static int tty_fasync(struct file * filp, int on);
+static int tty_fasync(int fd, struct file * filp, int on);
#ifdef CONFIG_8xx
extern long console_8xx_init(void);
extern int rs_8xx_init(void);
@@ -396,7 +396,7 @@
continue;
if (filp->f_op != &tty_fops)
continue;
- tty_fasync(filp, 0);
+ tty_fasync(-1, filp, 0);
filp->f_op = &hung_up_tty_fops;
}

@@ -962,7 +962,7 @@

check_tty_count(tty, "release_dev");

- tty_fasync(filp, 0);
+ tty_fasync(-1, filp, 0);

idx = MINOR(tty->device) - tty->driver.minor_start;
pty_master = (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
@@ -1332,7 +1332,7 @@
* to set up the fasync queue. It returns negative on error, 0 if it did
* no changes and positive if it added/deleted the entry.
*/
-int fasync_helper(struct file * filp, int on, struct fasync_struct **fapp)
+int fasync_helper(int fd, struct file * filp, int on, struct fasync_struct **fapp)
{
struct fasync_struct *fa, **fp;
unsigned long flags;
@@ -1343,13 +1343,16 @@
}

if (on) {
- if (fa)
+ if (fa) {
+ fa->fa_fd = fd;
return 0;
+ }
fa = (struct fasync_struct *)kmalloc(sizeof(struct fasync_struct), GFP_KERNEL);
if (!fa)
return -ENOMEM;
fa->magic = FASYNC_MAGIC;
fa->fa_file = filp;
+ fa->fa_fd = fd;
save_flags(flags);
cli();
fa->fa_next = *fapp;
@@ -1367,7 +1370,7 @@
return 1;
}

-static int tty_fasync(struct file * filp, int on)
+static int tty_fasync(int fd, struct file * filp, int on)
{
struct tty_struct * tty;
int retval;
@@ -1376,7 +1379,7 @@
if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "tty_fasync"))
return 0;

- retval = fasync_helper(filp, on, &tty->fasync);
+ retval = fasync_helper(fd, filp, on, &tty->fasync);
if (retval <= 0)
return retval;

@@ -1953,7 +1956,7 @@
* Just do some early initializations, and do the complex setup
* later.
*/
-long console_init(long kmem_start, long kmem_end)
+__initfunc(long console_init(long kmem_start, long kmem_end))
{
/* Setup the default TTY line discipline. */
memset(ldiscs, 0, sizeof(ldiscs));

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html