source: mainline/uspace/srv/fs/udf/udf.h@ 901b302

ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 901b302 was c477c80, checked in by Jiri Svoboda <jiri@…>, 6 years ago

Fix some common misspellings

  • 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 udf
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 <stddef.h>
40#include <stdint.h>
41#include <stdbool.h>
42#include "../../vfs/vfs.h"
43#include "udf_types.h"
44#include <adt/hash_table.h>
45
46#define UDF_NODE(node) \
47 ((node) ? (udf_node_t *) (node)->data : NULL)
48
49#define FS_NODE(node) \
50 ((node) ? (fs_node_t *) ((node)->fs_node) : NULL)
51
52#define BS_BLOCK 0
53#define MIN_SIZE 512
54#define MAX_SIZE 8192
55#define DEFAULT_VOL 0
56
57#define NODE_DIR 0
58#define NODE_FILE 1
59
60#define MAX_FILE_NAME_LEN 512
61
62#define MIN_FID_LEN 38
63
64#define SPACE_TABLE 0
65#define SPACE_BITMAP 1
66
67typedef struct udf_partition {
68 /* Partition info */
69 uint16_t number;
70 uint32_t access_type;
71 uint32_t start;
72 uint32_t length;
73} udf_partition_t;
74
75typedef struct udf_lvolume {
76 udf_partition_t **partitions;
77 size_t partition_cnt;
78 uint32_t logical_block_size;
79 fs_index_t root_dir;
80} udf_lvolume_t;
81
82typedef struct {
83 service_id_t service_id;
84 size_t open_nodes_count;
85 udf_charspec_t charset;
86
87 uint32_t sector_size;
88 udf_lvolume_t *volumes;
89 udf_partition_t *partitions;
90 size_t partition_cnt;
91 udf_unallocated_space_descriptor_t *uasd;
92 uint64_t uaspace_start;
93 uint64_t uaspace_length;
94 uint8_t space_type;
95} udf_instance_t;
96
97typedef struct udf_allocator {
98 uint32_t length;
99 uint32_t position;
100} udf_allocator_t;
101
102typedef struct udf_node {
103 udf_instance_t *instance;
104 fs_node_t *fs_node;
105 fibril_mutex_t lock;
106
107 fs_index_t index; /* FID logical block */
108 ht_link_t link;
109 size_t ref_cnt;
110 size_t link_cnt;
111
112 uint8_t type; /* 1 - file, 0 - directory */
113 uint64_t data_size;
114 uint8_t *data;
115 udf_allocator_t *allocators;
116 size_t alloc_size;
117} udf_node_t;
118
119extern vfs_out_ops_t udf_ops;
120extern libfs_ops_t udf_libfs_ops;
121
122#endif
123
124/**
125 * @}
126 */
Note: See TracBrowser for help on using the repository browser.