qnx4_fs.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Name : qnx4_fs.h
  4. * Author : Richard Frowijn
  5. * Function : qnx4 global filesystem definitions
  6. * History : 23-03-1998 created
  7. */
  8. #ifndef _LINUX_QNX4_FS_H
  9. #define _LINUX_QNX4_FS_H
  10. #include <linux/types.h>
  11. #include <linux/qnxtypes.h>
  12. #include <linux/magic.h>
  13. #define QNX4_ROOT_INO 1
  14. #define QNX4_MAX_XTNTS_PER_XBLK 60
  15. /* for di_status */
  16. #define QNX4_FILE_USED 0x01
  17. #define QNX4_FILE_MODIFIED 0x02
  18. #define QNX4_FILE_BUSY 0x04
  19. #define QNX4_FILE_LINK 0x08
  20. #define QNX4_FILE_INODE 0x10
  21. #define QNX4_FILE_FSYSCLEAN 0x20
  22. #define QNX4_I_MAP_SLOTS 8
  23. #define QNX4_Z_MAP_SLOTS 64
  24. #define QNX4_VALID_FS 0x0001 /* Clean fs. */
  25. #define QNX4_ERROR_FS 0x0002 /* fs has errors. */
  26. #define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */
  27. #define QNX4_BLOCK_SIZE_BITS 9 /* blocksize shift */
  28. #define QNX4_DIR_ENTRY_SIZE 0x040 /* dir entry size of 64 bytes */
  29. #define QNX4_DIR_ENTRY_SIZE_BITS 6 /* dir entry size shift */
  30. #define QNX4_XBLK_ENTRY_SIZE 0x200 /* xblk entry size */
  31. #define QNX4_INODES_PER_BLOCK 0x08 /* 512 / 64 */
  32. /* for filenames */
  33. #define QNX4_SHORT_NAME_MAX 16
  34. #define QNX4_NAME_MAX 48
  35. /*
  36. * This is the original qnx4 inode layout on disk.
  37. */
  38. struct qnx4_inode_entry {
  39. char di_fname[QNX4_SHORT_NAME_MAX];
  40. qnx4_off_t di_size;
  41. qnx4_xtnt_t di_first_xtnt;
  42. __le32 di_xblk;
  43. __le32 di_ftime;
  44. __le32 di_mtime;
  45. __le32 di_atime;
  46. __le32 di_ctime;
  47. qnx4_nxtnt_t di_num_xtnts;
  48. qnx4_mode_t di_mode;
  49. qnx4_muid_t di_uid;
  50. qnx4_mgid_t di_gid;
  51. qnx4_nlink_t di_nlink;
  52. __u8 di_zero[4];
  53. qnx4_ftype_t di_type;
  54. __u8 di_status;
  55. };
  56. struct qnx4_link_info {
  57. char dl_fname[QNX4_NAME_MAX];
  58. __le32 dl_inode_blk;
  59. __u8 dl_inode_ndx;
  60. __u8 dl_spare[10];
  61. __u8 dl_status;
  62. };
  63. struct qnx4_xblk {
  64. __le32 xblk_next_xblk;
  65. __le32 xblk_prev_xblk;
  66. __u8 xblk_num_xtnts;
  67. __u8 xblk_spare[3];
  68. __le32 xblk_num_blocks;
  69. qnx4_xtnt_t xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK];
  70. char xblk_signature[8];
  71. qnx4_xtnt_t xblk_first_xtnt;
  72. };
  73. struct qnx4_super_block {
  74. struct qnx4_inode_entry RootDir;
  75. struct qnx4_inode_entry Inode;
  76. struct qnx4_inode_entry Boot;
  77. struct qnx4_inode_entry AltBoot;
  78. };
  79. #endif