Re: ioctl32_unregister_conversion & modules

Arnd Bergmann (arnd@arndb.de)
Fri, 9 May 2003 21:30:33 +0200


On Friday 09 May 2003 17:24, Pavel Machek wrote:

> Fixing that would require resgister_ioctl32_conversion() to have 3-rd
> parameter "this module" and some magic inside fs/compat_ioctl.c,
> right?

The code that is currently using register_ioctl32_conversion() does
not have to be changed if we use

extern int
__register_ioctl_conversion(int, ioctl_trans_handler_t, struct module*);

static inline int
register_ioctl_conversion(int cmd, ioctl_trans_handler_t h)
{
return __register_ioctl_conversion(cmd, h, THIS_MODULE);
}

/* maybe also: */
static inline int
register_compatible_ioctl(int cmd)
{
return __register_ioctl_conversion(cmd, NULL, NULL);
}

register_compatible_ioctl() is not strictly needed, but it will avoid
doing the unnecessary try_module_get() when there is no handler.

Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/