2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 Desc: Add or remove cache memory from a filesystem.
8 #include <proto/exec.h>
9 #include <dos/dosextens.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
15 #include <proto/dos.h>
17 AROS_LH2(LONG
, AddBuffers
,
20 AROS_LHA(CONST_STRPTR
, devicename
, D1
),
21 AROS_LHA(LONG
, numbuffers
, D2
),
24 struct DosLibrary
*, DOSBase
, 122, Dos
)
27 Add or remove cache memory to/from a filesystem. The amount of memory
28 per cache buffer and the limit depends on the filesystem.
31 devicename - DOS device name (with trailing ':' and NUL terminated).
32 numbuffers - Number of buffers to add. May be negative for decreasing.
35 DOSTRUE on success (IoErr() gives the actual number of buffers).
36 DOSFALSE on error (IoErr() gives the error code).
37 Some old filesystems return the actual buffer size. See the example
38 for a workaround for that case.
44 res1 = AddBuffers("df0:", 10);
46 if (res1 != DOSFALSE && res1 != DOSTRUE)
59 The error value in case of a filesystem error will be reported in
60 the io_MORE_CACHE.io_NumBuffers field.
62 *****************************************************************************/
71 if ((dvp
= GetDeviceProc(devicename
, NULL
)) == NULL
)
74 /* we're only interested in real devices */
75 if (dvp
->dvp_DevNode
== NULL
||
76 dvp
->dvp_DevNode
->dol_Type
!= DLT_DEVICE
) {
78 SetIoErr(ERROR_DEVICE_NOT_MOUNTED
);
82 ret
= dopacket1(DOSBase
, NULL
, dvp
->dvp_Port
, ACTION_MORE_CACHE
, numbuffers
);