ext4_fs_sb.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * linux/include/linux/ext4_fs_sb.h
  3. *
  4. * Copyright (C) 1992, 1993, 1994, 1995
  5. * Remy Card (card@masi.ibp.fr)
  6. * Laboratoire MASI - Institut Blaise Pascal
  7. * Universite Pierre et Marie Curie (Paris VI)
  8. *
  9. * from
  10. *
  11. * linux/include/linux/minix_fs_sb.h
  12. *
  13. * Copyright (C) 1991, 1992 Linus Torvalds
  14. */
  15. #ifndef _LINUX_EXT4_FS_SB
  16. #define _LINUX_EXT4_FS_SB
  17. #ifdef __KERNEL__
  18. #include <linux/timer.h>
  19. #include <linux/wait.h>
  20. #include <linux/blockgroup_lock.h>
  21. #include <linux/percpu_counter.h>
  22. #endif
  23. #include <linux/rbtree.h>
  24. /*
  25. * third extended-fs super-block data in memory
  26. */
  27. struct ext4_sb_info {
  28. unsigned long s_frag_size; /* Size of a fragment in bytes */
  29. unsigned long s_desc_size; /* Size of a group descriptor in bytes */
  30. unsigned long s_frags_per_block;/* Number of fragments per block */
  31. unsigned long s_inodes_per_block;/* Number of inodes per block */
  32. unsigned long s_frags_per_group;/* Number of fragments in a group */
  33. unsigned long s_blocks_per_group;/* Number of blocks in a group */
  34. unsigned long s_inodes_per_group;/* Number of inodes in a group */
  35. unsigned long s_itb_per_group; /* Number of inode table blocks per group */
  36. unsigned long s_gdb_count; /* Number of group descriptor blocks */
  37. unsigned long s_desc_per_block; /* Number of group descriptors per block */
  38. unsigned long s_groups_count; /* Number of groups in the fs */
  39. struct buffer_head * s_sbh; /* Buffer containing the super block */
  40. struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */
  41. struct buffer_head ** s_group_desc;
  42. unsigned long s_mount_opt;
  43. uid_t s_resuid;
  44. gid_t s_resgid;
  45. unsigned short s_mount_state;
  46. unsigned short s_pad;
  47. int s_addr_per_block_bits;
  48. int s_desc_per_block_bits;
  49. int s_inode_size;
  50. int s_first_ino;
  51. spinlock_t s_next_gen_lock;
  52. u32 s_next_generation;
  53. u32 s_hash_seed[4];
  54. int s_def_hash_version;
  55. struct percpu_counter s_freeblocks_counter;
  56. struct percpu_counter s_freeinodes_counter;
  57. struct percpu_counter s_dirs_counter;
  58. struct blockgroup_lock s_blockgroup_lock;
  59. /* root of the per fs reservation window tree */
  60. spinlock_t s_rsv_window_lock;
  61. struct rb_root s_rsv_window_root;
  62. struct ext4_reserve_window_node s_rsv_window_head;
  63. /* Journaling */
  64. struct inode * s_journal_inode;
  65. struct journal_s * s_journal;
  66. struct list_head s_orphan;
  67. unsigned long s_commit_interval;
  68. struct block_device *journal_bdev;
  69. #ifdef CONFIG_JBD_DEBUG
  70. struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
  71. wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
  72. #endif
  73. #ifdef CONFIG_QUOTA
  74. char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
  75. int s_jquota_fmt; /* Format of quota to use */
  76. #endif
  77. #ifdef EXTENTS_STATS
  78. /* ext4 extents stats */
  79. unsigned long s_ext_min;
  80. unsigned long s_ext_max;
  81. unsigned long s_depth_max;
  82. spinlock_t s_ext_stats_lock;
  83. unsigned long s_ext_blocks;
  84. unsigned long s_ext_extents;
  85. #endif
  86. };
  87. #endif /* _LINUX_EXT4_FS_SB */