[EMAIL PROTECTED] 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?]);

Not "index", but "inode".  If, as a courtesy to the generic driver, we 
want to precalculate the index number we can do that, but otherwise that 
is of course available as:

index = inode->i_rdev - MK_DEV(device->major, device->minor_start);

... and if we replaced device->{major,minor_start} with device->base and 
made the drivers use MK_DEV() in the initializers, it would be even simpler.

        -hpa
_______________________________________________
Containers mailing list
[EMAIL PROTECTED]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
Devel@openvz.org
https://openvz.org/mailman/listinfo/devel

Reply via email to