1. const struct file_operations ext4_file_operations = {
    2. .llseek = ext4_llseek,
    3. .read_iter = ext4_file_read_iter,
    4. .write_iter = ext4_file_write_iter,
    5. .unlocked_ioctl = ext4_ioctl,
    6. #ifdef CONFIG_COMPAT
    7. .compat_ioctl = ext4_compat_ioctl,
    8. #endif
    9. .mmap = ext4_file_mmap,
    10. .mmap_supported_flags = MAP_SYNC,
    11. .open = ext4_file_open,
    12. .release = ext4_release_file,
    13. .fsync = ext4_sync_file,
    14. .get_unmapped_area = thp_get_unmapped_area,
    15. .splice_read = generic_file_splice_read,
    16. .splice_write = iter_file_splice_write,
    17. .fallocate = ext4_fallocate,
    18. };
    19. const struct inode_operations ext4_file_inode_operations = {
    20. .setattr = ext4_setattr,
    21. .getattr = ext4_file_getattr,
    22. .listxattr = ext4_listxattr,
    23. .get_acl = ext4_get_acl,
    24. .set_acl = ext4_set_acl,
    25. .fiemap = ext4_fiemap,
    26. };
    27. struct ext4_inode {
    28. __le16 i_mode; /* File mode */
    29. __le16 i_uid; /* Low 16 bits of Owner Uid */
    30. __le32 i_size_lo; /* Size in bytes */
    31. __le32 i_atime; /* Access time */
    32. __le32 i_ctime; /* Inode Change time */
    33. __le32 i_mtime; /* Modification time */
    34. __le32 i_dtime; /* Deletion Time */
    35. __le16 i_gid; /* Low 16 bits of Group Id */
    36. __le16 i_links_count; /* Links count */
    37. __le32 i_blocks_lo; /* Blocks count */
    38. __le32 i_flags; /* File flags */
    39. union {
    40. struct {
    41. __le32 l_i_version;
    42. } linux1;
    43. struct {
    44. __u32 h_i_translator;
    45. } hurd1;
    46. struct {
    47. __u32 m_i_reserved1;
    48. } masix1;
    49. } osd1; /* OS dependent 1 */
    50. __le32 i_block[EXT4_N_BLOCKS];/* Pointers to blocks */
    51. __le32 i_generation; /* File version (for NFS) */
    52. __le32 i_file_acl_lo; /* File ACL */
    53. __le32 i_size_high;
    54. __le32 i_obso_faddr; /* Obsoleted fragment address */
    55. union {
    56. struct {
    57. __le16 l_i_blocks_high; /* were l_i_reserved1 */
    58. __le16 l_i_file_acl_high;
    59. __le16 l_i_uid_high; /* these 2 fields */
    60. __le16 l_i_gid_high; /* were reserved2[0] */
    61. __le16 l_i_checksum_lo;/* crc32c(uuid+inum+inode) LE */
    62. __le16 l_i_reserved;
    63. } linux2;
    64. struct {
    65. __le16 h_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
    66. __u16 h_i_mode_high;
    67. __u16 h_i_uid_high;
    68. __u16 h_i_gid_high;
    69. __u32 h_i_author;
    70. } hurd2;
    71. struct {
    72. __le16 h_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
    73. __le16 m_i_file_acl_high;
    74. __u32 m_i_reserved2[2];
    75. } masix2;
    76. } osd2; /* OS dependent 2 */
    77. __le16 i_extra_isize;
    78. __le16 i_checksum_hi; /* crc32c(uuid+inum+inode) BE */
    79. __le32 i_ctime_extra; /* extra Change time (nsec << 2 | epoch) */
    80. __le32 i_mtime_extra; /* extra Modification time(nsec << 2 | epoch) */
    81. __le32 i_atime_extra; /* extra Access time (nsec << 2 | epoch) */
    82. __le32 i_crtime; /* File Creation time */
    83. __le32 i_crtime_extra; /* extra FileCreationtime (nsec << 2 | epoch) */
    84. __le32 i_version_hi; /* high 32 bits for 64-bit version */
    85. __le32 i_projid; /* Project ID */
    86. };