hfsplus_fs.h (239060b93bb30a4ad55f1ecaa512464a035cc5ba) hfsplus_fs.h (f6089ff87d309a8ddb7b0d4dd92a570f1b0f689b)
1/*
2 * linux/include/linux/hfsplus_fs.h
3 *
4 * Copyright (C) 1999
5 * Brad Boyer (flar@pants.nu)
6 * (C) 2003 Ardis Technologies <roman@ardistech.com>
7 *
8 */

--- 48 unchanged lines hidden (view full) ---

57 u32 attributes;
58
59 unsigned int node_size;
60 unsigned int node_size_shift;
61 unsigned int max_key_len;
62 unsigned int depth;
63
64 //unsigned int map1_size, map_size;
1/*
2 * linux/include/linux/hfsplus_fs.h
3 *
4 * Copyright (C) 1999
5 * Brad Boyer (flar@pants.nu)
6 * (C) 2003 Ardis Technologies <roman@ardistech.com>
7 *
8 */

--- 48 unchanged lines hidden (view full) ---

57 u32 attributes;
58
59 unsigned int node_size;
60 unsigned int node_size_shift;
61 unsigned int max_key_len;
62 unsigned int depth;
63
64 //unsigned int map1_size, map_size;
65 struct semaphore tree_lock;
65 struct mutex tree_lock;
66
67 unsigned int pages_per_bnode;
68 spinlock_t hash_lock;
69 struct hfs_bnode *node_hash[NODE_HASH_SIZE];
70 int node_hash_cnt;
71};
72
73struct page;

--- 42 unchanged lines hidden (view full) ---

116 struct inode *hidden_dir;
117 struct nls_table *nls;
118
119 /* Runtime variables */
120 u32 blockoffset;
121 u32 sect_count;
122 int fs_shift;
123
66
67 unsigned int pages_per_bnode;
68 spinlock_t hash_lock;
69 struct hfs_bnode *node_hash[NODE_HASH_SIZE];
70 int node_hash_cnt;
71};
72
73struct page;

--- 42 unchanged lines hidden (view full) ---

116 struct inode *hidden_dir;
117 struct nls_table *nls;
118
119 /* Runtime variables */
120 u32 blockoffset;
121 u32 sect_count;
122 int fs_shift;
123
124 /* Stuff in host order from Vol Header */
124 /* immutable data from the volume header */
125 u32 alloc_blksz;
126 int alloc_blksz_shift;
127 u32 total_blocks;
125 u32 alloc_blksz;
126 int alloc_blksz_shift;
127 u32 total_blocks;
128 u32 data_clump_blocks, rsrc_clump_blocks;
129
130 /* mutable data from the volume header, protected by alloc_mutex */
128 u32 free_blocks;
131 u32 free_blocks;
129 u32 next_alloc;
132 struct mutex alloc_mutex;
133
134 /* mutable data from the volume header, protected by vh_mutex */
130 u32 next_cnid;
131 u32 file_count;
132 u32 folder_count;
135 u32 next_cnid;
136 u32 file_count;
137 u32 folder_count;
133 u32 data_clump_blocks, rsrc_clump_blocks;
138 struct mutex vh_mutex;
134
135 /* Config options */
136 u32 creator;
137 u32 type;
138
139 umode_t umask;
140 uid_t uid;
141 gid_t gid;
142
143 int part, session;
144
145 unsigned long flags;
139
140 /* Config options */
141 u32 creator;
142 u32 type;
143
144 umode_t umask;
145 uid_t uid;
146 gid_t gid;
147
148 int part, session;
149
150 unsigned long flags;
146
147 struct hlist_head rsrc_inodes;
148};
149
151};
152
150#define HFSPLUS_SB_WRITEBACKUP 0x0001
151#define HFSPLUS_SB_NODECOMPOSE 0x0002
152#define HFSPLUS_SB_FORCE 0x0004
153#define HFSPLUS_SB_HFSX 0x0008
154#define HFSPLUS_SB_CASEFOLD 0x0010
153#define HFSPLUS_SB_WRITEBACKUP 0
154#define HFSPLUS_SB_NODECOMPOSE 1
155#define HFSPLUS_SB_FORCE 2
156#define HFSPLUS_SB_HFSX 3
157#define HFSPLUS_SB_CASEFOLD 4
155
156
157struct hfsplus_inode_info {
158
159
160struct hfsplus_inode_info {
158 struct mutex extents_lock;
159 u32 clump_blocks, alloc_blocks;
160 sector_t fs_blocks;
161 /* Allocation extents from catalog record or volume header */
162 hfsplus_extent_rec first_extents;
163 u32 first_blocks;
164 hfsplus_extent_rec cached_extents;
165 u32 cached_start, cached_blocks;
166 atomic_t opencnt;
167
161 atomic_t opencnt;
162
168 struct inode *rsrc_inode;
163 /*
164 * Extent allocation information, protected by extents_lock.
165 */
166 u32 first_blocks;
167 u32 clump_blocks;
168 u32 alloc_blocks;
169 u32 cached_start;
170 u32 cached_blocks;
171 hfsplus_extent_rec first_extents;
172 hfsplus_extent_rec cached_extents;
169 unsigned long flags;
173 unsigned long flags;
174 struct mutex extents_lock;
170
175
176 /*
177 * Immutable data.
178 */
179 struct inode *rsrc_inode;
171 __be32 create_date;
180 __be32 create_date;
172 /* Device number in hfsplus_permissions in catalog */
173 u32 dev;
174 /* BSD system and user file flags */
175 u8 rootflags;
176 u8 userflags;
177
181
182 /*
183 * Protected by sbi->vh_mutex.
184 */
185 u32 linkid;
186
187 /*
188 * Protected by i_mutex.
189 */
190 sector_t fs_blocks;
191 u8 rootflags, userflags; /* BSD system and user file flags */
178 struct list_head open_dir_list;
179 loff_t phys_size;
192 struct list_head open_dir_list;
193 loff_t phys_size;
194
180 struct inode vfs_inode;
181};
182
183#define HFSPLUS_FLG_RSRC 0x0001
184#define HFSPLUS_FLG_EXT_DIRTY 0x0002
185#define HFSPLUS_FLG_EXT_NEW 0x0004
186
195 struct inode vfs_inode;
196};
197
198#define HFSPLUS_FLG_RSRC 0x0001
199#define HFSPLUS_FLG_EXT_DIRTY 0x0002
200#define HFSPLUS_FLG_EXT_NEW 0x0004
201
187#define HFSPLUS_IS_DATA(inode) (!(HFSPLUS_I(inode).flags & HFSPLUS_FLG_RSRC))
188#define HFSPLUS_IS_RSRC(inode) (HFSPLUS_I(inode).flags & HFSPLUS_FLG_RSRC)
202#define HFSPLUS_IS_DATA(inode) (!(HFSPLUS_I(inode)->flags & HFSPLUS_FLG_RSRC))
203#define HFSPLUS_IS_RSRC(inode) (HFSPLUS_I(inode)->flags & HFSPLUS_FLG_RSRC)
189
190struct hfs_find_data {
191 /* filled by caller */
192 hfsplus_btree_key *search_key;
193 hfsplus_btree_key *key;
194 /* filled by find */
195 struct hfs_btree *tree;
196 struct hfs_bnode *bnode;

--- 170 unchanged lines hidden (view full) ---

367int hfsplus_compare_dentry(struct dentry *dentry, struct qstr *s1, struct qstr *s2);
368
369/* wrapper.c */
370int hfsplus_read_wrapper(struct super_block *);
371
372int hfs_part_find(struct super_block *, sector_t *, sector_t *);
373
374/* access macros */
204
205struct hfs_find_data {
206 /* filled by caller */
207 hfsplus_btree_key *search_key;
208 hfsplus_btree_key *key;
209 /* filled by find */
210 struct hfs_btree *tree;
211 struct hfs_bnode *bnode;

--- 170 unchanged lines hidden (view full) ---

382int hfsplus_compare_dentry(struct dentry *dentry, struct qstr *s1, struct qstr *s2);
383
384/* wrapper.c */
385int hfsplus_read_wrapper(struct super_block *);
386
387int hfs_part_find(struct super_block *, sector_t *, sector_t *);
388
389/* access macros */
375/*
376static inline struct hfsplus_sb_info *HFSPLUS_SB(struct super_block *sb)
377{
378 return sb->s_fs_info;
379}
390static inline struct hfsplus_sb_info *HFSPLUS_SB(struct super_block *sb)
391{
392 return sb->s_fs_info;
393}
394
380static inline struct hfsplus_inode_info *HFSPLUS_I(struct inode *inode)
381{
382 return list_entry(inode, struct hfsplus_inode_info, vfs_inode);
383}
395static inline struct hfsplus_inode_info *HFSPLUS_I(struct inode *inode)
396{
397 return list_entry(inode, struct hfsplus_inode_info, vfs_inode);
398}
384*/
385#define HFSPLUS_SB(super) (*(struct hfsplus_sb_info *)(super)->s_fs_info)
386#define HFSPLUS_I(inode) (*list_entry(inode, struct hfsplus_inode_info, vfs_inode))
387
388#if 1
389#define hfsplus_kmap(p) ({ struct page *__p = (p); kmap(__p); })
390#define hfsplus_kunmap(p) ({ struct page *__p = (p); kunmap(__p); __p; })
391#else
392#define hfsplus_kmap(p) kmap(p)
393#define hfsplus_kunmap(p) kunmap(p)
394#endif

--- 19 unchanged lines hidden (view full) ---

414#define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U)
415#define __hfsp_ut2mt(t) (cpu_to_be32(t + 2082844800U))
416
417/* compatibility */
418#define hfsp_mt2ut(t) (struct timespec){ .tv_sec = __hfsp_mt2ut(t) }
419#define hfsp_ut2mt(t) __hfsp_ut2mt((t).tv_sec)
420#define hfsp_now2mt() __hfsp_ut2mt(get_seconds())
421
399
400#if 1
401#define hfsplus_kmap(p) ({ struct page *__p = (p); kmap(__p); })
402#define hfsplus_kunmap(p) ({ struct page *__p = (p); kunmap(__p); __p; })
403#else
404#define hfsplus_kmap(p) kmap(p)
405#define hfsplus_kunmap(p) kunmap(p)
406#endif

--- 19 unchanged lines hidden (view full) ---

426#define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U)
427#define __hfsp_ut2mt(t) (cpu_to_be32(t + 2082844800U))
428
429/* compatibility */
430#define hfsp_mt2ut(t) (struct timespec){ .tv_sec = __hfsp_mt2ut(t) }
431#define hfsp_ut2mt(t) __hfsp_ut2mt((t).tv_sec)
432#define hfsp_now2mt() __hfsp_ut2mt(get_seconds())
433
422#define kdev_t_to_nr(x) (x)
423
424#endif
434#endif