source: mainline/uspace/srv/fs/udf/udf.h@ 3061bc1

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 3061bc1 was 8d2dd7f2, checked in by Jakub Jermar <jakub@…>, 8 years ago

Reduce the number of files that include <sys/types.h>

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 * Copyright (c) 2008 Jakub Jermar
3 * Copyright (c) 2012 Julia Medvedeva
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/** @addtogroup fs
31 * @{
32 */
33
34#ifndef UDF_UDF_H_
35#define UDF_UDF_H_
36
37#include <fibril_synch.h>
38#include <libfs.h>
39#include <atomic.h>
40#include <stddef.h>
41#include <stdint.h>
42#include <stdbool.h>
43#include "../../vfs/vfs.h"
44#include "udf_types.h"
45#include <adt/hash_table.h>
46
47#define UDF_NODE(node) \
48 ((node) ? (udf_node_t *) (node)->data : NULL)
49
50#define FS_NODE(node) \
51 ((node) ? (fs_node_t *) ((node)->fs_node) : NULL)
52
53#define BS_BLOCK 0
54#define MIN_SIZE 512
55#define MAX_SIZE 8192
56#define DEFAULT_VOL 0
57
58#define NODE_DIR 0
59#define NODE_FILE 1
60
61#define MAX_FILE_NAME_LEN 512
62
63#define MIN_FID_LEN 38
64
65#define SPACE_TABLE 0
66#define SPACE_BITMAP 1
67
68typedef struct udf_partition {
69 /* Partition info */
70 uint16_t number;
71 uint32_t access_type;
72 uint32_t start;
73 uint32_t lenght;
74} udf_partition_t;
75
76typedef struct udf_lvolume {
77 udf_partition_t **partitions;
78 size_t partition_cnt;
79 uint32_t logical_block_size;
80 fs_index_t root_dir;
81} udf_lvolume_t;
82
83typedef struct {
84 service_id_t service_id;
85 size_t open_nodes_count;
86 udf_charspec_t charset;
87
88 uint32_t sector_size;
89 udf_lvolume_t *volumes;
90 udf_partition_t *partitions;
91 size_t partition_cnt;
92 udf_unallocated_space_descriptor_t *uasd;
93 uint64_t uaspace_start;
94 uint64_t uaspace_lenght;
95 uint8_t space_type;
96} udf_instance_t;
97
98typedef struct udf_allocator {
99 uint32_t length;
100 uint32_t position;
101} udf_allocator_t;
102
103typedef struct udf_node {
104 udf_instance_t *instance;
105 fs_node_t *fs_node;
106 fibril_mutex_t lock;
107
108 fs_index_t index; /* FID logical block */
109 ht_link_t link;
110 size_t ref_cnt;
111 size_t link_cnt;
112
113 uint8_t type; /* 1 - file, 0 - directory */
114 uint64_t data_size;
115 uint8_t *data;
116 udf_allocator_t *allocators;
117 size_t alloc_size;
118} udf_node_t;
119
120extern vfs_out_ops_t udf_ops;
121extern libfs_ops_t udf_libfs_ops;
122
123#endif
124
125/**
126 * @}
127 */
Note: See TracBrowser for help on using the repository browser.