Re: [linux-pm] Re: swsusp 'disk' fails in bk-current - intel_agp at fault?

From: Dmitry Torokhov
Date: Thu Mar 31 2005 - 10:11:20 EST


On Thu, 31 Mar 2005 10:39:10 +0200, Pavel Machek <pavel@xxxxxxx> wrote:
> > int swsusp_write(void)
> > {
> > int error;
> > - device_resume();
> > lock_swapdevices();
> > error = write_suspend_image();
> > /* This will unlock ignored swap devices since writing is
>
> Looks good, except... why move code around? Could you just call
> usermodehelper_disable from swsusp_write?

That's because I don't think that swsusp_write is a proper place for
it ;) It looks like a lean and mean function that does just write and
manipulating usermodehelper state _and_ system (device) state is
wrong. Let it do one thing, don't overload with actions that I think
belong to the upper level. Do you agree?

I think I need to stick in usermodehelper_enable call in case
swsusp_write fails though.

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