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]

 



H. Peter Anvin [hpa@xxxxxxxxx] wrote:
> sukadev@xxxxxxxxxx wrote:
>> 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);
>
> This seems more than a bit redundant.  The "instance", IMO, *is* the tty 
> structure; so the interface should be:
>
> 	tty = driver->ops->get_tty(driver, inode [, other_stuff?]);


Yes, if we have the tty inode, we don't need the index or instance
parameters.  I was generalizing 

For instance in ptmx_open() we initially have only an index and the
ptmx_inode which is somewhat distinct from the tty's inode.

IOW, we use the ptmx_inode to find the 'instance' and use that
instance to build the tty inode. Of course we don't need ->get_tty()
there.

Can the inode be used to identify the driver too ?  (but inode to driver
mapping is not trivial atm).
_______________________________________________
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