/filesystems/unixfs/common/linux/kernel/include/linux/ext2_fs_sb.h

http://macfuse.googlecode.com/ · C++ Header · 111 lines · 64 code · 12 blank · 35 comment · 0 complexity · a457a67c98f0199d6326093facac0515 MD5 · raw file

  1. /*
  2. * linux/include/linux/ext2_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_EXT2_FS_SB
  16. #define _LINUX_EXT2_FS_SB
  17. #include <linux/blockgroup_lock.h>
  18. #include <linux/percpu_counter.h>
  19. #include <linux/rbtree.h>
  20. /* XXX Here for now... not interested in restructing headers JUST now */
  21. /* data type for block offset of block group */
  22. typedef int ext2_grpblk_t;
  23. /* data type for filesystem-wide blocks number */
  24. typedef unsigned long ext2_fsblk_t;
  25. #define E2FSBLK "%lu"
  26. struct ext2_reserve_window {
  27. ext2_fsblk_t _rsv_start; /* First byte reserved */
  28. ext2_fsblk_t _rsv_end; /* Last byte reserved or 0 */
  29. };
  30. struct ext2_reserve_window_node {
  31. struct rb_node rsv_node;
  32. __u32 rsv_goal_size;
  33. __u32 rsv_alloc_hit;
  34. struct ext2_reserve_window rsv_window;
  35. };
  36. struct ext2_block_alloc_info {
  37. /* information about reservation window */
  38. struct ext2_reserve_window_node rsv_window_node;
  39. /*
  40. * was i_next_alloc_block in ext2_inode_info
  41. * is the logical (file-relative) number of the
  42. * most-recently-allocated block in this file.
  43. * We use this for detecting linearly ascending allocation requests.
  44. */
  45. __u32 last_alloc_logical_block;
  46. /*
  47. * Was i_next_alloc_goal in ext2_inode_info
  48. * is the *physical* companion to i_next_alloc_block.
  49. * it the the physical block number of the block which was most-recentl
  50. * allocated to this file. This give us the goal (target) for the next
  51. * allocation when we detect linearly ascending requests.
  52. */
  53. ext2_fsblk_t last_alloc_physical_block;
  54. };
  55. #define rsv_start rsv_window._rsv_start
  56. #define rsv_end rsv_window._rsv_end
  57. /*
  58. * second extended-fs super-block data in memory
  59. */
  60. struct ext2_sb_info {
  61. unsigned long s_frag_size; /* Size of a fragment in bytes */
  62. unsigned long s_frags_per_block;/* Number of fragments per block */
  63. unsigned long s_inodes_per_block;/* Number of inodes per block */
  64. unsigned long s_frags_per_group;/* Number of fragments in a group */
  65. unsigned long s_blocks_per_group;/* Number of blocks in a group */
  66. unsigned long s_inodes_per_group;/* Number of inodes in a group */
  67. unsigned long s_itb_per_group; /* Number of inode table blocks per group */
  68. unsigned long s_gdb_count; /* Number of group descriptor blocks */
  69. unsigned long s_desc_per_block; /* Number of group descriptors per block */
  70. unsigned long s_groups_count; /* Number of groups in the fs */
  71. unsigned long s_overhead_last; /* Last calculated overhead */
  72. unsigned long s_blocks_last; /* Last seen block count */
  73. struct buffer_head * s_sbh; /* Buffer containing the super block */
  74. struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */
  75. struct buffer_head ** s_group_desc;
  76. unsigned long s_mount_opt;
  77. unsigned long s_sb_block;
  78. uid_t s_resuid;
  79. gid_t s_resgid;
  80. unsigned short s_mount_state;
  81. unsigned short s_pad;
  82. int s_addr_per_block_bits;
  83. int s_desc_per_block_bits;
  84. int s_inode_size;
  85. int s_first_ino;
  86. spinlock_t s_next_gen_lock;
  87. u32 s_next_generation;
  88. unsigned long s_dir_count;
  89. u8 *s_debts;
  90. struct percpu_counter s_freeblocks_counter;
  91. struct percpu_counter s_freeinodes_counter;
  92. struct percpu_counter s_dirs_counter;
  93. struct blockgroup_lock s_blockgroup_lock;
  94. /* root of the per fs reservation window tree */
  95. spinlock_t s_rsv_window_lock;
  96. struct rb_root s_rsv_window_root;
  97. struct ext2_reserve_window_node s_rsv_window_head;
  98. };
  99. #endif /* _LINUX_EXT2_FS_SB */