2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
10 #include <proto/dos.h>
11 #include <proto/exec.h>
13 #include <aros/macros.h>
14 #include <aros/debug.h>
16 #include "afshandler.h"
19 #include "filehandles1.h"
20 #include "filehandles2.h"
21 #include "filehandles3.h"
25 #include "baseredef.h"
27 static void replypkt(struct DosPacket
*dp
, SIPTR res1
)
34 mn
->mn_Node
.ln_Name
= (char*)dp
;
35 dp
->dp_Port
= &((struct Process
*)FindTask(NULL
))->pr_MsgPort
;
40 static void replypkt2(struct DosPacket
*dp
, SIPTR res1
, SIPTR res2
)
46 static struct AFSBase
*AFS_alloc(void)
48 struct AFSBase
*handler
;
50 handler
= AllocMem(sizeof(*handler
), MEMF_ANY
| MEMF_CLEAR
);
54 handler
->dosbase
= (struct DosLibrary
*)OpenLibrary("dos.library",0);
55 if (handler
->dosbase
!= NULL
) {
57 /* changeint task and sigbit */
58 handler
->port
.mp_SigTask
= FindTask(0);
59 handler
->port
.mp_SigBit
= SIGBREAKB_CTRL_F
;
61 /* Port for device commands */
62 handler
->timer_mp
= CreateMsgPort();
64 handler
->timer_request
= (struct timerequest
*)
65 CreateIORequest(handler
->timer_mp
, sizeof(struct timerequest
));
66 if (handler
->timer_request
!= NULL
) {
67 if (OpenDevice("timer.device", UNIT_VBLANK
,
68 (APTR
)handler
->timer_request
, 0) == 0) {
71 DeleteIORequest((struct IORequest
*)handler
->timer_request
);
73 CloseLibrary((struct Library
*)handler
->dosbase
);
79 static void AFS_free(struct AFSBase
*handler
)
81 if (handler
->timer_flags
& TIMER_ACTIVE
) {
82 AbortIO((struct IORequest
*)handler
->timer_request
);
83 WaitIO((struct IORequest
*)handler
->timer_request
);
85 CloseDevice((struct IORequest
*)handler
->timer_request
);
86 DeleteIORequest((struct IORequest
*)handler
->timer_request
);
87 CloseLibrary((struct Library
*)handler
->dosbase
);
88 FreeMem(handler
, sizeof(*handler
));
91 static struct Volume
*AFS_open_volume(struct AFSBase
*handler
, struct DosPacket
*dp
, LONG
*error
)
93 struct FileSysStartupMsg
*fssm
= BADDR(dp
->dp_Arg2
);
95 D(bug("AFS: Volume on Device %b, Unit %ld, Flags %ld, Environ %p\n",
96 fssm
->fssm_Device
, fssm
->fssm_Unit
,
97 fssm
->fssm_Flags
, BADDR(fssm
->fssm_Environ
)));
98 return initVolume(handler
,
99 NULL
, AROS_BSTR_ADDR(fssm
->fssm_Device
),
102 BADDR(fssm
->fssm_Environ
),
106 static BOOL
AFS_close_volume(struct AFSBase
*handler
, struct Volume
*volume
, SIPTR
*io_DosError
)
108 if (!volume
->locklist
) {
109 uninitVolume(handler
, volume
);
113 *io_DosError
= ERROR_OBJECT_IN_USE
;
117 static BOOL
AFS_protect_volume(struct AFSBase
*handler
, struct Volume
*volume
, BOOL on
, ULONG key
, SIPTR
*io_DosError
)
119 if (!volume
->locklist
)
121 LONG error
= writeprotectVolume(handler
, volume
, on
, key
);
126 *io_DosError
= error
;
130 *io_DosError
= ERROR_OBJECT_IN_USE
;
134 static VOID
startFlushTimer(struct AFSBase
*handler
)
136 struct timerequest
*request
;
138 /* Set up delay for next flush */
139 if (handler
->timer_flags
& TIMER_ACTIVE
) {
140 handler
->timer_flags
|= TIMER_RESTART
;
142 /* D(bug("[afs] Starting timer\n")); */
143 request
= handler
->timer_request
;
144 request
->tr_node
.io_Command
= TR_ADDREQUEST
;
145 request
->tr_time
.tv_secs
= 1;
146 request
->tr_time
.tv_micro
= 0;
147 SendIO((struct IORequest
*)handler
->timer_request
);
148 handler
->timer_flags
= TIMER_ACTIVE
;
152 static VOID
onFlushTimer(struct AFSBase
*handler
, struct Volume
*volume
)
154 handler
->timer_flags
&= ~TIMER_ACTIVE
;
156 if (handler
->timer_flags
& TIMER_RESTART
) {
157 startFlushTimer(handler
);
159 struct BlockCache
*blockbuffer
;
161 /* D(bug("[afs] Alarm rang.\n")); */
162 if ((volume
->dostype
== 0x444f5300) && mediumPresent(&volume
->ioh
))
164 /* Check if adding volume node needs to be retried */
165 if (volume
->volumenode
== NULL
)
166 attemptAddDosVolume(handler
, volume
);
168 flushCache(handler
, volume
);
169 blockbuffer
= getBlock(handler
, volume
, volume
->rootblock
);
170 if ((blockbuffer
->flags
& BCF_WRITE
) != 0)
172 writeBlock(handler
, volume
, blockbuffer
, -1);
173 blockbuffer
->flags
&= ~BCF_WRITE
;
175 if (volume
->ioh
.flags
& IOHF_MOTOR_OFF
) {
176 D(bug("[afs 0x%08lX] turning off motor\n", volume
));
177 motorOff(handler
, &volume
->ioh
);
178 volume
->ioh
.flags
&= ~IOHF_MOTOR_OFF
;
184 static BOOL
mediacheck(struct Volume
*volume
, SIPTR
*ok
, SIPTR
*res2
)
186 if (!mediumPresent(&volume
->ioh
)) {
188 *res2
= ERROR_NO_DISK
;
194 static LONG
gethandletype(struct AFSBase
*handler
, struct AfsHandle
*h
)
196 UBYTE buffer
[sizeof(struct ExAllData
) + MAXFILENAMELENGTH
];
197 struct ExAllData
*ead
= (APTR
)&buffer
[0];
198 ULONG size
= sizeof(buffer
);
199 ULONG mode
= ED_TYPE
;
203 res2
= examine(handler
, h
, ead
, size
, mode
, &dirpos
);
209 static CONST_STRPTR
skipdevname(CONST_STRPTR fn
)
212 /* Skip past device names */
213 for (cp
= fn
; *cp
; cp
++) {
224 /*******************************************
226 Descr.: main loop (get packets and answer (or not))
227 Input : proc - our process structure
229 ********************************************/
230 void __startup
AFS_work(void)
233 struct DosPacket
*dp
;
235 struct AFSBase
*handler
;
236 struct Volume
*volume
;
240 D(bug("[AFS] started\n"));
241 mp
= &((struct Process
*)FindTask(NULL
))->pr_MsgPort
;
243 dp
= (struct DosPacket
*)GetMsg(mp
)->mn_Node
.ln_Name
;
244 D(bug("[AFS] start message recevied. port=%p, path='%b'\n", mp
, dp
->dp_Arg1
));
246 handler
= AFS_alloc();
248 if (handler
== NULL
) {
249 D(bug("[AFS] Can't allocate an instance of the handler for this volume\n"));
250 replypkt(dp
, DOSFALSE
);
254 volume
= AFS_open_volume(handler
, dp
, &retval
);
255 if (volume
== NULL
) {
256 D(bug("[AFS] Can't open volume\n"));
257 replypkt2(dp
, DOSFALSE
, retval
);
262 /* make non-packet functions to see our volume */
263 NEWLIST(&handler
->device_list
);
264 AddHead(&handler
->device_list
, &volume
->ln
);
266 /* Say that we are going to persist */
267 ((struct DeviceNode
*)BADDR(dp
->dp_Arg3
))->dn_Task
= mp
;
269 replypkt(dp
, DOSTRUE
);
272 ULONG packetmask
= 1L << mp
->mp_SigBit
;
273 ULONG timermask
= 1L << handler
->timer_mp
->mp_SigBit
;
274 ULONG changemask
= 1L << SIGBREAKB_CTRL_F
;
277 sigs
= Wait(packetmask
| timermask
| changemask
);
279 if (sigs
& timermask
)
280 onFlushTimer(handler
, volume
);
281 if (sigs
& changemask
) {
282 checkDeviceFlags(handler
);
285 if (!(sigs
& packetmask
))
288 /* DOS Packet processing */
290 while ((mn
= GetMsg(mp
)) != NULL
) {
294 dp
= (struct DosPacket
*)mn
->mn_Node
.ln_Name
;
296 D(bug("[AFS] packet %p:%d\n", dp
, dp
->dp_Type
));
297 startFlushTimer(handler
);
299 switch (dp
->dp_Type
) {
301 if (!AFS_close_volume(handler
, volume
, &res2
)) {
308 case ACTION_IS_FILESYSTEM
:
312 res2
= inhibit(handler
, volume
, dp
->dp_Arg1
);
313 ok
= res2
? DOSFALSE
: DOSTRUE
;
316 closef(handler
, (struct AfsHandle
*)dp
->dp_Arg1
);
319 case ACTION_MORE_CACHE
:
321 LONG numbuff
= dp
->dp_Arg1
;
324 volume
->numbuffers
+= numbuff
;
326 if (volume
->numbuffers
< 1)
327 volume
->numbuffers
= 1;
329 flushCache(handler
, volume
);
331 freeCache(handler
, volume
->blockcache
);
333 volume
->blockcache
= initCache(handler
, volume
, volume
->numbuffers
);
334 if (volume
->blockcache
)
336 volume
->numbuffers
/= 2;
337 if (volume
->numbuffers
< 1)
338 volume
->numbuffers
= 1;
342 res2
= volume
->numbuffers
;
345 case ACTION_DISK_INFO
:
346 ok
= getDiskInfo(volume
, BADDR(dp
->dp_Arg1
)) ? DOSFALSE
: DOSTRUE
;
348 case ACTION_SAME_LOCK
:
350 struct FileLock
*f1
= BADDR(dp
->dp_Arg1
);
351 struct FileLock
*f2
= BADDR(dp
->dp_Arg2
);
352 ok
= sameLock((struct AfsHandle
*)f1
->fl_Key
, (struct AfsHandle
*)f2
->fl_Key
);
358 switch (dp
->dp_Type
) {
359 case ACTION_FINDINPUT
:
360 case ACTION_FINDOUTPUT
:
361 case ACTION_FINDUPDATE
:
363 struct FileHandle
*fh
= BADDR(dp
->dp_Arg1
);
364 struct FileLock
*dl
= BADDR(dp
->dp_Arg2
);
365 CONST_STRPTR fn
= AROS_BSTR_ADDR(dp
->dp_Arg3
);
366 struct AfsHandle
*dh
;
367 struct AfsHandle
*ah
;
370 if (!mediacheck(volume
, &ok
, &res2
))
376 dh
= (APTR
)(dl
->fl_Key
);
378 /* MODE_* directly matches its
379 * corresponding ACTION_* counterpart.
383 fn
= skipdevname(fn
);
385 if (dp
->dp_Type
== ACTION_FINDOUTPUT
) {
386 ah
= openfile(handler
, dh
, fn
, mode
, 0, &res2
);
388 ah
= openf(handler
, dh
, fn
, mode
, &res2
);
390 ok
= (ah
!= NULL
) ? DOSTRUE
: DOSFALSE
;
392 if (dp
->dp_Type
!= ACTION_FINDOUTPUT
) {
393 LONG type
= gethandletype(handler
, ah
);
396 res2
= ERROR_OBJECT_WRONG_TYPE
;
402 fh
->fh_Arg1
= (LONG
)(IPTR
)ah
;
406 case ACTION_LOCATE_OBJECT
:
408 struct FileLock
*dl
= BADDR(dp
->dp_Arg1
);
410 CONST_STRPTR fn
= AROS_BSTR_ADDR(dp
->dp_Arg2
);
411 struct AfsHandle
*dh
;
412 struct AfsHandle
*ah
;
415 if (!mediacheck(volume
, &ok
, &res2
))
421 dh
= (APTR
)(dl
->fl_Key
);
423 if (dp
->dp_Arg3
== ACCESS_READ
)
425 else if (dp
->dp_Arg3
== ACCESS_WRITE
)
428 fn
= skipdevname(fn
);
430 ah
= openf(handler
, dh
, fn
, mode
, &res2
);
435 fl
= AllocMem(sizeof(*fl
), MEMF_CLEAR
);
438 fl
->fl_Key
= (LONG
)(IPTR
)ah
;
439 fl
->fl_Access
= dp
->dp_Arg3
;
441 fl
->fl_Volume
= MKBADDR(&volume
->devicelist
);
442 ok
= (SIPTR
)MKBADDR(fl
);
447 res2
= ERROR_NO_FREE_STORE
;
451 case ACTION_COPY_DIR
: /* Aka DupLock() */
452 case ACTION_COPY_DIR_FH
:
454 struct FileLock
*ol
= BADDR(dp
->dp_Arg1
);
456 struct AfsHandle
*oh
;
457 struct AfsHandle
*ah
;
459 if (!mediacheck(volume
, &ok
, &res2
))
462 if (dp
->dp_Type
== ACTION_COPY_DIR
) {
463 oh
= ol
? (APTR
)ol
->fl_Key
: &volume
->ah
;
465 oh
= (APTR
)dp
->dp_Arg1
;
468 ah
= openf(handler
, oh
, "", MODE_OLDFILE
, &res2
);
473 fl
= AllocMem(sizeof(*fl
), MEMF_CLEAR
);
476 fl
->fl_Key
= (LONG
)(IPTR
)ah
;
477 fl
->fl_Access
= ACCESS_READ
;
479 fl
->fl_Volume
= MKBADDR(&volume
->devicelist
);
480 ok
= (SIPTR
)MKBADDR(fl
);
485 res2
= ERROR_NO_FREE_STORE
;
489 case ACTION_FREE_LOCK
:
492 struct AfsHandle
*ah
;
494 if (!mediacheck(volume
, &ok
, &res2
))
497 fl
= BADDR(dp
->dp_Arg1
);
502 ah
= (APTR
)(fl
->fl_Key
);
504 FreeMem(fl
, sizeof(*fl
));
509 if (!mediacheck(volume
, &ok
, &res2
))
511 ok
= readf(handler
, (struct AfsHandle
*)(dp
->dp_Arg1
), (APTR
)dp
->dp_Arg2
, (LONG
)dp
->dp_Arg3
, &res2
);
514 if (!mediacheck(volume
, &ok
, &res2
))
516 ok
= writef(handler
, (struct AfsHandle
*)(dp
->dp_Arg1
), (APTR
)dp
->dp_Arg2
, (LONG
)dp
->dp_Arg3
, &res2
);
519 if (!mediacheck(volume
, &ok
, &res2
))
521 ok
= seek(handler
, (struct AfsHandle
*)(dp
->dp_Arg1
), (LONG
)dp
->dp_Arg2
, (LONG
)dp
->dp_Arg3
, &res2
);
523 case ACTION_SET_FILE_SIZE
:
524 if (!mediacheck(volume
, &ok
, &res2
))
526 ok
= setFileSize(handler
, (struct AfsHandle
*)(((struct FileHandle
*)(dp
->dp_Arg1
))->fh_Arg1
),(LONG
)dp
->dp_Arg2
, (LONG
)dp
->dp_Arg3
, &res2
);
528 case ACTION_FH_FROM_LOCK
:
530 struct FileHandle
*fh
= BADDR(dp
->dp_Arg1
);
531 struct FileLock
*fl
= BADDR(dp
->dp_Arg2
);
532 fh
->fh_Arg1
= (LONG
)(IPTR
)fl
->fl_Key
;
533 FreeMem(fl
, sizeof(*fl
));
536 case ACTION_EXAMINE_OBJECT
:
537 case ACTION_EXAMINE_FH
:
539 struct FileLock
*fl
= BADDR(dp
->dp_Arg1
);
540 struct AfsHandle
*ah
;
541 struct FileInfoBlock
*fib
= BADDR(dp
->dp_Arg2
);
542 UBYTE buffer
[sizeof(struct ExAllData
) + MAXFILENAMELENGTH
+ MAXCOMMENTLENGTH
];
543 struct ExAllData
*ead
= (APTR
)&buffer
[0];
544 ULONG size
= sizeof(buffer
);
545 ULONG mode
= ED_OWNER
;
548 if (!mediacheck(volume
, &ok
, &res2
))
551 if (dp
->dp_Type
== ACTION_EXAMINE_OBJECT
)
552 ah
= fl
? (APTR
)fl
->fl_Key
: &volume
->ah
;
554 ah
= (APTR
)dp
->dp_Arg1
;
561 res2
= examine(handler
, ah
, ead
, size
, mode
, &dirpos
);
567 if (ah
== &volume
->ah
) {
568 fib
->fib_DirEntryType
= ST_ROOT
;
570 fib
->fib_DirEntryType
= ead
->ed_Type
;
573 fib
->fib_DiskKey
= ah
->header_block
;
574 strncpy(&fib
->fib_FileName
[1], ead
->ed_Name
, sizeof(fib
->fib_FileName
)-1);
575 fib
->fib_FileName
[0] = strlen(&fib
->fib_FileName
[1]);
576 fib
->fib_Protection
= ead
->ed_Prot
;
577 fib
->fib_EntryType
= fib
->fib_DirEntryType
;
578 fib
->fib_Size
= ead
->ed_Size
;
579 fib
->fib_NumBlocks
= (ead
->ed_Size
+ ah
->volume
->sectorsize
- 1) / ah
->volume
->sectorsize
;
580 fib
->fib_Date
.ds_Days
= ead
->ed_Days
;
581 fib
->fib_Date
.ds_Minute
= ead
->ed_Mins
;
582 fib
->fib_Date
.ds_Tick
= ead
->ed_Ticks
;
583 if (ead
->ed_Comment
) {
584 strncpy(&fib
->fib_Comment
[1], ead
->ed_Comment
, sizeof(fib
->fib_Comment
)-1);
585 fib
->fib_Comment
[0] = strlen(&fib
->fib_Comment
[1]);
587 fib
->fib_Comment
[0] = 0;
589 fib
->fib_OwnerUID
= ead
->ed_OwnerUID
;
590 fib
->fib_OwnerGID
= ead
->ed_OwnerGID
;
594 case ACTION_EXAMINE_NEXT
:
596 struct FileLock
*fl
= BADDR(dp
->dp_Arg1
);
597 struct AfsHandle
*ah
;
598 struct FileInfoBlock
*fib
= BADDR(dp
->dp_Arg2
);
600 if (!mediacheck(volume
, &ok
, &res2
))
611 ah
= (APTR
)fl
->fl_Key
;
613 res2
= examineNext(handler
, ah
, fib
);
619 if (ah
== &volume
->ah
) {
620 fib
->fib_DirEntryType
= ST_ROOT
;
626 case ACTION_PARENT_FH
:
628 struct FileLock
*opl
= BADDR(dp
->dp_Arg1
);
630 struct AfsHandle
*oh
;
631 struct AfsHandle
*ah
;
633 if (!mediacheck(volume
, &ok
, &res2
))
636 if (dp
->dp_Type
== ACTION_PARENT
)
637 oh
= (APTR
)opl
->fl_Key
;
639 oh
= (APTR
)dp
->dp_Arg1
;
640 ah
= openf(handler
, oh
, "/", MODE_OLDFILE
, &res2
);
643 if (res2
== ERROR_OBJECT_NOT_FOUND
&& gethandletype(handler
, oh
) == ST_ROOT
)
644 res2
= 0; /* need to return res2 = 0 (not 205) if oh == ST_ROOT */
647 fl
= AllocMem(sizeof(*fl
), MEMF_CLEAR
);
650 fl
->fl_Key
= (LONG
)(IPTR
)ah
;
651 fl
->fl_Access
= ACCESS_READ
;
653 fl
->fl_Volume
= MKBADDR(&volume
->devicelist
);
654 ok
= (SIPTR
)MKBADDR(fl
);
659 res2
= ERROR_NO_FREE_STORE
;
665 struct FileLock
*opl
= BADDR(dp
->dp_Arg1
);
666 struct AfsHandle
*oh
;
670 oh
= (APTR
)opl
->fl_Key
;
671 if (gethandletype(handler
, oh
) == 0 || !mediacheck(volume
, &ok
, &res2
)) {
672 res2
= ERROR_OBJECT_NOT_FOUND
;
675 res2
= getDiskInfo(volume
, BADDR(dp
->dp_Arg2
));
676 ok
= res2
? DOSFALSE
: DOSTRUE
;
680 case ACTION_RENAME_OBJECT
:
682 struct FileLock
*opl
= BADDR(dp
->dp_Arg1
);
683 //unused//struct FileLock *npl = BADDR(dp->dp_Arg3);
684 CONST_STRPTR on
= AROS_BSTR_ADDR(dp
->dp_Arg2
);
685 CONST_STRPTR nn
= AROS_BSTR_ADDR(dp
->dp_Arg4
);
686 struct AfsHandle
*oh
;
691 oh
= (APTR
)opl
->fl_Key
;
692 on
= skipdevname(on
);
693 nn
= skipdevname(nn
);
694 res2
= renameObject(handler
, oh
, on
, nn
);
695 ok
= res2
? DOSFALSE
: DOSTRUE
;
698 case ACTION_RENAME_DISK
:
700 CONST_STRPTR n
= AROS_BSTR_ADDR(dp
->dp_Arg1
);
701 ok
= relabel(handler
, volume
, n
, &res2
);
704 case ACTION_CREATE_DIR
:
706 struct FileLock
*fl
= BADDR(dp
->dp_Arg1
), *flnew
;
707 struct AfsHandle
*h
, *ah
;
708 CONST_STRPTR n
= AROS_BSTR_ADDR(dp
->dp_Arg2
);
712 h
= (APTR
)fl
->fl_Key
;
714 flnew
= AllocMem(sizeof(*flnew
), MEMF_CLEAR
);
716 ah
= createDir(handler
, h
, n
, 0, &res2
);
717 ok
= res2
? DOSFALSE
: DOSTRUE
;
719 flnew
->fl_Link
= BNULL
;
720 flnew
->fl_Key
= (LONG
)(IPTR
)ah
;
721 flnew
->fl_Access
= ACCESS_READ
;
723 flnew
->fl_Volume
= MKBADDR(&volume
->devicelist
);
724 ok
= (SIPTR
)MKBADDR(flnew
);
728 res2
= ERROR_NO_FREE_STORE
;
732 case ACTION_DELETE_OBJECT
:
734 struct FileLock
*fl
= BADDR(dp
->dp_Arg1
);
736 CONST_STRPTR n
= AROS_BSTR_ADDR(dp
->dp_Arg2
);
740 h
= (APTR
)fl
->fl_Key
;
742 res2
= deleteObject(handler
, h
, n
);
743 ok
= res2
? DOSFALSE
: DOSTRUE
;
746 case ACTION_SET_COMMENT
:
748 struct FileLock
*fl
= BADDR(dp
->dp_Arg2
);
750 CONST_STRPTR n
= AROS_BSTR_ADDR(dp
->dp_Arg3
);
751 CONST_STRPTR c
= AROS_BSTR_ADDR(dp
->dp_Arg4
);
755 h
= (APTR
)fl
->fl_Key
;
757 res2
= setComment(handler
, h
, n
, c
);
758 ok
= res2
? DOSFALSE
: DOSTRUE
;
761 case ACTION_SET_PROTECT
:
763 struct FileLock
*fl
= BADDR(dp
->dp_Arg2
);
765 CONST_STRPTR n
= AROS_BSTR_ADDR(dp
->dp_Arg3
);
766 ULONG p
= dp
->dp_Arg4
;
770 h
= (APTR
)fl
->fl_Key
;
772 res2
= setProtect(handler
, h
, n
, p
);
773 ok
= res2
? DOSFALSE
: DOSTRUE
;
776 case ACTION_SET_DATE
:
778 struct FileLock
*fl
= BADDR(dp
->dp_Arg2
);
780 CONST_STRPTR n
= AROS_BSTR_ADDR(dp
->dp_Arg3
);
781 struct DateStamp
*ds
= (struct DateStamp
*)dp
->dp_Arg4
;
785 h
= (APTR
)fl
->fl_Key
;
787 res2
= setDate(handler
, h
, n
, ds
);
788 ok
= res2
? DOSFALSE
: DOSTRUE
;
792 res2
= inhibit(handler
, volume
, dp
->dp_Arg1
);
793 ok
= res2
? DOSFALSE
: DOSTRUE
;
797 CONST_STRPTR n
= AROS_BSTR_ADDR(dp
->dp_Arg1
);
798 res2
= format(handler
, volume
, n
, dp
->dp_Arg2
);
799 ok
= res2
? DOSFALSE
: DOSTRUE
;
802 case ACTION_SERIALIZE_DISK
:
803 ok
= relabel(handler
, volume
, NULL
, &res2
);
805 case ACTION_WRITE_PROTECT
:
806 ok
= AFS_protect_volume(handler
, volume
, dp
->dp_Arg1
, dp
->dp_Arg2
, &res2
) ? DOSFALSE
: DOSTRUE
;
810 res2
= ERROR_NOT_IMPLEMENTED
;
811 D(bug("[AFS] %d not implemented\n", dp
->dp_Type
));
817 replypkt2(dp
, ok
, res2
);
822 replypkt(dp
, DOSTRUE
);