diff options
Diffstat (limited to 'fs/hfsplus/hfsplus_fs.h')
-rw-r--r-- | fs/hfsplus/hfsplus_fs.h | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index 9889d0033b8f..65c698f78ef7 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h | |||
@@ -157,6 +157,11 @@ struct hfsplus_sb_info { | |||
157 | #define HFSPLUS_SB_HFSX 3 | 157 | #define HFSPLUS_SB_HFSX 3 |
158 | #define HFSPLUS_SB_CASEFOLD 4 | 158 | #define HFSPLUS_SB_CASEFOLD 4 |
159 | 159 | ||
160 | static inline struct hfsplus_sb_info *HFSPLUS_SB(struct super_block *sb) | ||
161 | { | ||
162 | return sb->s_fs_info; | ||
163 | } | ||
164 | |||
160 | 165 | ||
161 | struct hfsplus_inode_info { | 166 | struct hfsplus_inode_info { |
162 | atomic_t opencnt; | 167 | atomic_t opencnt; |
@@ -205,10 +210,31 @@ struct hfsplus_inode_info { | |||
205 | #define HFSPLUS_EXT_NEW 0x0002 | 210 | #define HFSPLUS_EXT_NEW 0x0002 |
206 | 211 | ||
207 | #define HFSPLUS_I_RSRC 0 /* represents a resource fork */ | 212 | #define HFSPLUS_I_RSRC 0 /* represents a resource fork */ |
213 | #define HFSPLUS_I_CAT_DIRTY 1 /* has changes in the catalog tree */ | ||
214 | #define HFSPLUS_I_EXT_DIRTY 2 /* has changes in the extent tree */ | ||
215 | #define HFSPLUS_I_ALLOC_DIRTY 3 /* has changes in the allocation file */ | ||
208 | 216 | ||
209 | #define HFSPLUS_IS_RSRC(inode) \ | 217 | #define HFSPLUS_IS_RSRC(inode) \ |
210 | test_bit(HFSPLUS_I_RSRC, &HFSPLUS_I(inode)->flags) | 218 | test_bit(HFSPLUS_I_RSRC, &HFSPLUS_I(inode)->flags) |
211 | 219 | ||
220 | static inline struct hfsplus_inode_info *HFSPLUS_I(struct inode *inode) | ||
221 | { | ||
222 | return list_entry(inode, struct hfsplus_inode_info, vfs_inode); | ||
223 | } | ||
224 | |||
225 | /* | ||
226 | * Mark an inode dirty, and also mark the btree in which the | ||
227 | * specific type of metadata is stored. | ||
228 | * For data or metadata that gets written back by into the catalog btree | ||
229 | * by hfsplus_write_inode a plain mark_inode_dirty call is enough. | ||
230 | */ | ||
231 | static inline void hfsplus_mark_inode_dirty(struct inode *inode, | ||
232 | unsigned int flag) | ||
233 | { | ||
234 | set_bit(flag, &HFSPLUS_I(inode)->flags); | ||
235 | mark_inode_dirty(inode); | ||
236 | } | ||
237 | |||
212 | struct hfs_find_data { | 238 | struct hfs_find_data { |
213 | /* filled by caller */ | 239 | /* filled by caller */ |
214 | hfsplus_btree_key *search_key; | 240 | hfsplus_btree_key *search_key; |
@@ -397,17 +423,6 @@ int hfs_part_find(struct super_block *, sector_t *, sector_t *); | |||
397 | int hfsplus_submit_bio(struct block_device *bdev, sector_t sector, | 423 | int hfsplus_submit_bio(struct block_device *bdev, sector_t sector, |
398 | void *data, int rw); | 424 | void *data, int rw); |
399 | 425 | ||
400 | /* access macros */ | ||
401 | static inline struct hfsplus_sb_info *HFSPLUS_SB(struct super_block *sb) | ||
402 | { | ||
403 | return sb->s_fs_info; | ||
404 | } | ||
405 | |||
406 | static inline struct hfsplus_inode_info *HFSPLUS_I(struct inode *inode) | ||
407 | { | ||
408 | return list_entry(inode, struct hfsplus_inode_info, vfs_inode); | ||
409 | } | ||
410 | |||
411 | /* time macros */ | 426 | /* time macros */ |
412 | #define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U) | 427 | #define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U) |
413 | #define __hfsp_ut2mt(t) (cpu_to_be32(t + 2082844800U)) | 428 | #define __hfsp_ut2mt(t) (cpu_to_be32(t + 2082844800U)) |