ocfs1_fs_compat.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* -*- mode: c; c-basic-offset: 8; -*-
  3. * vim: noexpandtab sw=8 ts=8 sts=0:
  4. *
  5. * ocfs1_fs_compat.h
  6. *
  7. * OCFS1 volume header definitions. OCFS2 creates valid but unmountable
  8. * OCFS1 volume headers on the first two sectors of an OCFS2 volume.
  9. * This allows an OCFS1 volume to see the partition and cleanly fail to
  10. * mount it.
  11. *
  12. * Copyright (C) 2002, 2004 Oracle. All rights reserved.
  13. */
  14. #ifndef _OCFS1_FS_COMPAT_H
  15. #define _OCFS1_FS_COMPAT_H
  16. #define OCFS1_MAX_VOL_SIGNATURE_LEN 128
  17. #define OCFS1_MAX_MOUNT_POINT_LEN 128
  18. #define OCFS1_MAX_VOL_ID_LENGTH 16
  19. #define OCFS1_MAX_VOL_LABEL_LEN 64
  20. #define OCFS1_MAX_CLUSTER_NAME_LEN 64
  21. #define OCFS1_MAJOR_VERSION (2)
  22. #define OCFS1_MINOR_VERSION (0)
  23. #define OCFS1_VOLUME_SIGNATURE "OracleCFS"
  24. /*
  25. * OCFS1 superblock. Lives at sector 0.
  26. */
  27. struct ocfs1_vol_disk_hdr
  28. {
  29. /*00*/ __u32 minor_version;
  30. __u32 major_version;
  31. /*08*/ __u8 signature[OCFS1_MAX_VOL_SIGNATURE_LEN];
  32. /*88*/ __u8 mount_point[OCFS1_MAX_MOUNT_POINT_LEN];
  33. /*108*/ __u64 serial_num;
  34. /*110*/ __u64 device_size;
  35. __u64 start_off;
  36. /*120*/ __u64 bitmap_off;
  37. __u64 publ_off;
  38. /*130*/ __u64 vote_off;
  39. __u64 root_bitmap_off;
  40. /*140*/ __u64 data_start_off;
  41. __u64 root_bitmap_size;
  42. /*150*/ __u64 root_off;
  43. __u64 root_size;
  44. /*160*/ __u64 cluster_size;
  45. __u64 num_nodes;
  46. /*170*/ __u64 num_clusters;
  47. __u64 dir_node_size;
  48. /*180*/ __u64 file_node_size;
  49. __u64 internal_off;
  50. /*190*/ __u64 node_cfg_off;
  51. __u64 node_cfg_size;
  52. /*1A0*/ __u64 new_cfg_off;
  53. __u32 prot_bits;
  54. __s32 excl_mount;
  55. /*1B0*/
  56. };
  57. struct ocfs1_disk_lock
  58. {
  59. /*00*/ __u32 curr_master;
  60. __u8 file_lock;
  61. __u8 compat_pad[3]; /* Not in original definition. Used to
  62. make the already existing alignment
  63. explicit */
  64. __u64 last_write_time;
  65. /*10*/ __u64 last_read_time;
  66. __u32 writer_node_num;
  67. __u32 reader_node_num;
  68. /*20*/ __u64 oin_node_map;
  69. __u64 dlock_seq_num;
  70. /*30*/
  71. };
  72. /*
  73. * OCFS1 volume label. Lives at sector 1.
  74. */
  75. struct ocfs1_vol_label
  76. {
  77. /*00*/ struct ocfs1_disk_lock disk_lock;
  78. /*30*/ __u8 label[OCFS1_MAX_VOL_LABEL_LEN];
  79. /*70*/ __u16 label_len;
  80. /*72*/ __u8 vol_id[OCFS1_MAX_VOL_ID_LENGTH];
  81. /*82*/ __u16 vol_id_len;
  82. /*84*/ __u8 cluster_name[OCFS1_MAX_CLUSTER_NAME_LEN];
  83. /*A4*/ __u16 cluster_name_len;
  84. /*A6*/
  85. };
  86. #endif /* _OCFS1_FS_COMPAT_H */