diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2014-04-02 07:51:05 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-06-09 20:20:40 -0400 |
commit | 27cdeb7096b86f05ad018a24cdb63acdf0850a5d (patch) | |
tree | 1e795214fd0456f83c85843bea354d7331328bd1 /fs/btrfs/ctree.h | |
parent | f959492fc15b60d874a9cbf55ae4760f2ef261ed (diff) |
Btrfs: use bitfield instead of integer data type for the some variants in btrfs_root
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 0a805b8d61cc..efd3bf61696d 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1711,6 +1711,26 @@ struct btrfs_subvolume_writers { | |||
1711 | }; | 1711 | }; |
1712 | 1712 | ||
1713 | /* | 1713 | /* |
1714 | * The state of btrfs root | ||
1715 | */ | ||
1716 | /* | ||
1717 | * btrfs_record_root_in_trans is a multi-step process, | ||
1718 | * and it can race with the balancing code. But the | ||
1719 | * race is very small, and only the first time the root | ||
1720 | * is added to each transaction. So IN_TRANS_SETUP | ||
1721 | * is used to tell us when more checks are required | ||
1722 | */ | ||
1723 | #define BTRFS_ROOT_IN_TRANS_SETUP 0 | ||
1724 | #define BTRFS_ROOT_REF_COWS 1 | ||
1725 | #define BTRFS_ROOT_TRACK_DIRTY 2 | ||
1726 | #define BTRFS_ROOT_IN_RADIX 3 | ||
1727 | #define BTRFS_ROOT_DUMMY_ROOT 4 | ||
1728 | #define BTRFS_ROOT_ORPHAN_ITEM_INSERTED 5 | ||
1729 | #define BTRFS_ROOT_DEFRAG_RUNNING 6 | ||
1730 | #define BTRFS_ROOT_FORCE_COW 7 | ||
1731 | #define BTRFS_ROOT_MULTI_LOG_TASKS 8 | ||
1732 | |||
1733 | /* | ||
1714 | * in ram representation of the tree. extent_root is used for all allocations | 1734 | * in ram representation of the tree. extent_root is used for all allocations |
1715 | * and for the extent tree extent_root root. | 1735 | * and for the extent tree extent_root root. |
1716 | */ | 1736 | */ |
@@ -1721,6 +1741,7 @@ struct btrfs_root { | |||
1721 | struct btrfs_root *log_root; | 1741 | struct btrfs_root *log_root; |
1722 | struct btrfs_root *reloc_root; | 1742 | struct btrfs_root *reloc_root; |
1723 | 1743 | ||
1744 | unsigned long state; | ||
1724 | struct btrfs_root_item root_item; | 1745 | struct btrfs_root_item root_item; |
1725 | struct btrfs_key root_key; | 1746 | struct btrfs_key root_key; |
1726 | struct btrfs_fs_info *fs_info; | 1747 | struct btrfs_fs_info *fs_info; |
@@ -1755,7 +1776,6 @@ struct btrfs_root { | |||
1755 | /* Just be updated when the commit succeeds. */ | 1776 | /* Just be updated when the commit succeeds. */ |
1756 | int last_log_commit; | 1777 | int last_log_commit; |
1757 | pid_t log_start_pid; | 1778 | pid_t log_start_pid; |
1758 | bool log_multiple_pids; | ||
1759 | 1779 | ||
1760 | u64 objectid; | 1780 | u64 objectid; |
1761 | u64 last_trans; | 1781 | u64 last_trans; |
@@ -1775,23 +1795,9 @@ struct btrfs_root { | |||
1775 | 1795 | ||
1776 | u64 highest_objectid; | 1796 | u64 highest_objectid; |
1777 | 1797 | ||
1778 | /* btrfs_record_root_in_trans is a multi-step process, | ||
1779 | * and it can race with the balancing code. But the | ||
1780 | * race is very small, and only the first time the root | ||
1781 | * is added to each transaction. So in_trans_setup | ||
1782 | * is used to tell us when more checks are required | ||
1783 | */ | ||
1784 | unsigned long in_trans_setup; | ||
1785 | int ref_cows; | ||
1786 | int track_dirty; | ||
1787 | int in_radix; | ||
1788 | #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS | ||
1789 | int dummy_root; | ||
1790 | #endif | ||
1791 | u64 defrag_trans_start; | 1798 | u64 defrag_trans_start; |
1792 | struct btrfs_key defrag_progress; | 1799 | struct btrfs_key defrag_progress; |
1793 | struct btrfs_key defrag_max; | 1800 | struct btrfs_key defrag_max; |
1794 | int defrag_running; | ||
1795 | char *name; | 1801 | char *name; |
1796 | 1802 | ||
1797 | /* the dirty list is only used by non-reference counted roots */ | 1803 | /* the dirty list is only used by non-reference counted roots */ |
@@ -1805,7 +1811,6 @@ struct btrfs_root { | |||
1805 | spinlock_t orphan_lock; | 1811 | spinlock_t orphan_lock; |
1806 | atomic_t orphan_inodes; | 1812 | atomic_t orphan_inodes; |
1807 | struct btrfs_block_rsv *orphan_block_rsv; | 1813 | struct btrfs_block_rsv *orphan_block_rsv; |
1808 | int orphan_item_inserted; | ||
1809 | int orphan_cleanup_state; | 1814 | int orphan_cleanup_state; |
1810 | 1815 | ||
1811 | spinlock_t inode_lock; | 1816 | spinlock_t inode_lock; |
@@ -1823,8 +1828,6 @@ struct btrfs_root { | |||
1823 | */ | 1828 | */ |
1824 | dev_t anon_dev; | 1829 | dev_t anon_dev; |
1825 | 1830 | ||
1826 | int force_cow; | ||
1827 | |||
1828 | spinlock_t root_item_lock; | 1831 | spinlock_t root_item_lock; |
1829 | atomic_t refs; | 1832 | atomic_t refs; |
1830 | 1833 | ||