arch/ppc-sam440: No more need for the Parthenope hack
[AROS.git] / rom / dos / addbuffers.c
blob15838eb00c63a3326528a3748779db19fe849761
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Add or remove cache memory from a filesystem.
6 Lang: English
7 */
8 #include <proto/exec.h>
9 #include <dos/dosextens.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/dos.h>
17 AROS_LH2(LONG, AddBuffers,
19 /* SYNOPSIS */
20 AROS_LHA(CONST_STRPTR, devicename, D1),
21 AROS_LHA(LONG, numbuffers, D2),
23 /* LOCATION */
24 struct DosLibrary *, DOSBase, 122, Dos)
26 /* FUNCTION
27 Add or remove cache memory from a filesystem.
29 INPUTS
30 devicename -- NUL terminated dos device name.
31 numbuffers -- Number of buffers to add. May be negative.
33 RESULT
34 != 0 on success (IoErr() gives the actual number of buffers),
35 0 else (IoErr() gives the error code).
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 The error value in case of a filesystem error will be reported in
48 the io_MORE_CACHE.io_NumBuffers field.
50 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 struct DevProc *dvp;
56 LONG ret;
58 /* get the device */
59 if ((dvp = GetDeviceProc(devicename, NULL)) == NULL)
60 return DOSFALSE;
62 /* we're only interested in real devices */
63 if (dvp->dvp_DevNode == NULL ||
64 dvp->dvp_DevNode->dol_Type != DLT_DEVICE) {
65 FreeDeviceProc(dvp);
66 SetIoErr(ERROR_DEVICE_NOT_MOUNTED);
67 return DOSFALSE;
70 ret = dopacket1(DOSBase, NULL, dvp->dvp_Port, ACTION_MORE_CACHE, numbuffers);
72 FreeDeviceProc(dvp);
74 return ret;
76 AROS_LIBFUNC_EXIT
77 } /* AddBuffers */