2 Copyright © 1995-2007, 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 from a filesystem.
30 devicename -- NUL terminated dos device name.
31 numbuffers -- Number of buffers to add. May be negative.
34 != 0 on success (IoErr() gives the actual number of buffers),
35 0 else (IoErr() gives the error code).
47 The error value in case of a filesystem error will be reported in
48 the io_MORE_CACHE.io_NumBuffers field.
50 *****************************************************************************/
59 if ((dvp
= GetDeviceProc(devicename
, NULL
)) == NULL
)
62 /* we're only interested in real devices */
63 if (dvp
->dvp_DevNode
== NULL
||
64 dvp
->dvp_DevNode
->dol_Type
!= DLT_DEVICE
) {
66 SetIoErr(ERROR_DEVICE_NOT_MOUNTED
);
70 ret
= dopacket1(DOSBase
, NULL
, dvp
->dvp_Port
, ACTION_MORE_CACHE
, numbuffers
);