Re: [patch] kernel sysfs events layer

Andrew Morton
2004-09-01T00:24:11Z

Robert Love <rml@ximian.com> wrote:
>
> +int send_kevent(enum kevent type, struct kset *kset,
> + struct kobject *kobj, const char *signal)
> +{
> + const char *path;
> + int ret;
> +
> + path = kobject_get_path(kset, kobj, GFP_KERNEL);
> + if (!path)
> + return -ENOMEM;
> +
> + ret = do_send_kevent(type, GFP_KERNEL, path, signal);
> + kfree(path);
> +
> + return ret;
> +}
> +
> +EXPORT_SYMBOL_GPL(send_kevent);
> +
> +int send_kevent_atomic(enum kevent type, struct kset *kset,
> + struct kobject *kobj, const char *signal)
> +{
> + const char *path;
> + int ret;
> +
> + path = kobject_get_path(kset, kobj, GFP_ATOMIC);
> + if (!path)
> + return -ENOMEM;
> +
> + ret = do_send_kevent(type, GFP_ATOMIC, path, signal);
> + kfree(path);
> +
> + return ret;
> +}

Why not share the implementation here?