udftools

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
file.c
Go to the documentation of this file.
1 /*
2 * file.c
3 *
4 * Copyright (c) 2001-2002 Ben Fennema <bfennema@falcon.csc.calpoly.edu>
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 *
21 */
22
28 #include "config.h"
29
30 #include <malloc.h>
31
32 #include "libudffs.h"
33 #include "file.h"
34 #include "defaults.h"
35
83 tag query_tag(struct udf_disc *disc, struct udf_extent *ext, struct udf_desc *desc, uint16_t SerialNum)
84 {
85 tag ret;
86 int i;
87 struct udf_data *data;
88 uint16_t crc = 0;
89 int offset = sizeof(tag);
90
91 ret.tagIdent = cpu_to_le16(desc->ident);
92 if (disc->udf_rev >= 0x0200)
93 ret.descVersion = cpu_to_le16(3);
94 else
95 ret.descVersion = cpu_to_le16(2);
96 ret.tagChecksum = 0;
97 ret.reserved = 0;
98 ret.tagSerialNum = cpu_to_le16(SerialNum);
99 ret.descCRCLength = cpu_to_le16(desc->length - sizeof(tag));
100 data = desc->data;
101 while (data != NULL)
102 {
103 crc = udf_crc(data->buffer + offset, data->length - offset, crc);
104 offset = 0;
105 data = data->next;
106 }
107 ret.descCRC = cpu_to_le16(crc);
108 if (ext->space_type & PSPACE)
109 ret.tagLocation = cpu_to_le32(desc->offset);
110 else
111 ret.tagLocation = cpu_to_le32(ext->start + desc->offset);
112 for (i=0; i<16; i++)
113 if (i != 4)
114 ret.tagChecksum += (uint8_t)(((char *)&ret)[i]);
115
116 return ret;
117 }
118
129 tag udf_query_tag(struct udf_disc *disc, uint16_t Ident, uint16_t SerialNum, uint32_t Location, struct udf_data *data, uint16_t length)
130 {
131 tag ret;
132 int i;
133 uint16_t crc = 0;
134 int offset = sizeof(tag);
135 int clength;
136
137 ret.tagIdent = cpu_to_le16(Ident);
138 if (disc->udf_rev >= 0x0200)
139 ret.descVersion = cpu_to_le16(3);
140 else
141 ret.descVersion = cpu_to_le16(2);
142 ret.tagChecksum = 0;
143 ret.reserved = 0;
144 ret.tagSerialNum = cpu_to_le16(SerialNum);
145 ret.descCRCLength = cpu_to_le16(length - sizeof(tag));
146 while (data != NULL && length)
147 {
148 if ((clength = data->length) > length)
149 clength = length;
150 crc = udf_crc(data->buffer + offset, clength - offset, crc);
151 length -= clength;
152 offset = 0;
153 data = data->next;
154 }
155 ret.descCRC = cpu_to_le16(crc);
156 ret.tagLocation = cpu_to_le32(Location);
157 for (i=0; i<16; i++)
158 if (i != 4)
159 ret.tagChecksum += (uint8_t)(((char *)&ret)[i]);
160
161 return ret;
162 }
163
174 int insert_desc(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *desc, struct udf_desc *parent, struct udf_data *data)
175 {
176 uint32_t block = 0;
177
178 if (disc->flags & FLAG_EFE)
179 {
180 struct extendedFileEntry *efe = (struct extendedFileEntry *)parent->data->buffer;
181
182 if ((le16_to_cpu(efe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_IN_ICB)
183 {
184 block = parent->offset;
185 append_data(parent, data);
186 efe->lengthAllocDescs = cpu_to_le32(le32_to_cpu(efe->lengthAllocDescs) + data->length);
187 }
188 else
189 {
190 struct udf_desc *fiddesc = NULL;
191
192 if (le32_to_cpu(efe->lengthAllocDescs) == 0)
193 {
194 block = udf_alloc_blocks(disc, pspace, desc->offset, 1);
195 fiddesc = set_desc(disc, pspace, TAG_IDENT_FID, block, data->length, data);
196 if ((le16_to_cpu(efe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_SHORT)
197 {
198 short_ad *sad;
199
200 parent->length += sizeof(short_ad);
201 parent->data->length += sizeof(short_ad);
202 parent->data->buffer = realloc(parent->data->buffer, parent->length);
203 efe = (struct extendedFileEntry *)parent->data->buffer;
204 sad = (short_ad *)&efe->allocDescs[le32_to_cpu(efe->lengthExtendedAttr) + le32_to_cpu(efe->lengthAllocDescs)];
205 sad->extPosition = cpu_to_le32(block);
206 sad->extLength = cpu_to_le32(data->length);
207 efe->lengthAllocDescs = cpu_to_le32(sizeof(short_ad));
208 }
209 else if ((le16_to_cpu(efe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_LONG)
210 {
211 long_ad *lad;
212
213 parent->length += sizeof(long_ad);
214 parent->data->length += sizeof(long_ad);
215 parent->data->buffer = realloc(parent->data->buffer, parent->length);
216 efe = (struct extendedFileEntry *)parent->data->buffer;
217 lad = (long_ad *)&efe->allocDescs[le32_to_cpu(efe->lengthExtendedAttr) + le32_to_cpu(efe->lengthAllocDescs)];
218 lad->extLocation.logicalBlockNum = cpu_to_le32(block);
219 lad->extLocation.partitionReferenceNum = cpu_to_le16(0);
220 lad->extLength = cpu_to_le32(data->length);
221 efe->lengthAllocDescs = cpu_to_le32(sizeof(long_ad));
222 }
223 efe->logicalBlocksRecorded = cpu_to_le32(1);
224 }
225 else
226 {
227 if ((le16_to_cpu(efe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_SHORT)
228 {
229 short_ad *sad;
230
231 sad = (short_ad *)&efe->allocDescs[le32_to_cpu(efe->lengthExtendedAttr) + le32_to_cpu(efe->lengthAllocDescs) - sizeof(short_ad)];
232 fiddesc = find_desc(pspace, le32_to_cpu(sad->extPosition));
233 block = fiddesc->offset;
234 append_data(fiddesc, data);
235 sad->extLength = cpu_to_le32(le32_to_cpu(sad->extLength) + data->length);
236 }
237 else if ((le16_to_cpu(efe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_LONG)
238 {
239 long_ad *lad;
240
241 lad = (long_ad *)&efe->allocDescs[le32_to_cpu(efe->lengthExtendedAttr) + le32_to_cpu(efe->lengthAllocDescs) - sizeof(long_ad)];
242 fiddesc = find_desc(pspace, le32_to_cpu(lad->extLocation.logicalBlockNum));
243 block = fiddesc->offset;
244 append_data(fiddesc, data);
245 lad->extLength = cpu_to_le32(le32_to_cpu(lad->extLength) + data->length);
246 }
247 }
248 }
249 }
250 else
251 {
252 struct fileEntry *fe = (struct fileEntry *)parent->data->buffer;
253
254 if ((le16_to_cpu(fe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_IN_ICB)
255 {
256 block = parent->offset;
257 append_data(parent, data);
258 fe->lengthAllocDescs = cpu_to_le32(le32_to_cpu(fe->lengthAllocDescs) + data->length);
259 }
260 else
261 {
262 struct udf_desc *fiddesc = NULL;
263
264 if (le32_to_cpu(fe->lengthAllocDescs) == 0)
265 {
266 block = udf_alloc_blocks(disc, pspace, desc->offset, 1);
267 fiddesc = set_desc(disc, pspace, TAG_IDENT_FID, block, data->length, data);
268 if ((le16_to_cpu(fe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_SHORT)
269 {
270 short_ad *sad;
271
272 parent->length += sizeof(short_ad);
273 parent->data->length += sizeof(short_ad);
274 parent->data->buffer = realloc(parent->data->buffer, parent->length);
275 fe = (struct fileEntry *)parent->data->buffer;
276 sad = (short_ad *)&fe->allocDescs[le32_to_cpu(fe->lengthExtendedAttr) + le32_to_cpu(fe->lengthAllocDescs)];
277 sad->extPosition = cpu_to_le32(block);
278 sad->extLength = cpu_to_le32(data->length);
279 fe->lengthAllocDescs = cpu_to_le32(sizeof(short_ad));
280 }
281 else if ((le16_to_cpu(fe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_LONG)
282 {
283 long_ad *lad;
284
285 parent->length += sizeof(long_ad);
286 parent->data->length += sizeof(long_ad);
287 parent->data->buffer = realloc(parent->data->buffer, parent->length);
288 fe = (struct fileEntry *)parent->data->buffer;
289 lad = (long_ad *)&fe->allocDescs[le32_to_cpu(fe->lengthExtendedAttr) + le32_to_cpu(fe->lengthAllocDescs)];
290 lad->extLocation.logicalBlockNum = cpu_to_le32(block);
291 lad->extLocation.partitionReferenceNum = cpu_to_le16(0);
292 lad->extLength = cpu_to_le32(data->length);
293 fe->lengthAllocDescs = cpu_to_le32(sizeof(long_ad));
294 }
295 fe->logicalBlocksRecorded = cpu_to_le32(1);
296 }
297 else
298 {
299 if ((le16_to_cpu(fe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_SHORT)
300 {
301 short_ad *sad;
302
303 sad = (short_ad *)&fe->allocDescs[le32_to_cpu(fe->lengthExtendedAttr) + le32_to_cpu(fe->lengthAllocDescs) - sizeof(short_ad)];
304 fiddesc = find_desc(pspace, le32_to_cpu(sad->extPosition));
305 block = fiddesc->offset;
306 append_data(fiddesc, data);
307 sad->extLength = cpu_to_le32(le32_to_cpu(sad->extLength) + data->length);
308 }
309 else if ((le16_to_cpu(fe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_LONG)
310 {
311 long_ad *lad;
312
313 lad = (long_ad *)&fe->allocDescs[le32_to_cpu(fe->lengthExtendedAttr) + le32_to_cpu(fe->lengthAllocDescs) - sizeof(long_ad)];
314 fiddesc = find_desc(pspace, le32_to_cpu(lad->extLocation.logicalBlockNum));
315 block = fiddesc->offset;
316 append_data(fiddesc, data);
317 lad->extLength = cpu_to_le32(le32_to_cpu(lad->extLength) + data->length);
318 }
319 }
320 }
321 }
322 return block;
323 }
324
333 void insert_data(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *desc, struct udf_data *data)
334 {
335 if (disc->flags & FLAG_EFE)
336 {
337 struct extendedFileEntry *efe = (struct extendedFileEntry *)desc->data->buffer;
338
339 if ((le16_to_cpu(efe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_IN_ICB)
340 {
341 append_data(desc, data);
342 efe->lengthAllocDescs = cpu_to_le32(le32_to_cpu(efe->lengthAllocDescs) + data->length);
343 efe->informationLength = cpu_to_le64(le64_to_cpu(efe->informationLength) + data->length);
344 efe->objectSize = cpu_to_le64(le64_to_cpu(efe->objectSize) + data->length);
345 }
346 }
347 else
348 {
349 struct fileEntry *fe = (struct fileEntry *)desc->data->buffer;
350
351 if ((le16_to_cpu(fe->icbTag.flags) & ICBTAG_FLAG_AD_MASK) == ICBTAG_FLAG_AD_IN_ICB)
352 {
353 append_data(desc, data);
354 fe->lengthAllocDescs = cpu_to_le32(le32_to_cpu(fe->lengthAllocDescs) + data->length);
355 fe->informationLength = cpu_to_le64(le64_to_cpu(fe->informationLength) + data->length);
356 }
357 }
358
359 *(tag *)desc->data->buffer = query_tag(disc, pspace, desc, 1);
360 }
361
368 uint32_t compute_ident_length(uint32_t length)
369 {
370 return length + (4 - (length % 4)) %4;
371 }
372
385 void insert_fid(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *desc, struct udf_desc *parent, uint8_t *name, uint8_t length, uint8_t filechar)
386 {
387 struct udf_data *data;
388 struct fileIdentDesc *fid;
389 int ilength = compute_ident_length(sizeof(struct fileIdentDesc) + length);
390 int offset;
391 uint64_t uniqueID;
392
393 data = alloc_data(NULL, ilength);
394 fid = data->buffer;
395
396 offset = insert_desc(disc, pspace, desc, parent, data);
397 fid->descTag.tagLocation = cpu_to_le32(offset);
398
399 if (disc->flags & FLAG_EFE)
400 {
401 struct extendedFileEntry *efe = (struct extendedFileEntry *)desc->data->buffer;
402
403 efe->fileLinkCount = cpu_to_le16(le16_to_cpu(efe->fileLinkCount) + 1);
404 uniqueID = le64_to_cpu(efe->uniqueID);
405
406 efe = (struct extendedFileEntry *)parent->data->buffer;
407
408 if (disc->flags & FLAG_STRATEGY4096)
409 fid->icb.extLength = cpu_to_le32(disc->blocksize * 2);
410 else
411 fid->icb.extLength = cpu_to_le32(disc->blocksize);
412 fid->icb.extLocation.logicalBlockNum = cpu_to_le32(desc->offset);
413 fid->icb.extLocation.partitionReferenceNum = cpu_to_le16(0);
414 *(uint32_t *)((struct allocDescImpUse *)fid->icb.impUse)->impUse = cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL);
415 fid->fileVersionNum = cpu_to_le16(1);
416 fid->fileCharacteristics = filechar;
417 fid->lengthFileIdent = length;
418 fid->lengthOfImpUse = cpu_to_le16(0);
419 memcpy(fid->fileIdent, name, length);
420 fid->descTag = udf_query_tag(disc, TAG_IDENT_FID, 1, le32_to_cpu(fid->descTag.tagLocation), data, ilength);
421
422 efe->informationLength = cpu_to_le64(le64_to_cpu(efe->informationLength) + ilength);
423 efe->objectSize = cpu_to_le64(le64_to_cpu(efe->objectSize) + ilength);
424 }
425 else
426 {
427 struct fileEntry *fe = (struct fileEntry *)desc->data->buffer;
428
429 fe->fileLinkCount = cpu_to_le16(le16_to_cpu(fe->fileLinkCount) + 1);
430 uniqueID = le64_to_cpu(fe->uniqueID);
431
432 fe = (struct fileEntry *)parent->data->buffer;
433
434 if (disc->flags & FLAG_STRATEGY4096)
435 fid->icb.extLength = cpu_to_le32(disc->blocksize * 2);
436 else
437 fid->icb.extLength = cpu_to_le32(disc->blocksize);
438 fid->icb.extLocation.logicalBlockNum = cpu_to_le32(desc->offset);
439 fid->icb.extLocation.partitionReferenceNum = cpu_to_le16(0);
440 *(uint32_t *)((struct allocDescImpUse *)fid->icb.impUse)->impUse = cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL);
441 fid->fileVersionNum = cpu_to_le16(1);
442 fid->fileCharacteristics = filechar;
443 fid->lengthFileIdent = length;
444 fid->lengthOfImpUse = cpu_to_le16(0);
445 memcpy(fid->fileIdent, name, length);
446 fid->descTag = udf_query_tag(disc, TAG_IDENT_FID, 1, le32_to_cpu(fid->descTag.tagLocation), data, ilength);
447 fe->informationLength = cpu_to_le64(le64_to_cpu(fe->informationLength) + ilength);
448 }
449 *(tag *)desc->data->buffer = query_tag(disc, pspace, desc, 1);
450 *(tag *)parent->data->buffer = query_tag(disc, pspace, parent, 1);
451 }
452
466 struct udf_desc *udf_create(struct udf_disc *disc, struct udf_extent *pspace, uint8_t *name, uint8_t length, uint32_t offset, struct udf_desc *parent, uint8_t filechar, uint8_t filetype, uint16_t flags)
467 {
468 struct udf_desc *desc;
469
470 if (disc->flags & FLAG_STRATEGY4096)
471 offset = udf_alloc_blocks(disc, pspace, offset, 2);
472 else
473 offset = udf_alloc_blocks(disc, pspace, offset, 1);
474
475 if (disc->flags & FLAG_EFE)
476 {
477 struct extendedFileEntry *efe;
478
479 desc = set_desc(disc, pspace, TAG_IDENT_EFE, offset, sizeof(struct extendedFileEntry), NULL);
480 efe = (struct extendedFileEntry *)desc->data->buffer;
481 memcpy(efe, &default_efe, sizeof(struct extendedFileEntry));
482 memcpy(&efe->accessTime, &disc->udf_pvd[0]->recordingDateAndTime, sizeof(timestamp));
483 memcpy(&efe->modificationTime, &efe->accessTime, sizeof(timestamp));
484 memcpy(&efe->attrTime, &efe->accessTime, sizeof(timestamp));
485 memcpy(&efe->createTime, &efe->accessTime, sizeof(timestamp));
486 if (filetype == ICBTAG_FILE_TYPE_STREAMDIR ||
487 flags & ICBTAG_FLAG_STREAM)
488 efe->uniqueID = cpu_to_le64(0);
489 else
490 {
491 efe->uniqueID = cpu_to_le64(le64_to_cpu(((uint64_t *)disc->udf_lvid->logicalVolContentsUse)[0]));
492 if (!(le64_to_cpu(efe->uniqueID) & 0x00000000FFFFFFFFUL))
493 ((uint64_t *)disc->udf_lvid->logicalVolContentsUse)[0] = cpu_to_le64(le64_to_cpu(efe->uniqueID) + 16);
494 else
495 ((uint64_t *)disc->udf_lvid->logicalVolContentsUse)[0] = cpu_to_le64(le64_to_cpu(efe->uniqueID) + 1);
496 }
497 if (disc->flags & FLAG_STRATEGY4096)
498 {
499 efe->icbTag.strategyType = cpu_to_le16(4096);
500 efe->icbTag.strategyParameter = cpu_to_le16(1);
501 efe->icbTag.numEntries = cpu_to_le16(2);
502 }
503 efe->icbTag.fileType = filetype;
504 efe->icbTag.flags = cpu_to_le16(le16_to_cpu(efe->icbTag.flags) | flags);
505 efe->uid = cpu_to_le32(disc->uid);
506 efe->gid = cpu_to_le32(disc->gid);
507 if (parent)
508 {
509 // efe->icbTag.parentICBLocation.logicalBlockNum = cpu_to_le32(parent->offset); // for strategy type != 4
510 efe->icbTag.parentICBLocation.logicalBlockNum = cpu_to_le32(0);
511 efe->icbTag.parentICBLocation.partitionReferenceNum = cpu_to_le16(0);
512 insert_fid(disc, pspace, desc, parent, name, length, filechar);
513 }
514 else
515 {
516 efe->icbTag.parentICBLocation.logicalBlockNum = cpu_to_le32(0);
517 efe->icbTag.parentICBLocation.partitionReferenceNum = cpu_to_le16(0);
518 }
519 if (filetype == ICBTAG_FILE_TYPE_DIRECTORY)
520 query_lvidiu(disc)->numDirs = cpu_to_le32(le32_to_cpu(query_lvidiu(disc)->numDirs)+1);
521 else if (filetype != ICBTAG_FILE_TYPE_STREAMDIR && filetype != ICBTAG_FILE_TYPE_VAT20 && filetype != ICBTAG_FILE_TYPE_UNDEF && !(flags & ICBTAG_FLAG_STREAM))
522 query_lvidiu(disc)->numFiles = cpu_to_le32(le32_to_cpu(query_lvidiu(disc)->numFiles)+1);
523 }
524 else
525 {
526 struct fileEntry *fe;
527
528 desc = set_desc(disc, pspace, TAG_IDENT_FE, offset, sizeof(struct fileEntry), NULL);
529 fe = (struct fileEntry *)desc->data->buffer;
530 memcpy(fe, &default_fe, sizeof(struct fileEntry));
531 memcpy(&fe->accessTime, &disc->udf_pvd[0]->recordingDateAndTime, sizeof(timestamp));
532 memcpy(&fe->modificationTime, &fe->accessTime, sizeof(timestamp));
533 memcpy(&fe->attrTime, &fe->accessTime, sizeof(timestamp));
534 if (filetype == ICBTAG_FILE_TYPE_STREAMDIR ||
535 flags & ICBTAG_FLAG_STREAM)
536 fe->uniqueID = cpu_to_le64(0);
537 else
538 {
539 fe->uniqueID = cpu_to_le64(le64_to_cpu(((uint64_t *)disc->udf_lvid->logicalVolContentsUse)[0]));
540 if (!(le64_to_cpu(fe->uniqueID) & 0x00000000FFFFFFFFUL))
541 ((uint64_t *)disc->udf_lvid->logicalVolContentsUse)[0] = cpu_to_le64(le64_to_cpu(fe->uniqueID) + 16);
542 else
543 ((uint64_t *)disc->udf_lvid->logicalVolContentsUse)[0] = cpu_to_le64(le64_to_cpu(fe->uniqueID) + 1);
544 }
545 if (disc->flags & FLAG_STRATEGY4096)
546 {
547 fe->icbTag.strategyType = cpu_to_le16(4096);
548 fe->icbTag.strategyParameter = cpu_to_le16(1);
549 fe->icbTag.numEntries = cpu_to_le16(2);
550 }
551 fe->icbTag.fileType = filetype;
552 fe->icbTag.flags = cpu_to_le16(le16_to_cpu(fe->icbTag.flags) | flags);
553 fe->uid = cpu_to_le32(disc->uid);
554 fe->gid = cpu_to_le32(disc->gid);
555 if (parent)
556 {
557 // fe->icbTag.parentICBLocation.logicalBlockNum = cpu_to_le32(parent->offset); // for strategy type != 4
558 fe->icbTag.parentICBLocation.logicalBlockNum = cpu_to_le32(0);
559 fe->icbTag.parentICBLocation.partitionReferenceNum = cpu_to_le16(0);
560 insert_fid(disc, pspace, desc, parent, name, length, filechar);
561 }
562 else
563 {
564 fe->icbTag.parentICBLocation.logicalBlockNum = cpu_to_le32(0);
565 fe->icbTag.parentICBLocation.partitionReferenceNum = cpu_to_le16(0);
566 }
567 if (filetype == ICBTAG_FILE_TYPE_DIRECTORY)
568 query_lvidiu(disc)->numDirs = cpu_to_le32(le32_to_cpu(query_lvidiu(disc)->numDirs)+1);
569 else if (filetype != ICBTAG_FILE_TYPE_STREAMDIR && filetype != ICBTAG_FILE_TYPE_VAT20 && filetype != ICBTAG_FILE_TYPE_UNDEF && !(flags & ICBTAG_FLAG_STREAM))
570 query_lvidiu(disc)->numFiles = cpu_to_le32(le32_to_cpu(query_lvidiu(disc)->numFiles)+1);
571 }
572
573 return desc;
574 }
575
587 struct udf_desc *udf_mkdir(struct udf_disc *disc, struct udf_extent *pspace, uint8_t *name, uint8_t length, uint32_t offset, struct udf_desc *parent)
588 {
589 struct udf_desc *desc = udf_create(disc, pspace, name, length, offset, parent, FID_FILE_CHAR_DIRECTORY, ICBTAG_FILE_TYPE_DIRECTORY, 0);
590
591 if (!parent)
592 parent = desc; // the root directory is it's own parent
593 insert_fid(disc, pspace, parent, desc, NULL, 0, FID_FILE_CHAR_DIRECTORY | FID_FILE_CHAR_PARENT); // directory parent back links are unnamed
594
595 return desc;
596 }
597
598 #define BITS_PER_LONG 32
599
600 #define leBPL_to_cpup(x) leNUM_to_cpup(BITS_PER_LONG, x)
601 #define leNUM_to_cpup(x,y) xleNUM_to_cpup(x,y)
602 #define xleNUM_to_cpup(x,y) (le ## x ## _to_cpup(y))
603 #define uintBPL uint(BITS_PER_LONG)
604 #define uint(x) xuint(x)
605 #define xuint(x) uint ## x ## _t
606
612 static inline unsigned long ffz(unsigned long word)
613 {
614 unsigned long result;
615
616 result = 0;
617 while (word & 1)
618 {
619 result ++;
620 word >>= 1;
621 }
622
623 return result;
624 }
625
633 static inline unsigned long udf_find_next_one_bit (void * addr, unsigned long size, unsigned long offset)
634 {
635 uintBPL * p = ((uintBPL *) addr) + (offset / BITS_PER_LONG);
636 uintBPL result = offset & ~(BITS_PER_LONG-1);
637 uintBPL tmp;
638
639 if (offset >= size)
640 return size;
641 size -= result;
642 offset &= (BITS_PER_LONG-1);
643 if (offset)
644 {
645 tmp = leBPL_to_cpup(p++);
646 tmp &= ~0UL << offset;
647 if (size < BITS_PER_LONG)
648 goto found_first;
649 if (tmp)
650 goto found_middle;
651 size -= BITS_PER_LONG;
652 result += BITS_PER_LONG;
653 }
654 while (size & ~(BITS_PER_LONG-1))
655 {
656 if ((tmp = leBPL_to_cpup(p++)))
657 goto found_middle;
658 result += BITS_PER_LONG;
659 size -= BITS_PER_LONG;
660 }
661 if (!size)
662 return result;
663 tmp = leBPL_to_cpup(p);
664 found_first:
665 tmp &= ~0UL >> (BITS_PER_LONG-size);
666 found_middle:
667 return result + ffz(~tmp);
668 }
669
677 static inline unsigned long udf_find_next_zero_bit(void * addr, unsigned long size, unsigned long offset)
678 {
679 uintBPL * p = ((uintBPL *) addr) + (offset / BITS_PER_LONG);
680 uintBPL result = offset & ~(BITS_PER_LONG-1);
681 uintBPL tmp;
682
683 if (offset >= size)
684 return size;
685 size -= result;
686 offset &= (BITS_PER_LONG-1);
687 if (offset)
688 {
689 tmp = leBPL_to_cpup(p++);
690 tmp |= (~0UL >> (BITS_PER_LONG-offset));
691 if (size < BITS_PER_LONG)
692 goto found_first;
693 if (~tmp)
694 goto found_middle;
695 size -= BITS_PER_LONG;
696 result += BITS_PER_LONG;
697 }
698 while (size & ~(BITS_PER_LONG-1))
699 {
700 if (~(tmp = leBPL_to_cpup(p++)))
701 goto found_middle;
702 result += BITS_PER_LONG;
703 size -= BITS_PER_LONG;
704 }
705 if (!size)
706 return result;
707 tmp = leBPL_to_cpup(p);
708 found_first:
709 tmp |= (~0UL << size);
710 if (tmp == (uintBPL)~0UL) /* Are any bits zero? */
711 return result + size; /* Nope. */
712 found_middle:
713 return result + ffz(tmp);
714 }
715
725 int udf_alloc_bitmap_blocks(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *bitmap, uint32_t start, uint32_t blocks)
726 {
727 uint32_t alignment = disc->sizing[PSPACE_SIZE].align;
728 struct spaceBitmapDesc *sbd = (struct spaceBitmapDesc *)bitmap->data->buffer;
729 uint32_t end;
730
731 do
732 {
733 start = ((start + alignment - 1) / alignment) * alignment;
734 if (sbd->bitmap[start/8] & (1 << (start%8)))
735 {
736 end = udf_find_next_zero_bit(sbd->bitmap, sbd->numOfBits, start);
737 }
738 else
739 start = end = udf_find_next_one_bit(sbd->bitmap, sbd->numOfBits, start);
740 } while ((end - start) <= blocks);
741
742 clear_bits(sbd->bitmap, start, blocks);
743 return start;
744 }
745
755 int udf_alloc_table_blocks(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *table, uint32_t start, uint32_t blocks)
756 {
757 uint32_t alignment = disc->sizing[PSPACE_SIZE].align;
758 struct unallocSpaceEntry *use = (struct unallocSpaceEntry *)table->data->buffer;
759 uint32_t end, offset = 0;
760 short_ad *sad;
761
762 do
763 {
764 sad = (short_ad *)&use->allocDescs[offset];
765 if (start < le32_to_cpu(sad->extPosition))
766 start = le32_to_cpu(sad->extPosition);
767 start = ((start + alignment - 1) / alignment) * alignment;
768 end = le32_to_cpu(sad->extPosition) + ((le32_to_cpu(sad->extLength) & 0x3FFFFFFF) >> disc->blocksize_bits);
769 if (start > end)
770 start = end;
771 offset += sizeof(short_ad);
772 } while ((end - start) < blocks);
773
774 if (start == le32_to_cpu(sad->extPosition) && start + blocks == end)
775 {
776 /* deleted extent */
777 memmove(&use->allocDescs[offset-sizeof(short_ad)],
778 &use->allocDescs[offset],
779 le32_to_cpu(use->lengthAllocDescs) - offset);
780 use->lengthAllocDescs = cpu_to_le32(le32_to_cpu(use->lengthAllocDescs) - sizeof(short_ad));
781 memset(&use->allocDescs[le32_to_cpu(use->lengthAllocDescs)], 0x00, sizeof(short_ad));
782 }
783 else if (start == le32_to_cpu(sad->extPosition))
784 {
785 sad->extPosition = cpu_to_le32(start + blocks);
786 sad->extLength = cpu_to_le32(le32_to_cpu(sad->extLength) - blocks * disc->blocksize);
787 }
788 else if (start + blocks == end)
789 {
790 sad->extLength = cpu_to_le32(le32_to_cpu(sad->extLength) - blocks * disc->blocksize);
791 }
792 else
793 {
794 memmove(&use->allocDescs[offset+sizeof(short_ad)],
795 &use->allocDescs[offset],
796 le32_to_cpu(use->lengthAllocDescs) - offset);
797 sad->extLength = cpu_to_le32(EXT_NOT_RECORDED_ALLOCATED | (start - le32_to_cpu(sad->extPosition)) * disc->blocksize);
798 sad = (short_ad *)&use->allocDescs[offset];
799 sad->extPosition = cpu_to_le32(start+blocks);
800 sad->extLength = cpu_to_le32(EXT_NOT_RECORDED_ALLOCATED | (end - start - blocks) * disc->blocksize);
801 use->lengthAllocDescs = cpu_to_le32(le32_to_cpu(use->lengthAllocDescs) + sizeof(short_ad));
802 }
803 use->descTag = udf_query_tag(disc, TAG_IDENT_USE, 1, table->offset, table->data, sizeof(struct unallocSpaceEntry) + le32_to_cpu(use->lengthAllocDescs));
804 return start;
805 }
806
814 int udf_alloc_blocks(struct udf_disc *disc, struct udf_extent *pspace, uint32_t start, uint32_t blocks)
815 {
816 struct udf_desc *desc;
817 struct partitionHeaderDesc *phd = (struct partitionHeaderDesc *)disc->udf_pd[0]->partitionContentsUse;
818
819 disc->udf_lvid->freeSpaceTable[0] = cpu_to_le32(le32_to_cpu(disc->udf_lvid->freeSpaceTable[0]) - blocks);
820
821 if (disc->flags & FLAG_FREED_BITMAP)
822 {
823 desc = find_desc(pspace, le32_to_cpu(phd->freedSpaceBitmap.extPosition));
824 return udf_alloc_bitmap_blocks(disc, pspace, desc, start, blocks);
825 }
826 else if (disc->flags & FLAG_FREED_TABLE)
827 {
828 desc = find_desc(pspace, le32_to_cpu(phd->freedSpaceTable.extPosition));
829 return udf_alloc_table_blocks(disc, pspace, desc, start, blocks);
830 }
831 else if (disc->flags & FLAG_UNALLOC_BITMAP)
832 {
833 desc = find_desc(pspace, le32_to_cpu(phd->unallocSpaceBitmap.extPosition));
834 return udf_alloc_bitmap_blocks(disc, pspace, desc, start, blocks);
835 }
836 else if (disc->flags & FLAG_UNALLOC_TABLE)
837 {
838 desc = find_desc(pspace, le32_to_cpu(phd->unallocSpaceTable.extPosition));
839 return udf_alloc_table_blocks(disc, pspace, desc, start, blocks);
840 }
841 else if (disc->flags & FLAG_VAT)
842 {
843 uint32_t offset = 0, length = 0;
844 if (pspace->tail)
845 {
846 offset = pspace->tail->offset;
847 length = (pspace->tail->length + disc->blocksize - 1) >>
848 disc->blocksize_bits;
849 }
850 if (offset + length > start)
851 start = offset + length;
852 disc->vat[disc->vat_entries++] = start;
853 return start;
854 }
855 else
856 return 0;
857 }
udf_query_tag
tag udf_query_tag(struct udf_disc *disc, uint16_t Ident, uint16_t SerialNum, uint32_t Location, struct udf_data *data, uint16_t length)
create an on-disc format tag from udf_descriptor components
Definition: file.c:129
ICBTAG_FLAG_STREAM
#define ICBTAG_FLAG_STREAM
Definition: ecma_167.h:540
extendedFileEntry::fileLinkCount
uint16_t fileLinkCount
Definition: ecma_167.h:805
insert_desc
int insert_desc(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *desc, struct udf_desc *parent, struct udf_data *data)
append a udf_data item containing a FID in the payload to the udf_data list for a directory tag:FE/EF...
Definition: file.c:174
extendedFileEntry::icbTag
icbtag icbTag
Definition: ecma_167.h:801
udf_disc::vat_entries
uint64_t vat_entries
Definition: libudffs.h:123
fileEntry::lengthExtendedAttr
uint32_t lengthExtendedAttr
Definition: ecma_167.h:578
numDirs
uint32_t numDirs
Definition: osta_udf.h:163
extendedFileEntry::attrTime
timestamp attrTime
Definition: ecma_167.h:815
partitionDesc::partitionContentsUse
uint8_t partitionContentsUse[128]
Definition: ecma_167.h:267
fileEntry::uid
uint32_t uid
Definition: ecma_167.h:562
primaryVolDesc::recordingDateAndTime
timestamp recordingDateAndTime
Definition: ecma_167.h:221
cpu_to_le32
#define cpu_to_le32(x)
Definition: bswap.h:247
crc
int crc(void *restrict desc, uint16_t size)
Wrapper function for CRC calculation.
Definition: udffsck.c:134
extendedFileEntry
Definition: ecma_167.h:798
ffz
static unsigned long ffz(unsigned long word)
utility function to find the first zero bit in an unsigned long
Definition: file.c:612
udf_disc::blocksize
uint16_t blocksize
Definition: libudffs.h:98
extendedFileEntry::accessTime
timestamp accessTime
Definition: ecma_167.h:812
udf_disc::udf_lvid
struct logicalVolIntegrityDesc * udf_lvid
Definition: libudffs.h:118
extendedFileEntry::informationLength
uint64_t informationLength
Definition: ecma_167.h:809
fileEntry::icbTag
icbtag icbTag
Definition: ecma_167.h:561
logicalVolIntegrityDescImpUse::numDirs
uint32_t numDirs
Definition: osta_udf.h:98
udf_disc::udf_pd
struct partitionDesc * udf_pd[2]
Definition: libudffs.h:114
logicalVolIntegrityDesc::logicalVolContentsUse
uint8_t logicalVolContentsUse[32]
Definition: ecma_167.h:366
FLAG_EFE
#define FLAG_EFE
Definition: libudffs.h:43
FID_FILE_CHAR_PARENT
#define FID_FILE_CHAR_PARENT
Definition: ecma_167.h:477
udf_create
struct udf_desc * udf_create(struct udf_disc *disc, struct udf_extent *pspace, uint8_t *name, uint8_t length, uint32_t offset, struct udf_desc *parent, uint8_t filechar, uint8_t filetype, uint16_t flags)
create a file tag:FE/EFE udf_descriptor and add the file to a directory
Definition: file.c:466
fileEntry::logicalBlocksRecorded
uint64_t logicalBlocksRecorded
Definition: ecma_167.h:570
udf_disc::vat
uint32_t * vat
Definition: libudffs.h:122
logicalVolIntegrityDescImpUse::numFiles
uint32_t numFiles
Definition: osta_udf.h:97
udf_crc
uint16_t udf_crc(uint8_t *, uint32_t, uint16_t)
Definition: crc.c:88
ICBTAG_FLAG_AD_MASK
#define ICBTAG_FLAG_AD_MASK
Definition: ecma_167.h:525
flags
uint16_t flags
Definition: ecma_167.h:75
FLAG_UNALLOC_TABLE
#define FLAG_UNALLOC_TABLE
Definition: libudffs.h:38
udf_extent::tail
struct udf_desc * tail
Definition: libudffs.h:138
leBPL_to_cpup
#define leBPL_to_cpup(x)
Definition: file.c:600
clear_bits
static void clear_bits(uint8_t *bitmap, uint32_t offset, uint64_t length)
Definition: file.h:37
udf_disc::udf_pvd
struct primaryVolDesc * udf_pvd[2]
Definition: libudffs.h:112
FLAG_UNALLOC_BITMAP
#define FLAG_UNALLOC_BITMAP
Definition: libudffs.h:37
udf_disc::uid
uint32_t uid
Definition: libudffs.h:102
udf_desc::length
uint64_t length
Definition: libudffs.h:148
bitmap
uint8_t bitmap[0]
Definition: ecma_167.h:67
cpu_to_le16
#define cpu_to_le16(x)
Definition: bswap.h:246
file.h
find_desc
struct udf_desc * find_desc(struct udf_extent *, uint32_t)
search the udf_descriptor list of a udf_extent to find the udf_descriptor that describes a particular...
Definition: extent.c:366
uniqueID
uint64_t uniqueID
Definition: ecma_167.h:81
default_fe
struct fileEntry default_fe
Definition: defaults.c:429
unallocSpaceEntry
Definition: ecma_167.h:740
FLAG_FREED_TABLE
#define FLAG_FREED_TABLE
Definition: libudffs.h:36
udf_desc::data
struct udf_data * data
Definition: libudffs.h:149
logicalVolIntegrityDesc::freeSpaceTable
uint32_t freeSpaceTable[0]
Definition: ecma_167.h:369
insert_fid
void insert_fid(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *desc, struct udf_desc *parent, uint8_t *name, uint8_t length, uint8_t filechar)
create a FID and add it to a directory then increment the file link count
Definition: file.c:385
extendedFileEntry::createTime
timestamp createTime
Definition: ecma_167.h:814
udf_data::length
uint64_t length
Definition: libudffs.h:157
extendedFileEntry::lengthAllocDescs
uint32_t lengthAllocDescs
Definition: ecma_167.h:823
fileEntry::fileLinkCount
uint16_t fileLinkCount
Definition: ecma_167.h:565
fileEntry::accessTime
timestamp accessTime
Definition: ecma_167.h:571
TAG_IDENT_FE
#define TAG_IDENT_FE
Definition: ecma_167.h:417
query_tag
tag query_tag(struct udf_disc *disc, struct udf_extent *ext, struct udf_desc *desc, uint16_t SerialNum)
create an on-disc format tag for a udf_descriptor of a udf_extent with any space_type. For type:PSPACE the block number will be relative to to the first block of the partition, otherwise it will be relative to the first block of the media
Definition: file.c:83
FID_FILE_CHAR_DIRECTORY
#define FID_FILE_CHAR_DIRECTORY
Definition: ecma_167.h:475
uintBPL
#define uintBPL
Definition: file.c:603
partitionHeaderDesc
Definition: ecma_167.h:449
udf_data::next
struct udf_data * next
Definition: libudffs.h:159
ICBTAG_FLAG_AD_SHORT
#define ICBTAG_FLAG_AD_SHORT
Definition: ecma_167.h:526
udf_desc::ident
uint16_t ident
Definition: libudffs.h:146
partitionHeaderDesc::freedSpaceBitmap
short_ad freedSpaceBitmap
Definition: ecma_167.h:455
ICBTAG_FLAG_AD_LONG
#define ICBTAG_FLAG_AD_LONG
Definition: ecma_167.h:527
fileIdentDesc::fileVersionNum
uint16_t fileVersionNum
Definition: ecma_167.h:463
udf_data
Definition: libudffs.h:155
extendedFileEntry::objectSize
uint64_t objectSize
Definition: ecma_167.h:810
FLAG_FREED_BITMAP
#define FLAG_FREED_BITMAP
Definition: libudffs.h:35
fileIdentDesc::fileCharacteristics
uint8_t fileCharacteristics
Definition: ecma_167.h:464
udf_find_next_one_bit
static unsigned long udf_find_next_one_bit(void *addr, unsigned long size, unsigned long offset)
find the first one bit in a space bitmap
Definition: file.c:633
udf_alloc_table_blocks
int udf_alloc_table_blocks(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *table, uint32_t start, uint32_t blocks)
allocate a space table on-disc
Definition: file.c:755
alloc_data
struct udf_data * alloc_data(void *, int)
allocate a new udf_data item and initialize it with either allocated zeros or the supplied payload ...
Definition: extent.c:462
udf_disc::sizing
struct udf_sizing sizing[UDF_ALLOC_TYPE_SIZE]
Definition: libudffs.h:105
fileIdentDesc::lengthOfImpUse
uint16_t lengthOfImpUse
Definition: ecma_167.h:467
EXT_NOT_RECORDED_ALLOCATED
#define EXT_NOT_RECORDED_ALLOCATED
Definition: ecma_167.h:773
fileEntry
Definition: ecma_167.h:558
ICBTAG_FILE_TYPE_STREAMDIR
#define ICBTAG_FILE_TYPE_STREAMDIR
Definition: ecma_167.h:522
PSPACE_SIZE
Definition: libudffs.h:91
udf_disc::gid
uint32_t gid
Definition: libudffs.h:103
udf_extent
Definition: libudffs.h:131
extendedFileEntry::logicalBlocksRecorded
uint64_t logicalBlocksRecorded
Definition: ecma_167.h:811
impUse
uint8_t impUse[64]
Definition: ecma_167.h:82
unallocSpaceEntry::allocDescs
uint8_t allocDescs[0]
Definition: ecma_167.h:745
PSPACE
Definition: libudffs.h:71
fileEntry::informationLength
uint64_t informationLength
Definition: ecma_167.h:569
partitionHeaderDesc::unallocSpaceBitmap
short_ad unallocSpaceBitmap
Definition: ecma_167.h:452
allocDescImpUse
Definition: osta_udf.h:204
extendedFileEntry::allocDescs
uint8_t allocDescs[0]
Definition: ecma_167.h:825
fileEntry::lengthAllocDescs
uint32_t lengthAllocDescs
Definition: ecma_167.h:579
udf_extent::start
uint32_t start
Definition: libudffs.h:134
extendedFileEntry::uid
uint32_t uid
Definition: ecma_167.h:802
set_desc
struct udf_desc * set_desc(struct udf_disc *, struct udf_extent *, uint16_t, uint32_t, uint32_t, struct udf_data *)
allocate a new udf_descriptor having a udf_data item and insert it into the udf_descriptor list of a ...
Definition: extent.c:393
query_lvidiu
static struct logicalVolIntegrityDescImpUse * query_lvidiu(struct udf_disc *disc)
Definition: file.h:50
fileEntry::gid
uint32_t gid
Definition: ecma_167.h:563
udf_disc::flags
uint32_t flags
Definition: libudffs.h:100
fileIdentDesc::lengthFileIdent
uint8_t lengthFileIdent
Definition: ecma_167.h:465
udf_alloc_bitmap_blocks
int udf_alloc_bitmap_blocks(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *bitmap, uint32_t start, uint32_t blocks)
allocate an aligned space bitmap on-disc
Definition: file.c:725
extendedFileEntry::modificationTime
timestamp modificationTime
Definition: ecma_167.h:813
udf_desc
Definition: libudffs.h:144
udf_desc::offset
uint32_t offset
Definition: libudffs.h:147
udf_disc
Definition: libudffs.h:95
udf_mkdir
struct udf_desc * udf_mkdir(struct udf_disc *disc, struct udf_extent *pspace, uint8_t *name, uint8_t length, uint32_t offset, struct udf_desc *parent)
create a directory tag:FE/EFE udf_descriptor and add the directory to a parent directory ...
Definition: file.c:587
udf_alloc_blocks
int udf_alloc_blocks(struct udf_disc *disc, struct udf_extent *pspace, uint32_t start, uint32_t blocks)
allocate blocks on-disc
Definition: file.c:814
fileEntry::modificationTime
timestamp modificationTime
Definition: ecma_167.h:572
fileEntry::uniqueID
uint64_t uniqueID
Definition: ecma_167.h:577
default_efe
struct extendedFileEntry default_efe
Definition: defaults.c:462
partitionHeaderDesc::freedSpaceTable
short_ad freedSpaceTable
Definition: ecma_167.h:454
compute_ident_length
uint32_t compute_ident_length(uint32_t length)
helper function to compute tag:FID udf_descriptor size and padding to a multiple of 4 bytes ...
Definition: file.c:368
TAG_IDENT_USE
#define TAG_IDENT_USE
Definition: ecma_167.h:419
udf_find_next_zero_bit
static unsigned long udf_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
find the first zero bit in a space bitmap
Definition: file.c:677
append_data
void append_data(struct udf_desc *, struct udf_data *)
append a udf_data list to the end of the udf_data list of a udf_descriptor and update the udf_descrip...
Definition: extent.c:442
insert_data
void insert_data(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *desc, struct udf_data *data)
append a udf_data list to a (hidden) VAT file ???
Definition: file.c:333
TAG_IDENT_FID
#define TAG_IDENT_FID
Definition: ecma_167.h:413
fileIdentDesc::descTag
tag descTag
Definition: ecma_167.h:462
libudffs.h
ICBTAG_FLAG_AD_IN_ICB
#define ICBTAG_FLAG_AD_IN_ICB
Definition: ecma_167.h:529
udf_disc::blocksize_bits
uint8_t blocksize_bits
Definition: libudffs.h:99
spaceBitmapDesc::numOfBits
uint32_t numOfBits
Definition: ecma_167.h:752
ICBTAG_FILE_TYPE_VAT20
#define ICBTAG_FILE_TYPE_VAT20
Definition: osta_udf.h:183
udf_disc::udf_rev
uint16_t udf_rev
Definition: libudffs.h:97
udf_data::buffer
void * buffer
Definition: libudffs.h:158
cpu_to_le64
#define cpu_to_le64(x)
Definition: bswap.h:248
ICBTAG_FILE_TYPE_DIRECTORY
#define ICBTAG_FILE_TYPE_DIRECTORY
Definition: ecma_167.h:513
extendedFileEntry::gid
uint32_t gid
Definition: ecma_167.h:803
spaceBitmapDesc::bitmap
uint8_t bitmap[0]
Definition: ecma_167.h:754
udf_sizing::align
uint32_t align
Definition: libudffs.h:79
extendedFileEntry::lengthExtendedAttr
uint32_t lengthExtendedAttr
Definition: ecma_167.h:822
FLAG_VAT
#define FLAG_VAT
Definition: libudffs.h:55
extendedFileEntry::uniqueID
uint64_t uniqueID
Definition: ecma_167.h:821
ICBTAG_FILE_TYPE_UNDEF
#define ICBTAG_FILE_TYPE_UNDEF
Definition: ecma_167.h:509
fileEntry::attrTime
timestamp attrTime
Definition: ecma_167.h:573
fileIdentDesc::fileIdent
uint8_t fileIdent[0]
Definition: ecma_167.h:469
fileIdentDesc
Definition: ecma_167.h:460
BITS_PER_LONG
#define BITS_PER_LONG
Definition: file.c:598
udf_extent::space_type
enum udf_space_type space_type
Definition: libudffs.h:133
partitionHeaderDesc::unallocSpaceTable
short_ad unallocSpaceTable
Definition: ecma_167.h:451
numFiles
uint32_t numFiles
Definition: osta_udf.h:162
FLAG_STRATEGY4096
#define FLAG_STRATEGY4096
Definition: libudffs.h:50
spaceBitmapDesc
Definition: ecma_167.h:749
fileEntry::allocDescs
uint8_t allocDescs[0]
Definition: ecma_167.h:581
TAG_IDENT_EFE
#define TAG_IDENT_EFE
Definition: ecma_167.h:422
fileIdentDesc::icb
long_ad icb
Definition: ecma_167.h:466
defaults.h