udf_i.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _UDF_I_H
  2. #define _UDF_I_H
  3. /*
  4. * The i_data_sem and i_mutex serve for protection of allocation information
  5. * of a regular files and symlinks. This includes all extents belonging to
  6. * the file/symlink, a fact whether data are in-inode or in external data
  7. * blocks, preallocation, goal block information... When extents are read,
  8. * i_mutex or i_data_sem must be held (for reading is enough in case of
  9. * i_data_sem). When extents are changed, i_data_sem must be held for writing
  10. * and also i_mutex must be held.
  11. *
  12. * For directories i_mutex is used for all the necessary protection.
  13. */
  14. struct udf_inode_info {
  15. struct timespec i_crtime;
  16. /* Physical address of inode */
  17. struct kernel_lb_addr i_location;
  18. __u64 i_unique;
  19. __u32 i_lenEAttr;
  20. __u32 i_lenAlloc;
  21. __u64 i_lenExtents;
  22. __u32 i_next_alloc_block;
  23. __u32 i_next_alloc_goal;
  24. unsigned i_alloc_type : 3;
  25. unsigned i_efe : 1; /* extendedFileEntry */
  26. unsigned i_use : 1; /* unallocSpaceEntry */
  27. unsigned i_strat4096 : 1;
  28. unsigned reserved : 26;
  29. union {
  30. struct short_ad *i_sad;
  31. struct long_ad *i_lad;
  32. __u8 *i_data;
  33. } i_ext;
  34. struct rw_semaphore i_data_sem;
  35. struct inode vfs_inode;
  36. };
  37. static inline struct udf_inode_info *UDF_I(struct inode *inode)
  38. {
  39. return list_entry(inode, struct udf_inode_info, vfs_inode);
  40. }
  41. #endif /* _UDF_I_H) */