[patch] Add advisory locks to HAL devices

Robert Love rml at ximian.com
Sun Sep 12 20:36:47 PDT 2004


On Sun, 2004-09-12 at 21:08 +0200, David Zeuthen wrote:

> Btw, an interesting question is whether we should Lock() a hal device
> object of capability 'volume' when it is mounted? I personally think we
> should do this as you can't (or shouldn't at least) format it or burn to
> it when the kernel fs code claims the backing block device. 

If we don't mind HAL itself doing Lock() calls then I think that, yes,
we should lock the volume whenever it is mounted.

(Hopefully) most ioctl()'s and other things on the device return -EBUSY
when the device is already mounted (because the superblock in the kernel
already has a raised ref count).  But it does not hurt.

I think that as an ideal alternative, the mount program could do the
Lock().  

> If yes, it follows we might want to make info.locked.reason something
> that is easy to localize into the UI. Such as an integer and have the
> mapping from integer to meaning in the hal spec and possibly in libhal
> (my feeling is that errno.h is not sufficient :-).

Agreed.

Best,

	Robert Love


_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list