Re: [RFC/RFT][PATCH -mm] swsusp: userland interface

From: Pavel Machek
Date: Thu Jan 12 2006 - 19:15:35 EST


Hi!

> > > +commands defined in kernel/power/power.h. The major and minor
> > > +numbers of the device are, respectively, 10 and 231, and they can
> > > +be read from /sys/class/misc/snapshot/dev.
> >
> > Is this still true?
>
> You mean the /sys/class/misc/snapshot/dev? Yes, until sysfs gets revamped.

Ahha, but it is not your code but misc-handling code in kernel, right?

> > > +SNAPSHOT_IOCAVAIL_SWAP - check the amount of available swap (the last argument
> > > + should be a pointer to an unsigned int variable that will contain
> > > + the result if the call is successful)
> >
> > Is this good idea? It will overflow on 32-bit systems. Ammount of
> > available swap can be >4GB. [Or maybe it is in something else than
> > bytes, then you need to specify it.]
>
> It returns the number of pages. Well, it should be written explicitly,
> so I'll fix that.
>
> [This feature is actually useful, because it allows you to check if you have
> enough swap after creating the snapshot and retry for eg. image_size = 0
> without unfreezing tasks.]

Ok. [I was asking about unsigned int, it is clear that querying
available swap is useful]. If you return swap offsets, you may want to
specify if it is #bytes/#pages, too.

> > Ouch and you have my ACK on next attempt :-).
>
> Thanks (you are brave, though ;-)).

I... think you can call it "brave", yes. Nice euphemism ;-)))).
Pavel
--
Thanks, Sharp!
-
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/