5 #define SFS_SPECIFIC_MESSAGE 0xff00
8 #define SFS_PACKET_BASE (0xf00000)
10 #define SFS_INQUIRY (SFS_PACKET_BASE + 0x11000)
12 #define ACTION_GET_TOTAL_BLOCKS (SFS_INQUIRY + 0)
13 #define ACTION_GET_BLOCKSIZE (SFS_INQUIRY + 1)
14 #define ACTION_GET_BLOCKDATA (SFS_INQUIRY + 2)
16 #define ACTION_SET_DEBUG (SFS_PACKET_BASE + 0xBDC0)
17 #define ACTION_SET_CACHE (SFS_PACKET_BASE + 0xBDC0 + 1)
18 #define ACTION_FORMAT_ARGS (SFS_PACKET_BASE + 0xBDC0 + 2)
20 /* Above are 'old' packet types. Below are the new types. */
22 #define ACTION_SFS_QUERY (SFS_PACKET_BASE + 1)
23 #define ACTION_SFS_SET (SFS_PACKET_BASE + 2)
25 #define ACTION_SFS_SET_OBJECTBITS (SFS_PACKET_BASE + 100 + 1)
26 #define ACTION_SFS_LOCATE_OBJECT (SFS_PACKET_BASE + 100 + 2)
27 #define ACTION_SFS_FORMAT (SFS_PACKET_BASE + 100 + 3)
29 #define ACTION_SFS_READ_BITMAP (SFS_PACKET_BASE + 200 + 1)
31 #define ACTION_SFS_DEFRAGMENT_INIT (SFS_PACKET_BASE + 300 + 1)
32 #define ACTION_SFS_DEFRAGMENT_STEP (SFS_PACKET_BASE + 300 + 2)
34 /* Tags used by ACTION_SFS_FORMAT: */
36 #define ASFBASE (TAG_USER)
38 #define ASF_NAME (ASFBASE + 1) /* The name of the disk. If this tag is not specified
39 format will fail with ERROR_INVALID_COMPONENT_NAME. */
41 #define ASF_NORECYCLED (ASFBASE + 2) /* If TRUE, then this tag will prevent the Recycled
42 directory from being created. It defaults to creating
43 the Recycled directory. */
45 #define ASF_CASESENSITIVE (ASFBASE + 3) /* If TRUE, then this tag will use case sensitive file
46 and directory names. It defaults to case insensitive
49 #define ASF_SHOWRECYCLED (ASFBASE + 4) /* If TRUE, then the Recycled directory will be visible
50 in directory listings. It defaults to an invisible
51 Recycled directory. */
53 #define ASF_RECYCLEDNAME (ASFBASE + 5) /* The name of the Recycled directory. Defaults to
60 arg1: (struct TagItem *); Pointer to a TagList.
62 res1: DOSTRUE if no error occured.
63 res2: If res1 is DOSFALSE, then this contains the errorcode.
65 This packet fills the tags you provided in the taglist with
66 the desired information. See query.h for the tags (ASQ_#?).
72 arg1: (struct TagItem *); Pointer to a TagList
74 res1: DOSTRUE if no error occured.
75 res2: If res1 is DOSFALSE, then this contains the errorcode.
77 This packet allows you to set a number of parameters of the
78 filesystem. See query.h for the tags (ASS_#?).
82 ACTION_SFS_SET_OBJECTBITS
85 arg2: BPTR to a struct FileLock
86 arg3: BSTR with the path and objectname
89 res1: DOSTRUE if no error occured.
90 res2: If res1 is DOSFALSE, then this contains the errorcode.
92 This packet allows you to set SFS specific bits for objects.
93 At the moment it allows you to set or clear the OTYPE_HIDE
94 bit which causes objects to be excluded from directory
99 ACTION_SFS_LOCATE_OBJECT
101 arg1: ObjectNode number
104 res1: A (normal) pointer to a Lock, or 0 if an error occured. Don't
105 forget that you should use TOBADDR() if you want to pass this
106 lock to any DOS functions.
107 res2: If res1 is 0, then this contains the errorcode.
109 This packet can be used to obtain a FileLock by ObjectNode
110 number. The Recycled directory has a fixed ObjectNode number
111 RECYCLEDNODE (2) and you can use this packet to obtain a lock
114 Accessmode is similair to ACTION_LOCATE_OBJECT. It can be
115 SHARED_LOCK or EXCLUSIVE_LOCK.
121 arg1: (struct TagItem *); Pointer to a TagList.
125 ACTION_SFS_READ_BITMAP
127 arg1: Pointer to area to store the requested part of the
128 bitmap. Make sure it is large enough to hold the
130 arg2: Block number. The start block of the requested area;
131 this must be a multiple of 8.
132 arg3: Amount. The amount of blocks your requesting.
134 res1: DOSTRUE if no error occured.
135 res2: If res1 is DOSFALSE, then this contains the errorcode.
137 This packet can be used to read (part of) the bitmap. Each
138 set bit indicates a free block, and each cleared bit
139 indicates a block which is in use. This function will
140 return ERROR_BAD_NUMBER if you specified a bad block number
141 (not a multiple of eight, or a block which is too high).
142 This error will also be returned if the amount you specified
143 would run past the end of the partition.
147 ACTION_SFS_DEFRAGMENT_INIT
149 res1: DOSTRUE if no error occured.
150 res2: If res1 is DOSFALSE, then this contains the errorcode.
152 Resets the defragmenter to the beginning of the disk.
156 ACTION_SFS_DEFRAGMENT_STEP
158 arg1: Pointer to area to store the steps the defragmenter
160 arg2: Size of the buffer in longwords(!). This is not used
161 at the moment. Make sure the buffer consists of atleast
164 res1: DOSTRUE if no error occured.
165 res2: If res1 is DOSFALSE, then this contains the errorcode.
167 This packet causes SFS to do one step of the defragmenting
168 process. It is possible that 'nothing' seems to happen during
169 a step. The buffer pointed to by arg1 is filled with a special
170 structure which you can use to determine what SFS has done.
172 A single step looks like this:
174 struct DefragmentStep {
175 ULONG id; // id of the step ("MOVE", "DONE" or 0)
176 ULONG length; // length in longwords (can be 0)
177 ULONG data[0]; // size of this array is determined by length.
180 Multiple of these steps can be present in the buffer you gave
181 in arg1. The last step will always have an id of 0.
183 There are 2 types of steps:
185 "MOVE", length (3), blocks, source, destination
187 The MOVE step tells you that a number of blocks have moved from
188 a source to a new destination.
192 The DONE step tells you that SFS can't defragment any further --
193 in other words, it is done defragmenting.
195 In the future new types of steps might be defined. If you don't
196 recognize a step, then use the length field to skip it and just
197 continue processing the other steps.
201 "MOVE", 3, 10, 20, 30,
202 "MOVE", 3, 1, 55, 56,
205 -> There have been 10 blocks moved from block 20 to block 30 and
206 there has been 1 block moved from block 55 to block 56.
212 -> Nothing has happened, but SFS is not yet done defragmenting