Call CloseDevice() before DeleteIORequest(), and don't call
[AROS.git] / rom / filesys / afs / volumes.h
blob8aeea595547f608e0c3b12a8f3aa65e4019a97e9
1 #ifndef VOLUMES_H
2 #define VOLUMES_H
4 /*
5 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
6 $Id$
7 */
9 #include "os.h"
10 #include "filehandles.h"
11 #include "cache.h"
13 struct Volume {
14 struct Node ln;
15 struct Device *device; /* the handler this volume uses */
16 struct DeviceList devicelist __attribute__((aligned(4))); /* BPTR compatible */
17 struct DosList *volumenode;
18 ULONG SizeBlock; /* Block size in words */
19 ULONG blocksectors; /* nr of sectors per block */
20 ULONG sectorsize; /* nr of bytes per sector */
22 struct AfsHandle *locklist;
23 struct AfsHandle ah; /* root handle (unfilled except header_block) */
24 ULONG unit;
25 struct IOHandle ioh;
26 struct BlockCache *blockcache;
27 LONG numbuffers;
28 ULONG cachecounter; /* Keeps track of cache usage */
29 ULONG state; /* Read-only, read/write or validating */
30 ULONG key; /* Lock key */
31 ULONG inhibitcounter;
33 ULONG usedblockscount; /* nr of used blocks */
34 ULONG countblocks; /* nr of blocks in filesystem */
35 ULONG rootblock; /* rootblock position */
36 ULONG startblock; /* absolute nr of start block on whole HD */
37 ULONG lastblock; /* absolute nr of last block on whole HD */
38 ULONG dostype;
39 ULONG bitmapblockpointers[25];
40 ULONG bitmapextensionblock;
42 struct BlockCache *bitmapblock; /* last bitmap block used for marking */
43 ULONG bstartblock; /* first block marked in "bitmapblock" */
44 ULONG lastextensionblock; /* last used extensionblock (0=volume->bitmapblocks) */
45 ULONG lastposition; /* last position in extensionblock */
46 ULONG lastaccess; /* last marked block */
48 UWORD bootblocks;
49 UBYTE dosflags;
52 BOOL mediumPresent(struct IOHandle *);
53 struct Volume *initVolume(struct AFSBase *, struct Device *, CONST_STRPTR,
54 ULONG, ULONG flags, struct DosEnvec *, LONG *error);
55 void uninitVolume(struct AFSBase *, struct Volume *);
56 LONG newMedium(struct AFSBase *, struct Volume *);
57 LONG writeprotectVolume(struct AFSBase *, struct Volume *, BOOL on, ULONG key);
59 #endif