diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-01-03 10:01:48 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:58 -0400 |
commit | 98ed51747b63435b9987ef12692a75c223818bbe (patch) | |
tree | f7f983d4754b267d8c7ed279a68e2d0ca970784c /fs/btrfs | |
parent | f9ef6604ace23a6fcd698e08b58a883d6009157b (diff) |
Btrfs: Force inlining off in a few places to save stack usage
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ctree.c | 21 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 66 | ||||
-rw-r--r-- | fs/btrfs/file.c | 16 |
3 files changed, 54 insertions, 49 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 8fa92a2d9819..35c57074a376 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -548,8 +548,8 @@ static int check_leaf(struct btrfs_root *root, struct btrfs_path *path, | |||
548 | return 0; | 548 | return 0; |
549 | } | 549 | } |
550 | 550 | ||
551 | static int check_block(struct btrfs_root *root, struct btrfs_path *path, | 551 | static int noinline check_block(struct btrfs_root *root, |
552 | int level) | 552 | struct btrfs_path *path, int level) |
553 | { | 553 | { |
554 | return 0; | 554 | return 0; |
555 | #if 0 | 555 | #if 0 |
@@ -676,8 +676,9 @@ static struct extent_buffer *read_node_slot(struct btrfs_root *root, | |||
676 | btrfs_level_size(root, btrfs_header_level(parent) - 1)); | 676 | btrfs_level_size(root, btrfs_header_level(parent) - 1)); |
677 | } | 677 | } |
678 | 678 | ||
679 | static int balance_level(struct btrfs_trans_handle *trans, struct btrfs_root | 679 | static int balance_level(struct btrfs_trans_handle *trans, |
680 | *root, struct btrfs_path *path, int level) | 680 | struct btrfs_root *root, |
681 | struct btrfs_path *path, int level) | ||
681 | { | 682 | { |
682 | struct extent_buffer *right = NULL; | 683 | struct extent_buffer *right = NULL; |
683 | struct extent_buffer *mid; | 684 | struct extent_buffer *mid; |
@@ -868,9 +869,9 @@ enospc: | |||
868 | } | 869 | } |
869 | 870 | ||
870 | /* returns zero if the push worked, non-zero otherwise */ | 871 | /* returns zero if the push worked, non-zero otherwise */ |
871 | static int push_nodes_for_insert(struct btrfs_trans_handle *trans, | 872 | static int noinline push_nodes_for_insert(struct btrfs_trans_handle *trans, |
872 | struct btrfs_root *root, | 873 | struct btrfs_root *root, |
873 | struct btrfs_path *path, int level) | 874 | struct btrfs_path *path, int level) |
874 | { | 875 | { |
875 | struct extent_buffer *right = NULL; | 876 | struct extent_buffer *right = NULL; |
876 | struct extent_buffer *mid; | 877 | struct extent_buffer *mid; |
@@ -1207,8 +1208,8 @@ static int fixup_low_keys(struct btrfs_trans_handle *trans, | |||
1207 | * returns 0 if some ptrs were pushed left, < 0 if there was some horrible | 1208 | * returns 0 if some ptrs were pushed left, < 0 if there was some horrible |
1208 | * error, and > 0 if there was no room in the left hand block. | 1209 | * error, and > 0 if there was no room in the left hand block. |
1209 | */ | 1210 | */ |
1210 | static int push_node_left(struct btrfs_trans_handle *trans, struct btrfs_root | 1211 | static int push_node_left(struct btrfs_trans_handle *trans, |
1211 | *root, struct extent_buffer *dst, | 1212 | struct btrfs_root *root, struct extent_buffer *dst, |
1212 | struct extent_buffer *src) | 1213 | struct extent_buffer *src) |
1213 | { | 1214 | { |
1214 | int push_items = 0; | 1215 | int push_items = 0; |
@@ -1309,7 +1310,7 @@ static int balance_node_right(struct btrfs_trans_handle *trans, | |||
1309 | * | 1310 | * |
1310 | * returns zero on success or < 0 on failure. | 1311 | * returns zero on success or < 0 on failure. |
1311 | */ | 1312 | */ |
1312 | static int insert_new_root(struct btrfs_trans_handle *trans, | 1313 | static int noinline insert_new_root(struct btrfs_trans_handle *trans, |
1313 | struct btrfs_root *root, | 1314 | struct btrfs_root *root, |
1314 | struct btrfs_path *path, int level) | 1315 | struct btrfs_path *path, int level) |
1315 | { | 1316 | { |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 54f2b1d8bdfd..4957cface9ab 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -162,10 +162,11 @@ struct btrfs_block_group_cache *btrfs_lookup_block_group(struct | |||
162 | return block_group; | 162 | return block_group; |
163 | return NULL; | 163 | return NULL; |
164 | } | 164 | } |
165 | static u64 find_search_start(struct btrfs_root *root, | 165 | |
166 | struct btrfs_block_group_cache **cache_ret, | 166 | static u64 noinline find_search_start(struct btrfs_root *root, |
167 | u64 search_start, int num, | 167 | struct btrfs_block_group_cache **cache_ret, |
168 | int data, int full_scan) | 168 | u64 search_start, int num, |
169 | int data, int full_scan) | ||
169 | { | 170 | { |
170 | int ret; | 171 | int ret; |
171 | struct btrfs_block_group_cache *cache = *cache_ret; | 172 | struct btrfs_block_group_cache *cache = *cache_ret; |
@@ -393,11 +394,12 @@ static int match_extent_ref(struct extent_buffer *leaf, | |||
393 | return ret == 0; | 394 | return ret == 0; |
394 | } | 395 | } |
395 | 396 | ||
396 | static int lookup_extent_backref(struct btrfs_trans_handle *trans, | 397 | static int noinline lookup_extent_backref(struct btrfs_trans_handle *trans, |
397 | struct btrfs_root *root, | 398 | struct btrfs_root *root, |
398 | struct btrfs_path *path, u64 bytenr, | 399 | struct btrfs_path *path, u64 bytenr, |
399 | u64 root_objectid, u64 ref_generation, | 400 | u64 root_objectid, |
400 | u64 owner, u64 owner_offset, int del) | 401 | u64 ref_generation, u64 owner, |
402 | u64 owner_offset, int del) | ||
401 | { | 403 | { |
402 | u64 hash; | 404 | u64 hash; |
403 | struct btrfs_key key; | 405 | struct btrfs_key key; |
@@ -1116,8 +1118,8 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, | |||
1116 | return 0; | 1118 | return 0; |
1117 | } | 1119 | } |
1118 | 1120 | ||
1119 | static int finish_current_insert(struct btrfs_trans_handle *trans, struct | 1121 | static int finish_current_insert(struct btrfs_trans_handle *trans, |
1120 | btrfs_root *extent_root) | 1122 | struct btrfs_root *extent_root) |
1121 | { | 1123 | { |
1122 | u64 start; | 1124 | u64 start; |
1123 | u64 end; | 1125 | u64 end; |
@@ -1360,11 +1362,13 @@ static u64 stripe_align(struct btrfs_root *root, u64 val) | |||
1360 | * ins->offset == number of blocks | 1362 | * ins->offset == number of blocks |
1361 | * Any available blocks before search_start are skipped. | 1363 | * Any available blocks before search_start are skipped. |
1362 | */ | 1364 | */ |
1363 | static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root | 1365 | static int noinline find_free_extent(struct btrfs_trans_handle *trans, |
1364 | *orig_root, u64 num_bytes, u64 empty_size, | 1366 | struct btrfs_root *orig_root, |
1365 | u64 search_start, u64 search_end, u64 hint_byte, | 1367 | u64 num_bytes, u64 empty_size, |
1366 | struct btrfs_key *ins, u64 exclude_start, | 1368 | u64 search_start, u64 search_end, |
1367 | u64 exclude_nr, int data) | 1369 | u64 hint_byte, struct btrfs_key *ins, |
1370 | u64 exclude_start, u64 exclude_nr, | ||
1371 | int data) | ||
1368 | { | 1372 | { |
1369 | struct btrfs_path *path; | 1373 | struct btrfs_path *path; |
1370 | struct btrfs_key key; | 1374 | struct btrfs_key key; |
@@ -1760,8 +1764,9 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | |||
1760 | return buf; | 1764 | return buf; |
1761 | } | 1765 | } |
1762 | 1766 | ||
1763 | static int drop_leaf_ref(struct btrfs_trans_handle *trans, | 1767 | static int noinline drop_leaf_ref(struct btrfs_trans_handle *trans, |
1764 | struct btrfs_root *root, struct extent_buffer *leaf) | 1768 | struct btrfs_root *root, |
1769 | struct extent_buffer *leaf) | ||
1765 | { | 1770 | { |
1766 | u64 leaf_owner; | 1771 | u64 leaf_owner; |
1767 | u64 leaf_generation; | 1772 | u64 leaf_generation; |
@@ -1802,8 +1807,8 @@ static int drop_leaf_ref(struct btrfs_trans_handle *trans, | |||
1802 | return 0; | 1807 | return 0; |
1803 | } | 1808 | } |
1804 | 1809 | ||
1805 | static void reada_walk_down(struct btrfs_root *root, | 1810 | static void noinline reada_walk_down(struct btrfs_root *root, |
1806 | struct extent_buffer *node) | 1811 | struct extent_buffer *node) |
1807 | { | 1812 | { |
1808 | int i; | 1813 | int i; |
1809 | u32 nritems; | 1814 | u32 nritems; |
@@ -1835,8 +1840,9 @@ static void reada_walk_down(struct btrfs_root *root, | |||
1835 | * helper function for drop_snapshot, this walks down the tree dropping ref | 1840 | * helper function for drop_snapshot, this walks down the tree dropping ref |
1836 | * counts as it goes. | 1841 | * counts as it goes. |
1837 | */ | 1842 | */ |
1838 | static int walk_down_tree(struct btrfs_trans_handle *trans, struct btrfs_root | 1843 | static int noinline walk_down_tree(struct btrfs_trans_handle *trans, |
1839 | *root, struct btrfs_path *path, int *level) | 1844 | struct btrfs_root *root, |
1845 | struct btrfs_path *path, int *level) | ||
1840 | { | 1846 | { |
1841 | u64 root_owner; | 1847 | u64 root_owner; |
1842 | u64 root_gen; | 1848 | u64 root_gen; |
@@ -1955,8 +1961,9 @@ out: | |||
1955 | * to find the first node higher up where we haven't yet gone through | 1961 | * to find the first node higher up where we haven't yet gone through |
1956 | * all the slots | 1962 | * all the slots |
1957 | */ | 1963 | */ |
1958 | static int walk_up_tree(struct btrfs_trans_handle *trans, struct btrfs_root | 1964 | static int noinline walk_up_tree(struct btrfs_trans_handle *trans, |
1959 | *root, struct btrfs_path *path, int *level) | 1965 | struct btrfs_root *root, |
1966 | struct btrfs_path *path, int *level) | ||
1960 | { | 1967 | { |
1961 | u64 root_owner; | 1968 | u64 root_owner; |
1962 | u64 root_gen; | 1969 | u64 root_gen; |
@@ -2100,7 +2107,8 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info) | |||
2100 | return 0; | 2107 | return 0; |
2101 | } | 2108 | } |
2102 | 2109 | ||
2103 | static int relocate_inode_pages(struct inode *inode, u64 start, u64 len) | 2110 | static int noinline relocate_inode_pages(struct inode *inode, u64 start, |
2111 | u64 len) | ||
2104 | { | 2112 | { |
2105 | u64 page_start; | 2113 | u64 page_start; |
2106 | u64 page_end; | 2114 | u64 page_end; |
@@ -2169,7 +2177,7 @@ out_unlock: | |||
2169 | /* | 2177 | /* |
2170 | * note, this releases the path | 2178 | * note, this releases the path |
2171 | */ | 2179 | */ |
2172 | static int relocate_one_reference(struct btrfs_root *extent_root, | 2180 | static int noinline relocate_one_reference(struct btrfs_root *extent_root, |
2173 | struct btrfs_path *path, | 2181 | struct btrfs_path *path, |
2174 | struct btrfs_key *extent_key) | 2182 | struct btrfs_key *extent_key) |
2175 | { | 2183 | { |
@@ -2268,9 +2276,9 @@ out: | |||
2268 | return 0; | 2276 | return 0; |
2269 | } | 2277 | } |
2270 | 2278 | ||
2271 | static int relocate_one_extent(struct btrfs_root *extent_root, | 2279 | static int noinline relocate_one_extent(struct btrfs_root *extent_root, |
2272 | struct btrfs_path *path, | 2280 | struct btrfs_path *path, |
2273 | struct btrfs_key *extent_key) | 2281 | struct btrfs_key *extent_key) |
2274 | { | 2282 | { |
2275 | struct btrfs_key key; | 2283 | struct btrfs_key key; |
2276 | struct btrfs_key found_key; | 2284 | struct btrfs_key found_key; |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 71dc2d33b6c6..c9ebd4fe8f7e 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -80,7 +80,7 @@ static void btrfs_drop_pages(struct page **pages, size_t num_pages) | |||
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | static int insert_inline_extent(struct btrfs_trans_handle *trans, | 83 | static int noinline insert_inline_extent(struct btrfs_trans_handle *trans, |
84 | struct btrfs_root *root, struct inode *inode, | 84 | struct btrfs_root *root, struct inode *inode, |
85 | u64 offset, size_t size, | 85 | u64 offset, size_t size, |
86 | struct page **pages, size_t page_offset, | 86 | struct page **pages, size_t page_offset, |
@@ -221,7 +221,7 @@ fail: | |||
221 | return err; | 221 | return err; |
222 | } | 222 | } |
223 | 223 | ||
224 | static int dirty_and_release_pages(struct btrfs_trans_handle *trans, | 224 | static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans, |
225 | struct btrfs_root *root, | 225 | struct btrfs_root *root, |
226 | struct file *file, | 226 | struct file *file, |
227 | struct page **pages, | 227 | struct page **pages, |
@@ -653,14 +653,10 @@ out: | |||
653 | /* | 653 | /* |
654 | * this gets pages into the page cache and locks them down | 654 | * this gets pages into the page cache and locks them down |
655 | */ | 655 | */ |
656 | static int prepare_pages(struct btrfs_root *root, | 656 | static int prepare_pages(struct btrfs_root *root, struct file *file, |
657 | struct file *file, | 657 | struct page **pages, size_t num_pages, |
658 | struct page **pages, | 658 | loff_t pos, unsigned long first_index, |
659 | size_t num_pages, | 659 | unsigned long last_index, size_t write_bytes) |
660 | loff_t pos, | ||
661 | unsigned long first_index, | ||
662 | unsigned long last_index, | ||
663 | size_t write_bytes) | ||
664 | { | 660 | { |
665 | int i; | 661 | int i; |
666 | unsigned long index = pos >> PAGE_CACHE_SHIFT; | 662 | unsigned long index = pos >> PAGE_CACHE_SHIFT; |