udf_i.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _UDF_I_H
  2. #define _UDF_I_H
  3. struct extent_position {
  4. struct buffer_head *bh;
  5. uint32_t offset;
  6. struct kernel_lb_addr block;
  7. };
  8. struct udf_ext_cache {
  9. /* Extent position */
  10. struct extent_position epos;
  11. /* Start logical offset in bytes */
  12. loff_t lstart;
  13. };
  14. /*
  15. * The i_data_sem and i_mutex serve for protection of allocation information
  16. * of a regular files and symlinks. This includes all extents belonging to
  17. * the file/symlink, a fact whether data are in-inode or in external data
  18. * blocks, preallocation, goal block information... When extents are read,
  19. * i_mutex or i_data_sem must be held (for reading is enough in case of
  20. * i_data_sem). When extents are changed, i_data_sem must be held for writing
  21. * and also i_mutex must be held.
  22. *
  23. * For directories i_mutex is used for all the necessary protection.
  24. */
  25. struct udf_inode_info {
  26. struct timespec i_crtime;
  27. /* Physical address of inode */
  28. struct kernel_lb_addr i_location;
  29. __u64 i_unique;
  30. __u32 i_lenEAttr;
  31. __u32 i_lenAlloc;
  32. __u64 i_lenExtents;
  33. __u32 i_next_alloc_block;
  34. __u32 i_next_alloc_goal;
  35. __u32 i_checkpoint;
  36. unsigned i_alloc_type : 3;
  37. unsigned i_efe : 1; /* extendedFileEntry */
  38. unsigned i_use : 1; /* unallocSpaceEntry */
  39. unsigned i_strat4096 : 1;
  40. unsigned reserved : 26;
  41. union {
  42. struct short_ad *i_sad;
  43. struct long_ad *i_lad;
  44. __u8 *i_data;
  45. } i_ext;
  46. struct rw_semaphore i_data_sem;
  47. struct udf_ext_cache cached_extent;
  48. /* Spinlock for protecting extent cache */
  49. spinlock_t i_extent_cache_lock;
  50. struct inode vfs_inode;
  51. };
  52. static inline struct udf_inode_info *UDF_I(struct inode *inode)
  53. {
  54. return container_of(inode, struct udf_inode_info, vfs_inode);
  55. }
  56. #endif /* _UDF_I_H) */