Re: [RFC][PATCH 1/3] Move parts of init_dev() into new functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alan Cox [alan@xxxxxxxxxxxxxxxxxxx] wrote:
| On Mon, 25 Aug 2008 13:11:10 -0700
| sukadev@xxxxxxxxxx wrote:
| 
| > 
| > init_dev() is doing too many things all in one function, making it
| > harder to understand/extend. This and following two patches attempt
| > to simplify/cleanup the interface a bit.
| > 
| > Only touch tested at this point. Appreciate any comments :-)
| 
| Well this code is very much in flux so I really don't want to get further
| changes mixed up into the plan at the wrong moment. That said:

Ok. Do let me know if there are pieces I can help with.

| 
| > +/*
| > + * 	find_tty() - find an existing tty, if any
| > + * 	@driver: the driver for the tty
| > + * 	@idx:	 the minor number
| 
| This fits very well with where I want to end up - which is
| 
| 
| 	tty = driver->ops->something(driver, idx);

That looks like a good idea. With multiple pts instances, we would also
need an 'instance' parameter to uniquely identify the pty. Other tty
devices could set their 'instance' to NULL.

It could be a void *, although internally if it is the pts inode, we
could optimize devpts (as Peter Anvin pointed out).

By extension, maybe the tty layer would need another interface to determine
the instance:

	instance =  driver->ops->get_instance(driver, inode, other_stuff) 

using this we find the tty

	tty = driver->ops->something(driver, instance, idx);
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux