Unlock() invalid lock object

This forum is for general developer support questions.

Re: Unlock() invalid lock object

Postby xenic » Tue Feb 09, 2016 6:02 pm

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
xenic
 
Posts: 1102
Joined: Sun Jun 19, 2011 1:06 am

Re: Unlock() invalid lock object

Postby tonyw » Tue Feb 09, 2016 10:44 pm

It's the file system that calls FreeDosObject() to free locks.


Of course, because it's the file system that executes the "UnLock()" call and calls IDOS->FreeDOSObject() at the end of it.

I was looking for "struct FileLock" which has apparently been replaced for OS4


It's the same thing as IDOS->Lock(), it has merely been renamed from "FileLock()" to "Lock()", since it is a generic structure.

Will OS4 AmigaDOS only use old packets if the lock fl_DOSType field is set to a legacy filesystem (e.g. old FFS)?

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.

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
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 1301
Joined: Wed Mar 09, 2011 2:36 pm
Location: Sydney, Australia

Re: Unlock() invalid lock object

Postby salass00 » Tue Feb 09, 2016 11:27 pm

tonyw wrote:
It's the file system that calls FreeDosObject() to free locks.


Of course, because it's the file system that executes the "UnLock()" call and calls IDOS->FreeDOSObject() at the end of it.


It's not called directly by UnLock() so it's up to the file system implementation what actually gets called and how.

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.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 502
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: Unlock() invalid lock object

Postby chris » Wed Feb 10, 2016 12:24 pm

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 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.

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.
chris
 
Posts: 551
Joined: Sat Jun 18, 2011 12:05 pm

Previous

Return to General Developer Support

Who is online

Users browsing this forum: No registered users and 2 guests