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

sukadev at us.ibm.com sukadev at us.ibm.com
Mon Aug 25 16:57:36 PDT 2008


H. Peter Anvin [hpa at zytor.com] wrote:
> sukadev at us.ibm.com 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 at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list