udf_i.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. __u32 i_checkpoint;
  25. unsigned i_alloc_type : 3;
  26. unsigned i_efe : 1; /* extendedFileEntry */
  27. unsigned i_use : 1; /* unallocSpaceEntry */
  28. unsigned i_strat4096 : 1;
  29. unsigned reserved : 26;
  30. union {
  31. struct short_ad *i_sad;
  32. struct long_ad *i_lad;
  33. __u8 *i_data;
  34. } i_ext;
  35. struct rw_semaphore i_data_sem;
  36. struct inode vfs_inode;
  37. };
  38. static inline struct udf_inode_info *UDF_I(struct inode *inode)
  39. {
  40. return list_entry(inode, struct udf_inode_info, vfs_inode);
  41. }
  42. #endif /* _UDF_I_H) */