Commit 98ed5174 authored by Chris Mason's avatar Chris Mason

Btrfs: Force inlining off in a few places to save stack usage

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent f9ef6604
...@@ -548,8 +548,8 @@ static int check_leaf(struct btrfs_root *root, struct btrfs_path *path, ...@@ -548,8 +548,8 @@ static int check_leaf(struct btrfs_root *root, struct btrfs_path *path,
return 0; return 0;
} }
static int check_block(struct btrfs_root *root, struct btrfs_path *path, static int noinline check_block(struct btrfs_root *root,
int level) struct btrfs_path *path, int level)
{ {
return 0; return 0;
#if 0 #if 0
...@@ -676,8 +676,9 @@ static struct extent_buffer *read_node_slot(struct btrfs_root *root, ...@@ -676,8 +676,9 @@ static struct extent_buffer *read_node_slot(struct btrfs_root *root,
btrfs_level_size(root, btrfs_header_level(parent) - 1)); btrfs_level_size(root, btrfs_header_level(parent) - 1));
} }
static int balance_level(struct btrfs_trans_handle *trans, struct btrfs_root static int balance_level(struct btrfs_trans_handle *trans,
*root, struct btrfs_path *path, int level) struct btrfs_root *root,
struct btrfs_path *path, int level)
{ {
struct extent_buffer *right = NULL; struct extent_buffer *right = NULL;
struct extent_buffer *mid; struct extent_buffer *mid;
...@@ -868,9 +869,9 @@ static int balance_level(struct btrfs_trans_handle *trans, struct btrfs_root ...@@ -868,9 +869,9 @@ static int balance_level(struct btrfs_trans_handle *trans, struct btrfs_root
} }
/* returns zero if the push worked, non-zero otherwise */ /* returns zero if the push worked, non-zero otherwise */
static int push_nodes_for_insert(struct btrfs_trans_handle *trans, static int noinline push_nodes_for_insert(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_root *root,
struct btrfs_path *path, int level) struct btrfs_path *path, int level)
{ {
struct extent_buffer *right = NULL; struct extent_buffer *right = NULL;
struct extent_buffer *mid; struct extent_buffer *mid;
...@@ -1207,8 +1208,8 @@ static int fixup_low_keys(struct btrfs_trans_handle *trans, ...@@ -1207,8 +1208,8 @@ static int fixup_low_keys(struct btrfs_trans_handle *trans,
* returns 0 if some ptrs were pushed left, < 0 if there was some horrible * returns 0 if some ptrs were pushed left, < 0 if there was some horrible
* error, and > 0 if there was no room in the left hand block. * error, and > 0 if there was no room in the left hand block.
*/ */
static int push_node_left(struct btrfs_trans_handle *trans, struct btrfs_root static int push_node_left(struct btrfs_trans_handle *trans,
*root, struct extent_buffer *dst, struct btrfs_root *root, struct extent_buffer *dst,
struct extent_buffer *src) struct extent_buffer *src)
{ {
int push_items = 0; int push_items = 0;
...@@ -1309,7 +1310,7 @@ static int balance_node_right(struct btrfs_trans_handle *trans, ...@@ -1309,7 +1310,7 @@ static int balance_node_right(struct btrfs_trans_handle *trans,
* *
* returns zero on success or < 0 on failure. * returns zero on success or < 0 on failure.
*/ */
static int insert_new_root(struct btrfs_trans_handle *trans, static int noinline insert_new_root(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_root *root,
struct btrfs_path *path, int level) struct btrfs_path *path, int level)
{ {
......
...@@ -162,10 +162,11 @@ struct btrfs_block_group_cache *btrfs_lookup_block_group(struct ...@@ -162,10 +162,11 @@ struct btrfs_block_group_cache *btrfs_lookup_block_group(struct
return block_group; return block_group;
return NULL; return NULL;
} }
static u64 find_search_start(struct btrfs_root *root,
struct btrfs_block_group_cache **cache_ret, static u64 noinline find_search_start(struct btrfs_root *root,
u64 search_start, int num, struct btrfs_block_group_cache **cache_ret,
int data, int full_scan) u64 search_start, int num,
int data, int full_scan)
{ {
int ret; int ret;
struct btrfs_block_group_cache *cache = *cache_ret; struct btrfs_block_group_cache *cache = *cache_ret;
...@@ -393,11 +394,12 @@ static int match_extent_ref(struct extent_buffer *leaf, ...@@ -393,11 +394,12 @@ static int match_extent_ref(struct extent_buffer *leaf,
return ret == 0; return ret == 0;
} }
static int lookup_extent_backref(struct btrfs_trans_handle *trans, static int noinline lookup_extent_backref(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_root *root,
struct btrfs_path *path, u64 bytenr, struct btrfs_path *path, u64 bytenr,
u64 root_objectid, u64 ref_generation, u64 root_objectid,
u64 owner, u64 owner_offset, int del) u64 ref_generation, u64 owner,
u64 owner_offset, int del)
{ {
u64 hash; u64 hash;
struct btrfs_key key; struct btrfs_key key;
...@@ -1116,8 +1118,8 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, ...@@ -1116,8 +1118,8 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
return 0; return 0;
} }
static int finish_current_insert(struct btrfs_trans_handle *trans, struct static int finish_current_insert(struct btrfs_trans_handle *trans,
btrfs_root *extent_root) struct btrfs_root *extent_root)
{ {
u64 start; u64 start;
u64 end; u64 end;
...@@ -1360,11 +1362,13 @@ static u64 stripe_align(struct btrfs_root *root, u64 val) ...@@ -1360,11 +1362,13 @@ static u64 stripe_align(struct btrfs_root *root, u64 val)
* ins->offset == number of blocks * ins->offset == number of blocks
* Any available blocks before search_start are skipped. * Any available blocks before search_start are skipped.
*/ */
static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root static int noinline find_free_extent(struct btrfs_trans_handle *trans,
*orig_root, u64 num_bytes, u64 empty_size, struct btrfs_root *orig_root,
u64 search_start, u64 search_end, u64 hint_byte, u64 num_bytes, u64 empty_size,
struct btrfs_key *ins, u64 exclude_start, u64 search_start, u64 search_end,
u64 exclude_nr, int data) u64 hint_byte, struct btrfs_key *ins,
u64 exclude_start, u64 exclude_nr,
int data)
{ {
struct btrfs_path *path; struct btrfs_path *path;
struct btrfs_key key; struct btrfs_key key;
...@@ -1760,8 +1764,9 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans, ...@@ -1760,8 +1764,9 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
return buf; return buf;
} }
static int drop_leaf_ref(struct btrfs_trans_handle *trans, static int noinline drop_leaf_ref(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct extent_buffer *leaf) struct btrfs_root *root,
struct extent_buffer *leaf)
{ {
u64 leaf_owner; u64 leaf_owner;
u64 leaf_generation; u64 leaf_generation;
...@@ -1802,8 +1807,8 @@ static int drop_leaf_ref(struct btrfs_trans_handle *trans, ...@@ -1802,8 +1807,8 @@ static int drop_leaf_ref(struct btrfs_trans_handle *trans,
return 0; return 0;
} }
static void reada_walk_down(struct btrfs_root *root, static void noinline reada_walk_down(struct btrfs_root *root,
struct extent_buffer *node) struct extent_buffer *node)
{ {
int i; int i;
u32 nritems; u32 nritems;
...@@ -1835,8 +1840,9 @@ static void reada_walk_down(struct btrfs_root *root, ...@@ -1835,8 +1840,9 @@ static void reada_walk_down(struct btrfs_root *root,
* helper function for drop_snapshot, this walks down the tree dropping ref * helper function for drop_snapshot, this walks down the tree dropping ref
* counts as it goes. * counts as it goes.
*/ */
static int walk_down_tree(struct btrfs_trans_handle *trans, struct btrfs_root static int noinline walk_down_tree(struct btrfs_trans_handle *trans,
*root, struct btrfs_path *path, int *level) struct btrfs_root *root,
struct btrfs_path *path, int *level)
{ {
u64 root_owner; u64 root_owner;
u64 root_gen; u64 root_gen;
...@@ -1955,8 +1961,9 @@ static int walk_down_tree(struct btrfs_trans_handle *trans, struct btrfs_root ...@@ -1955,8 +1961,9 @@ static int walk_down_tree(struct btrfs_trans_handle *trans, struct btrfs_root
* to find the first node higher up where we haven't yet gone through * to find the first node higher up where we haven't yet gone through
* all the slots * all the slots
*/ */
static int walk_up_tree(struct btrfs_trans_handle *trans, struct btrfs_root static int noinline walk_up_tree(struct btrfs_trans_handle *trans,
*root, struct btrfs_path *path, int *level) struct btrfs_root *root,
struct btrfs_path *path, int *level)
{ {
u64 root_owner; u64 root_owner;
u64 root_gen; u64 root_gen;
...@@ -2100,7 +2107,8 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info) ...@@ -2100,7 +2107,8 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)
return 0; return 0;
} }
static int relocate_inode_pages(struct inode *inode, u64 start, u64 len) static int noinline relocate_inode_pages(struct inode *inode, u64 start,
u64 len)
{ {
u64 page_start; u64 page_start;
u64 page_end; u64 page_end;
...@@ -2169,7 +2177,7 @@ static int relocate_inode_pages(struct inode *inode, u64 start, u64 len) ...@@ -2169,7 +2177,7 @@ static int relocate_inode_pages(struct inode *inode, u64 start, u64 len)
/* /*
* note, this releases the path * note, this releases the path
*/ */
static int relocate_one_reference(struct btrfs_root *extent_root, static int noinline relocate_one_reference(struct btrfs_root *extent_root,
struct btrfs_path *path, struct btrfs_path *path,
struct btrfs_key *extent_key) struct btrfs_key *extent_key)
{ {
...@@ -2268,9 +2276,9 @@ static int relocate_one_reference(struct btrfs_root *extent_root, ...@@ -2268,9 +2276,9 @@ static int relocate_one_reference(struct btrfs_root *extent_root,
return 0; return 0;
} }
static int relocate_one_extent(struct btrfs_root *extent_root, static int noinline relocate_one_extent(struct btrfs_root *extent_root,
struct btrfs_path *path, struct btrfs_path *path,
struct btrfs_key *extent_key) struct btrfs_key *extent_key)
{ {
struct btrfs_key key; struct btrfs_key key;
struct btrfs_key found_key; struct btrfs_key found_key;
......
...@@ -80,7 +80,7 @@ static void btrfs_drop_pages(struct page **pages, size_t num_pages) ...@@ -80,7 +80,7 @@ static void btrfs_drop_pages(struct page **pages, size_t num_pages)
} }
} }
static int insert_inline_extent(struct btrfs_trans_handle *trans, static int noinline insert_inline_extent(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct inode *inode, struct btrfs_root *root, struct inode *inode,
u64 offset, size_t size, u64 offset, size_t size,
struct page **pages, size_t page_offset, struct page **pages, size_t page_offset,
...@@ -221,7 +221,7 @@ static int insert_inline_extent(struct btrfs_trans_handle *trans, ...@@ -221,7 +221,7 @@ static int insert_inline_extent(struct btrfs_trans_handle *trans,
return err; return err;
} }
static int dirty_and_release_pages(struct btrfs_trans_handle *trans, static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_root *root,
struct file *file, struct file *file,
struct page **pages, struct page **pages,
...@@ -653,14 +653,10 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, ...@@ -653,14 +653,10 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans,
/* /*
* this gets pages into the page cache and locks them down * this gets pages into the page cache and locks them down
*/ */
static int prepare_pages(struct btrfs_root *root, static int prepare_pages(struct btrfs_root *root, struct file *file,
struct file *file, struct page **pages, size_t num_pages,
struct page **pages, loff_t pos, unsigned long first_index,
size_t num_pages, unsigned long last_index, size_t write_bytes)
loff_t pos,
unsigned long first_index,
unsigned long last_index,
size_t write_bytes)
{ {
int i; int i;
unsigned long index = pos >> PAGE_CACHE_SHIFT; unsigned long index = pos >> PAGE_CACHE_SHIFT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment