Unlock() invalid lock object
Re: Unlock() invalid lock object
Since "Google Drive handler" appears to be ported from MOS or 68k, will OS4 AmigaDOS only use old packets if the lock fl_DOSType field is set to a legacy filesystem (e.g. old FFS)?
AmigaOne X1000 with 2GB memory - OS4.1 FE
- tonyw
- AmigaOS Core Developer
- Posts: 1479
- Joined: Wed Mar 09, 2011 1:36 pm
- Location: Sydney, Australia
Re: Unlock() invalid lock object
Of course, because it's the file system that executes the "UnLock()" call and calls IDOS->FreeDOSObject() at the end of it.It's the file system that calls FreeDosObject() to free locks.
It's the same thing as IDOS->Lock(), it has merely been renamed from "FileLock()" to "Lock()", since it is a generic structure.I was looking for "struct FileLock" which has apparently been replaced for OS4
Not sure what it will do if you change the fl_DOSType field. I would advise against it, since DOS might send your request to the wrong file system and cause havoc.Will OS4 AmigaDOS only use old packets if the lock fl_DOSType field is set to a legacy filesystem (e.g. old FFS)?
Any old DOS packets that the program uses should be handled by the file system and DOS together - the handler may execute the DOS packet itself, or it may pass it back to DOS which will emulate the call with a series of FS primitives. If neither can process the packet, a requester will come up on the screen asking you to submit a bug report for packet number xxx.
Since you don't get such requesters here, I would imagine that the packets are being handled OK. It looks as though either someone other than DOS is zeroing the fl_Lock field, or IDOS->UnLock() is being called twice.
cheers
tony
tony
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: Unlock() invalid lock object
It's not called directly by UnLock() so it's up to the file system implementation what actually gets called and how.tonyw wrote:Of course, because it's the file system that executes the "UnLock()" call and calls IDOS->FreeDOSObject() at the end of it.It's the file system that calls FreeDosObject() to free locks.
BTW DOS_LOCK support in AllocDosObject()/FreeDosObject() was added in dos.library V51 so it's unlikely that the google drive handler uses this feature.
Re: Unlock() invalid lock object
I don't think so. What it does is start with new packets and if they fail, it then uses old packets. The DOSType is largely for filesystem use only AFAIK.xenic wrote:Since "Google Drive handler" appears to be ported from MOS or 68k, will OS4 AmigaDOS only use old packets if the lock fl_DOSType field is set to a legacy filesystem (e.g. old FFS)?
I wouldn't use an existing filesystem ID in a new filesystem/handler as there's a chance the packets will get forwarded to the wrong place (with a "virtual" drive it's less of an issue, but if this was a proper volume it could potentially get mounted with the wrong filesystem), they ought to be unique.
Also I notice the OS4 version has been released now, so I guess this is sorted.