Dave Kleikamp | ac27a0e | 2006-10-11 01:20:50 -0700 | [diff] [blame] | 1 | /* |
Mingming Cao | 617ba13 | 2006-10-11 01:20:53 -0700 | [diff] [blame] | 2 | * linux/include/linux/ext4_fs_sb.h |
Dave Kleikamp | ac27a0e | 2006-10-11 01:20:50 -0700 | [diff] [blame] | 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 | |
Mingming Cao | 617ba13 | 2006-10-11 01:20:53 -0700 | [diff] [blame] | 16 | #ifndef _LINUX_EXT4_FS_SB |
| 17 | #define _LINUX_EXT4_FS_SB |
Dave Kleikamp | ac27a0e | 2006-10-11 01:20:50 -0700 | [diff] [blame] | 18 | |
| 19 | #ifdef __KERNEL__ |
| 20 | #include <linux/timer.h> |
| 21 | #include <linux/wait.h> |
| 22 | #include <linux/blockgroup_lock.h> |
| 23 | #include <linux/percpu_counter.h> |
| 24 | #endif |
| 25 | #include <linux/rbtree.h> |
| 26 | |
| 27 | /* |
| 28 | * third extended-fs super-block data in memory |
| 29 | */ |
Mingming Cao | 617ba13 | 2006-10-11 01:20:53 -0700 | [diff] [blame] | 30 | struct ext4_sb_info { |
Dave Kleikamp | ac27a0e | 2006-10-11 01:20:50 -0700 | [diff] [blame] | 31 | unsigned long s_frag_size; /* Size of a fragment in bytes */ |
Alexandre Ratchov | 0d1ee42 | 2006-10-11 01:21:14 -0700 | [diff] [blame^] | 32 | unsigned long s_desc_size; /* Size of a group descriptor in bytes */ |
Dave Kleikamp | ac27a0e | 2006-10-11 01:20:50 -0700 | [diff] [blame] | 33 | unsigned long s_frags_per_block;/* Number of fragments per block */ |
| 34 | unsigned long s_inodes_per_block;/* Number of inodes per block */ |
| 35 | unsigned long s_frags_per_group;/* Number of fragments in a group */ |
| 36 | unsigned long s_blocks_per_group;/* Number of blocks in a group */ |
| 37 | unsigned long s_inodes_per_group;/* Number of inodes in a group */ |
| 38 | unsigned long s_itb_per_group; /* Number of inode table blocks per group */ |
| 39 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ |
| 40 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ |
| 41 | unsigned long s_groups_count; /* Number of groups in the fs */ |
| 42 | struct buffer_head * s_sbh; /* Buffer containing the super block */ |
Mingming Cao | 617ba13 | 2006-10-11 01:20:53 -0700 | [diff] [blame] | 43 | struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ |
Dave Kleikamp | ac27a0e | 2006-10-11 01:20:50 -0700 | [diff] [blame] | 44 | struct buffer_head ** s_group_desc; |
| 45 | unsigned long s_mount_opt; |
| 46 | uid_t s_resuid; |
| 47 | gid_t s_resgid; |
| 48 | unsigned short s_mount_state; |
| 49 | unsigned short s_pad; |
| 50 | int s_addr_per_block_bits; |
| 51 | int s_desc_per_block_bits; |
| 52 | int s_inode_size; |
| 53 | int s_first_ino; |
| 54 | spinlock_t s_next_gen_lock; |
| 55 | u32 s_next_generation; |
| 56 | u32 s_hash_seed[4]; |
| 57 | int s_def_hash_version; |
| 58 | struct percpu_counter s_freeblocks_counter; |
| 59 | struct percpu_counter s_freeinodes_counter; |
| 60 | struct percpu_counter s_dirs_counter; |
| 61 | struct blockgroup_lock s_blockgroup_lock; |
| 62 | |
| 63 | /* root of the per fs reservation window tree */ |
| 64 | spinlock_t s_rsv_window_lock; |
| 65 | struct rb_root s_rsv_window_root; |
Mingming Cao | 617ba13 | 2006-10-11 01:20:53 -0700 | [diff] [blame] | 66 | struct ext4_reserve_window_node s_rsv_window_head; |
Dave Kleikamp | ac27a0e | 2006-10-11 01:20:50 -0700 | [diff] [blame] | 67 | |
| 68 | /* Journaling */ |
| 69 | struct inode * s_journal_inode; |
| 70 | struct journal_s * s_journal; |
| 71 | struct list_head s_orphan; |
| 72 | unsigned long s_commit_interval; |
| 73 | struct block_device *journal_bdev; |
| 74 | #ifdef CONFIG_JBD_DEBUG |
| 75 | struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */ |
| 76 | wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */ |
| 77 | #endif |
| 78 | #ifdef CONFIG_QUOTA |
| 79 | char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ |
| 80 | int s_jquota_fmt; /* Format of quota to use */ |
| 81 | #endif |
Alex Tomas | a86c618 | 2006-10-11 01:21:03 -0700 | [diff] [blame] | 82 | |
| 83 | #ifdef EXTENTS_STATS |
| 84 | /* ext4 extents stats */ |
| 85 | unsigned long s_ext_min; |
| 86 | unsigned long s_ext_max; |
| 87 | unsigned long s_depth_max; |
| 88 | spinlock_t s_ext_stats_lock; |
| 89 | unsigned long s_ext_blocks; |
| 90 | unsigned long s_ext_extents; |
| 91 | #endif |
Dave Kleikamp | ac27a0e | 2006-10-11 01:20:50 -0700 | [diff] [blame] | 92 | }; |
| 93 | |
Mingming Cao | 617ba13 | 2006-10-11 01:20:53 -0700 | [diff] [blame] | 94 | #endif /* _LINUX_EXT4_FS_SB */ |