2 Copyright © 1995-2014, 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).
39 Although some old filesystems return the new buffer count instead of
40 a success indication, a work-around for that case is built into the
41 AROS implementation of this function.
45 res1 = AddBuffers("DF0:", 10);
55 *****************************************************************************/
64 if ((dvp
= GetDeviceProc(devicename
, NULL
)) == NULL
)
67 /* we're only interested in real devices */
68 if (dvp
->dvp_DevNode
== NULL
||
69 dvp
->dvp_DevNode
->dol_Type
!= DLT_DEVICE
) {
71 SetIoErr(ERROR_DEVICE_NOT_MOUNTED
);
75 ret
= dopacket1(DOSBase
, NULL
, dvp
->dvp_Port
, ACTION_MORE_CACHE
, numbuffers
);