diff options
author | Christoph Hellwig <hch@lst.de> | 2008-12-02 09:54:17 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-02 09:54:17 -0500 |
commit | b2950863c61bc24cf0f63bc05947d9d50663c4c0 (patch) | |
tree | 3005a034713fe86db2d64ab1b21fe8762f6a4b0c /fs/btrfs | |
parent | 1ffa4f426c002161b7dbd58b297f5d0680e7dd6a (diff) |
Btrfs: make things static and include the right headers
Shut up various sparse warnings about symbols that should be either
static or have their declarations in scope.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ctree.c | 2 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 16 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 12 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 35 | ||||
-rw-r--r-- | fs/btrfs/free-space-cache.c | 6 | ||||
-rw-r--r-- | fs/btrfs/inode-item.c | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 26 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 14 | ||||
-rw-r--r-- | fs/btrfs/root-tree.c | 2 | ||||
-rw-r--r-- | fs/btrfs/super.c | 2 | ||||
-rw-r--r-- | fs/btrfs/tree-log.c | 5 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 12 | ||||
-rw-r--r-- | fs/btrfs/zlib.c | 1 |
13 files changed, 68 insertions, 67 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 71ef0a2e2daa..a83cbdf1d8c4 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -217,7 +217,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans, | |||
217 | * this uses that block instead of allocating a new one. btrfs_alloc_reserved_extent | 217 | * this uses that block instead of allocating a new one. btrfs_alloc_reserved_extent |
218 | * is used to finish the allocation. | 218 | * is used to finish the allocation. |
219 | */ | 219 | */ |
220 | int noinline __btrfs_cow_block(struct btrfs_trans_handle *trans, | 220 | static int noinline __btrfs_cow_block(struct btrfs_trans_handle *trans, |
221 | struct btrfs_root *root, | 221 | struct btrfs_root *root, |
222 | struct extent_buffer *buf, | 222 | struct extent_buffer *buf, |
223 | struct extent_buffer *parent, int parent_slot, | 223 | struct extent_buffer *parent, int parent_slot, |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index fb04665e5005..8a2bcc7024fe 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -93,9 +93,9 @@ struct async_submit_bio { | |||
93 | * extents on the btree inode are pretty simple, there's one extent | 93 | * extents on the btree inode are pretty simple, there's one extent |
94 | * that covers the entire device | 94 | * that covers the entire device |
95 | */ | 95 | */ |
96 | struct extent_map *btree_get_extent(struct inode *inode, struct page *page, | 96 | static struct extent_map *btree_get_extent(struct inode *inode, |
97 | size_t page_offset, u64 start, u64 len, | 97 | struct page *page, size_t page_offset, u64 start, u64 len, |
98 | int create) | 98 | int create) |
99 | { | 99 | { |
100 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; | 100 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; |
101 | struct extent_map *em; | 101 | struct extent_map *em; |
@@ -295,7 +295,7 @@ printk("read extent buffer pages failed with ret %d mirror no %d\n", ret, mirror | |||
295 | * checksum a dirty tree block before IO. This has extra checks to make | 295 | * checksum a dirty tree block before IO. This has extra checks to make |
296 | * sure we only fill in the checksum field in the first page of a multi-page block | 296 | * sure we only fill in the checksum field in the first page of a multi-page block |
297 | */ | 297 | */ |
298 | int csum_dirty_buffer(struct btrfs_root *root, struct page *page) | 298 | static int csum_dirty_buffer(struct btrfs_root *root, struct page *page) |
299 | { | 299 | { |
300 | struct extent_io_tree *tree; | 300 | struct extent_io_tree *tree; |
301 | u64 start = (u64)page->index << PAGE_CACHE_SHIFT; | 301 | u64 start = (u64)page->index << PAGE_CACHE_SHIFT; |
@@ -365,7 +365,7 @@ static int check_tree_block_fsid(struct btrfs_root *root, | |||
365 | return ret; | 365 | return ret; |
366 | } | 366 | } |
367 | 367 | ||
368 | int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, | 368 | static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, |
369 | struct extent_state *state) | 369 | struct extent_state *state) |
370 | { | 370 | { |
371 | struct extent_io_tree *tree; | 371 | struct extent_io_tree *tree; |
@@ -660,7 +660,7 @@ static int btree_writepages(struct address_space *mapping, | |||
660 | return extent_writepages(tree, mapping, btree_get_extent, wbc); | 660 | return extent_writepages(tree, mapping, btree_get_extent, wbc); |
661 | } | 661 | } |
662 | 662 | ||
663 | int btree_readpage(struct file *file, struct page *page) | 663 | static int btree_readpage(struct file *file, struct page *page) |
664 | { | 664 | { |
665 | struct extent_io_tree *tree; | 665 | struct extent_io_tree *tree; |
666 | tree = &BTRFS_I(page->mapping->host)->io_tree; | 666 | tree = &BTRFS_I(page->mapping->host)->io_tree; |
@@ -1200,7 +1200,7 @@ static void __unplug_io_fn(struct backing_dev_info *bdi, struct page *page) | |||
1200 | } | 1200 | } |
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | void btrfs_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) | 1203 | static void btrfs_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) |
1204 | { | 1204 | { |
1205 | struct inode *inode; | 1205 | struct inode *inode; |
1206 | struct extent_map_tree *em_tree; | 1206 | struct extent_map_tree *em_tree; |
@@ -1842,7 +1842,7 @@ static void btrfs_end_buffer_write_sync(struct buffer_head *bh, int uptodate) | |||
1842 | put_bh(bh); | 1842 | put_bh(bh); |
1843 | } | 1843 | } |
1844 | 1844 | ||
1845 | int write_all_supers(struct btrfs_root *root) | 1845 | static int write_all_supers(struct btrfs_root *root) |
1846 | { | 1846 | { |
1847 | struct list_head *cur; | 1847 | struct list_head *cur; |
1848 | struct list_head *head = &root->fs_info->fs_devices->devices; | 1848 | struct list_head *head = &root->fs_info->fs_devices->devices; |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a970472eab17..d15638529389 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -74,7 +74,7 @@ static int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits) | |||
74 | * this adds the block group to the fs_info rb tree for the block group | 74 | * this adds the block group to the fs_info rb tree for the block group |
75 | * cache | 75 | * cache |
76 | */ | 76 | */ |
77 | int btrfs_add_block_group_cache(struct btrfs_fs_info *info, | 77 | static int btrfs_add_block_group_cache(struct btrfs_fs_info *info, |
78 | struct btrfs_block_group_cache *block_group) | 78 | struct btrfs_block_group_cache *block_group) |
79 | { | 79 | { |
80 | struct rb_node **p; | 80 | struct rb_node **p; |
@@ -289,7 +289,7 @@ err: | |||
289 | /* | 289 | /* |
290 | * return the block group that starts at or after bytenr | 290 | * return the block group that starts at or after bytenr |
291 | */ | 291 | */ |
292 | struct btrfs_block_group_cache *btrfs_lookup_first_block_group(struct | 292 | static struct btrfs_block_group_cache *btrfs_lookup_first_block_group(struct |
293 | btrfs_fs_info *info, | 293 | btrfs_fs_info *info, |
294 | u64 bytenr) | 294 | u64 bytenr) |
295 | { | 295 | { |
@@ -3445,7 +3445,7 @@ static int noinline cache_drop_leaf_ref(struct btrfs_trans_handle *trans, | |||
3445 | return 0; | 3445 | return 0; |
3446 | } | 3446 | } |
3447 | 3447 | ||
3448 | int drop_snap_lookup_refcount(struct btrfs_root *root, u64 start, u64 len, | 3448 | static int drop_snap_lookup_refcount(struct btrfs_root *root, u64 start, u64 len, |
3449 | u32 *refs) | 3449 | u32 *refs) |
3450 | { | 3450 | { |
3451 | int ret; | 3451 | int ret; |
@@ -5434,7 +5434,7 @@ static u64 update_block_group_flags(struct btrfs_root *root, u64 flags) | |||
5434 | return flags; | 5434 | return flags; |
5435 | } | 5435 | } |
5436 | 5436 | ||
5437 | int __alloc_chunk_for_shrink(struct btrfs_root *root, | 5437 | static int __alloc_chunk_for_shrink(struct btrfs_root *root, |
5438 | struct btrfs_block_group_cache *shrink_block_group, | 5438 | struct btrfs_block_group_cache *shrink_block_group, |
5439 | int force) | 5439 | int force) |
5440 | { | 5440 | { |
@@ -5703,8 +5703,8 @@ out: | |||
5703 | return ret; | 5703 | return ret; |
5704 | } | 5704 | } |
5705 | 5705 | ||
5706 | int find_first_block_group(struct btrfs_root *root, struct btrfs_path *path, | 5706 | static int find_first_block_group(struct btrfs_root *root, |
5707 | struct btrfs_key *key) | 5707 | struct btrfs_path *path, struct btrfs_key *key) |
5708 | { | 5708 | { |
5709 | int ret = 0; | 5709 | int ret = 0; |
5710 | struct btrfs_key found_key; | 5710 | struct btrfs_key found_key; |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d79ccdbfdd95..c3dfe2a0ec85 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -112,7 +112,7 @@ void extent_io_tree_init(struct extent_io_tree *tree, | |||
112 | } | 112 | } |
113 | EXPORT_SYMBOL(extent_io_tree_init); | 113 | EXPORT_SYMBOL(extent_io_tree_init); |
114 | 114 | ||
115 | struct extent_state *alloc_extent_state(gfp_t mask) | 115 | static struct extent_state *alloc_extent_state(gfp_t mask) |
116 | { | 116 | { |
117 | struct extent_state *state; | 117 | struct extent_state *state; |
118 | #ifdef LEAK_DEBUG | 118 | #ifdef LEAK_DEBUG |
@@ -136,7 +136,7 @@ struct extent_state *alloc_extent_state(gfp_t mask) | |||
136 | } | 136 | } |
137 | EXPORT_SYMBOL(alloc_extent_state); | 137 | EXPORT_SYMBOL(alloc_extent_state); |
138 | 138 | ||
139 | void free_extent_state(struct extent_state *state) | 139 | static void free_extent_state(struct extent_state *state) |
140 | { | 140 | { |
141 | if (!state) | 141 | if (!state) |
142 | return; | 142 | return; |
@@ -662,7 +662,7 @@ static void set_state_bits(struct extent_io_tree *tree, | |||
662 | * [start, end] is inclusive | 662 | * [start, end] is inclusive |
663 | * This takes the tree lock. | 663 | * This takes the tree lock. |
664 | */ | 664 | */ |
665 | int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits, | 665 | static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits, |
666 | int exclusive, u64 *failed_start, gfp_t mask) | 666 | int exclusive, u64 *failed_start, gfp_t mask) |
667 | { | 667 | { |
668 | struct extent_state *state; | 668 | struct extent_state *state; |
@@ -879,12 +879,11 @@ int set_extent_new(struct extent_io_tree *tree, u64 start, u64 end, | |||
879 | } | 879 | } |
880 | EXPORT_SYMBOL(set_extent_new); | 880 | EXPORT_SYMBOL(set_extent_new); |
881 | 881 | ||
882 | int clear_extent_new(struct extent_io_tree *tree, u64 start, u64 end, | 882 | static int clear_extent_new(struct extent_io_tree *tree, u64 start, u64 end, |
883 | gfp_t mask) | 883 | gfp_t mask) |
884 | { | 884 | { |
885 | return clear_extent_bit(tree, start, end, EXTENT_NEW, 0, 0, mask); | 885 | return clear_extent_bit(tree, start, end, EXTENT_NEW, 0, 0, mask); |
886 | } | 886 | } |
887 | EXPORT_SYMBOL(clear_extent_new); | ||
888 | 887 | ||
889 | int set_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end, | 888 | int set_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end, |
890 | gfp_t mask) | 889 | gfp_t mask) |
@@ -894,27 +893,24 @@ int set_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end, | |||
894 | } | 893 | } |
895 | EXPORT_SYMBOL(set_extent_uptodate); | 894 | EXPORT_SYMBOL(set_extent_uptodate); |
896 | 895 | ||
897 | int clear_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end, | 896 | static int clear_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end, |
898 | gfp_t mask) | 897 | gfp_t mask) |
899 | { | 898 | { |
900 | return clear_extent_bit(tree, start, end, EXTENT_UPTODATE, 0, 0, mask); | 899 | return clear_extent_bit(tree, start, end, EXTENT_UPTODATE, 0, 0, mask); |
901 | } | 900 | } |
902 | EXPORT_SYMBOL(clear_extent_uptodate); | ||
903 | 901 | ||
904 | int set_extent_writeback(struct extent_io_tree *tree, u64 start, u64 end, | 902 | static int set_extent_writeback(struct extent_io_tree *tree, u64 start, u64 end, |
905 | gfp_t mask) | 903 | gfp_t mask) |
906 | { | 904 | { |
907 | return set_extent_bit(tree, start, end, EXTENT_WRITEBACK, | 905 | return set_extent_bit(tree, start, end, EXTENT_WRITEBACK, |
908 | 0, NULL, mask); | 906 | 0, NULL, mask); |
909 | } | 907 | } |
910 | EXPORT_SYMBOL(set_extent_writeback); | ||
911 | 908 | ||
912 | int clear_extent_writeback(struct extent_io_tree *tree, u64 start, u64 end, | 909 | static int clear_extent_writeback(struct extent_io_tree *tree, u64 start, u64 end, |
913 | gfp_t mask) | 910 | gfp_t mask) |
914 | { | 911 | { |
915 | return clear_extent_bit(tree, start, end, EXTENT_WRITEBACK, 1, 0, mask); | 912 | return clear_extent_bit(tree, start, end, EXTENT_WRITEBACK, 1, 0, mask); |
916 | } | 913 | } |
917 | EXPORT_SYMBOL(clear_extent_writeback); | ||
918 | 914 | ||
919 | int wait_on_extent_writeback(struct extent_io_tree *tree, u64 start, u64 end) | 915 | int wait_on_extent_writeback(struct extent_io_tree *tree, u64 start, u64 end) |
920 | { | 916 | { |
@@ -994,7 +990,7 @@ EXPORT_SYMBOL(set_range_dirty); | |||
994 | /* | 990 | /* |
995 | * helper function to set both pages and extents in the tree writeback | 991 | * helper function to set both pages and extents in the tree writeback |
996 | */ | 992 | */ |
997 | int set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end) | 993 | static int set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end) |
998 | { | 994 | { |
999 | unsigned long index = start >> PAGE_CACHE_SHIFT; | 995 | unsigned long index = start >> PAGE_CACHE_SHIFT; |
1000 | unsigned long end_index = end >> PAGE_CACHE_SHIFT; | 996 | unsigned long end_index = end >> PAGE_CACHE_SHIFT; |
@@ -1010,7 +1006,6 @@ int set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end) | |||
1010 | set_extent_writeback(tree, start, end, GFP_NOFS); | 1006 | set_extent_writeback(tree, start, end, GFP_NOFS); |
1011 | return 0; | 1007 | return 0; |
1012 | } | 1008 | } |
1013 | EXPORT_SYMBOL(set_range_writeback); | ||
1014 | 1009 | ||
1015 | /* | 1010 | /* |
1016 | * find the first offset in the io tree with 'bits' set. zero is | 1011 | * find the first offset in the io tree with 'bits' set. zero is |
@@ -1432,11 +1427,13 @@ out: | |||
1432 | spin_unlock_irq(&tree->lock); | 1427 | spin_unlock_irq(&tree->lock); |
1433 | return total_bytes; | 1428 | return total_bytes; |
1434 | } | 1429 | } |
1430 | |||
1431 | #if 0 | ||
1435 | /* | 1432 | /* |
1436 | * helper function to lock both pages and extents in the tree. | 1433 | * helper function to lock both pages and extents in the tree. |
1437 | * pages must be locked first. | 1434 | * pages must be locked first. |
1438 | */ | 1435 | */ |
1439 | int lock_range(struct extent_io_tree *tree, u64 start, u64 end) | 1436 | static int lock_range(struct extent_io_tree *tree, u64 start, u64 end) |
1440 | { | 1437 | { |
1441 | unsigned long index = start >> PAGE_CACHE_SHIFT; | 1438 | unsigned long index = start >> PAGE_CACHE_SHIFT; |
1442 | unsigned long end_index = end >> PAGE_CACHE_SHIFT; | 1439 | unsigned long end_index = end >> PAGE_CACHE_SHIFT; |
@@ -1473,12 +1470,11 @@ failed: | |||
1473 | } | 1470 | } |
1474 | return err; | 1471 | return err; |
1475 | } | 1472 | } |
1476 | EXPORT_SYMBOL(lock_range); | ||
1477 | 1473 | ||
1478 | /* | 1474 | /* |
1479 | * helper function to unlock both pages and extents in the tree. | 1475 | * helper function to unlock both pages and extents in the tree. |
1480 | */ | 1476 | */ |
1481 | int unlock_range(struct extent_io_tree *tree, u64 start, u64 end) | 1477 | static int unlock_range(struct extent_io_tree *tree, u64 start, u64 end) |
1482 | { | 1478 | { |
1483 | unsigned long index = start >> PAGE_CACHE_SHIFT; | 1479 | unsigned long index = start >> PAGE_CACHE_SHIFT; |
1484 | unsigned long end_index = end >> PAGE_CACHE_SHIFT; | 1480 | unsigned long end_index = end >> PAGE_CACHE_SHIFT; |
@@ -1493,7 +1489,7 @@ int unlock_range(struct extent_io_tree *tree, u64 start, u64 end) | |||
1493 | unlock_extent(tree, start, end, GFP_NOFS); | 1489 | unlock_extent(tree, start, end, GFP_NOFS); |
1494 | return 0; | 1490 | return 0; |
1495 | } | 1491 | } |
1496 | EXPORT_SYMBOL(unlock_range); | 1492 | #endif |
1497 | 1493 | ||
1498 | /* | 1494 | /* |
1499 | * set the private field for a given byte offset in the tree. If there isn't | 1495 | * set the private field for a given byte offset in the tree. If there isn't |
@@ -1956,7 +1952,7 @@ void set_page_extent_mapped(struct page *page) | |||
1956 | } | 1952 | } |
1957 | EXPORT_SYMBOL(set_page_extent_mapped); | 1953 | EXPORT_SYMBOL(set_page_extent_mapped); |
1958 | 1954 | ||
1959 | void set_page_extent_head(struct page *page, unsigned long len) | 1955 | static void set_page_extent_head(struct page *page, unsigned long len) |
1960 | { | 1956 | { |
1961 | set_page_private(page, EXTENT_PAGE_PRIVATE_FIRST_PAGE | len << 2); | 1957 | set_page_private(page, EXTENT_PAGE_PRIVATE_FIRST_PAGE | len << 2); |
1962 | } | 1958 | } |
@@ -2397,7 +2393,7 @@ update_nr_written: | |||
2397 | * WB_SYNC_ALL then we were called for data integrity and we must wait for | 2393 | * WB_SYNC_ALL then we were called for data integrity and we must wait for |
2398 | * existing IO to complete. | 2394 | * existing IO to complete. |
2399 | */ | 2395 | */ |
2400 | int extent_write_cache_pages(struct extent_io_tree *tree, | 2396 | static int extent_write_cache_pages(struct extent_io_tree *tree, |
2401 | struct address_space *mapping, | 2397 | struct address_space *mapping, |
2402 | struct writeback_control *wbc, | 2398 | struct writeback_control *wbc, |
2403 | writepage_t writepage, void *data, | 2399 | writepage_t writepage, void *data, |
@@ -2502,7 +2498,6 @@ retry: | |||
2502 | } | 2498 | } |
2503 | return ret; | 2499 | return ret; |
2504 | } | 2500 | } |
2505 | EXPORT_SYMBOL(extent_write_cache_pages); | ||
2506 | 2501 | ||
2507 | static noinline void flush_write_bio(void *data) | 2502 | static noinline void flush_write_bio(void *data) |
2508 | { | 2503 | { |
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index f4926c0f3c8c..09462adfbe33 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
@@ -443,7 +443,8 @@ void btrfs_remove_free_space_cache(struct btrfs_block_group_cache *block_group) | |||
443 | mutex_unlock(&block_group->alloc_mutex); | 443 | mutex_unlock(&block_group->alloc_mutex); |
444 | } | 444 | } |
445 | 445 | ||
446 | struct btrfs_free_space *btrfs_find_free_space_offset(struct | 446 | #if 0 |
447 | static struct btrfs_free_space *btrfs_find_free_space_offset(struct | ||
447 | btrfs_block_group_cache | 448 | btrfs_block_group_cache |
448 | *block_group, u64 offset, | 449 | *block_group, u64 offset, |
449 | u64 bytes) | 450 | u64 bytes) |
@@ -458,7 +459,7 @@ struct btrfs_free_space *btrfs_find_free_space_offset(struct | |||
458 | return ret; | 459 | return ret; |
459 | } | 460 | } |
460 | 461 | ||
461 | struct btrfs_free_space *btrfs_find_free_space_bytes(struct | 462 | static struct btrfs_free_space *btrfs_find_free_space_bytes(struct |
462 | btrfs_block_group_cache | 463 | btrfs_block_group_cache |
463 | *block_group, u64 offset, | 464 | *block_group, u64 offset, |
464 | u64 bytes) | 465 | u64 bytes) |
@@ -472,6 +473,7 @@ struct btrfs_free_space *btrfs_find_free_space_bytes(struct | |||
472 | 473 | ||
473 | return ret; | 474 | return ret; |
474 | } | 475 | } |
476 | #endif | ||
475 | 477 | ||
476 | struct btrfs_free_space *btrfs_find_free_space(struct btrfs_block_group_cache | 478 | struct btrfs_free_space *btrfs_find_free_space(struct btrfs_block_group_cache |
477 | *block_group, u64 offset, | 479 | *block_group, u64 offset, |
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c index d93451c66ba1..3d46fa1f29a4 100644 --- a/fs/btrfs/inode-item.c +++ b/fs/btrfs/inode-item.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include "disk-io.h" | 20 | #include "disk-io.h" |
21 | #include "transaction.h" | 21 | #include "transaction.h" |
22 | 22 | ||
23 | int find_name_in_backref(struct btrfs_path *path, const char * name, | 23 | static int find_name_in_backref(struct btrfs_path *path, const char *name, |
24 | int name_len, struct btrfs_inode_ref **ref_ret) | 24 | int name_len, struct btrfs_inode_ref **ref_ret) |
25 | { | 25 | { |
26 | struct extent_buffer *leaf; | 26 | struct extent_buffer *leaf; |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b3d4078b69a6..bd58ba655a4d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -1130,7 +1130,7 @@ static int run_delalloc_range(struct inode *inode, struct page *locked_page, | |||
1130 | * bytes in this file, and to maintain the list of inodes that | 1130 | * bytes in this file, and to maintain the list of inodes that |
1131 | * have pending delalloc work to be done. | 1131 | * have pending delalloc work to be done. |
1132 | */ | 1132 | */ |
1133 | int btrfs_set_bit_hook(struct inode *inode, u64 start, u64 end, | 1133 | static int btrfs_set_bit_hook(struct inode *inode, u64 start, u64 end, |
1134 | unsigned long old, unsigned long bits) | 1134 | unsigned long old, unsigned long bits) |
1135 | { | 1135 | { |
1136 | unsigned long flags; | 1136 | unsigned long flags; |
@@ -1151,7 +1151,7 @@ int btrfs_set_bit_hook(struct inode *inode, u64 start, u64 end, | |||
1151 | /* | 1151 | /* |
1152 | * extent_io.c clear_bit_hook, see set_bit_hook for why | 1152 | * extent_io.c clear_bit_hook, see set_bit_hook for why |
1153 | */ | 1153 | */ |
1154 | int btrfs_clear_bit_hook(struct inode *inode, u64 start, u64 end, | 1154 | static int btrfs_clear_bit_hook(struct inode *inode, u64 start, u64 end, |
1155 | unsigned long old, unsigned long bits) | 1155 | unsigned long old, unsigned long bits) |
1156 | { | 1156 | { |
1157 | if ((old & EXTENT_DELALLOC) && (bits & EXTENT_DELALLOC)) { | 1157 | if ((old & EXTENT_DELALLOC) && (bits & EXTENT_DELALLOC)) { |
@@ -1215,7 +1215,7 @@ int btrfs_merge_bio_hook(struct page *page, unsigned long offset, | |||
1215 | * At IO completion time the cums attached on the ordered extent record | 1215 | * At IO completion time the cums attached on the ordered extent record |
1216 | * are inserted into the btree | 1216 | * are inserted into the btree |
1217 | */ | 1217 | */ |
1218 | int __btrfs_submit_bio_start(struct inode *inode, int rw, struct bio *bio, | 1218 | static int __btrfs_submit_bio_start(struct inode *inode, int rw, struct bio *bio, |
1219 | int mirror_num, unsigned long bio_flags) | 1219 | int mirror_num, unsigned long bio_flags) |
1220 | { | 1220 | { |
1221 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1221 | struct btrfs_root *root = BTRFS_I(inode)->root; |
@@ -1234,7 +1234,7 @@ int __btrfs_submit_bio_start(struct inode *inode, int rw, struct bio *bio, | |||
1234 | * At IO completion time the cums attached on the ordered extent record | 1234 | * At IO completion time the cums attached on the ordered extent record |
1235 | * are inserted into the btree | 1235 | * are inserted into the btree |
1236 | */ | 1236 | */ |
1237 | int __btrfs_submit_bio_done(struct inode *inode, int rw, struct bio *bio, | 1237 | static int __btrfs_submit_bio_done(struct inode *inode, int rw, struct bio *bio, |
1238 | int mirror_num, unsigned long bio_flags) | 1238 | int mirror_num, unsigned long bio_flags) |
1239 | { | 1239 | { |
1240 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1240 | struct btrfs_root *root = BTRFS_I(inode)->root; |
@@ -1245,7 +1245,7 @@ int __btrfs_submit_bio_done(struct inode *inode, int rw, struct bio *bio, | |||
1245 | * extent_io.c submission hook. This does the right thing for csum calculation on write, | 1245 | * extent_io.c submission hook. This does the right thing for csum calculation on write, |
1246 | * or reading the csums from the tree before a read | 1246 | * or reading the csums from the tree before a read |
1247 | */ | 1247 | */ |
1248 | int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, | 1248 | static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, |
1249 | int mirror_num, unsigned long bio_flags) | 1249 | int mirror_num, unsigned long bio_flags) |
1250 | { | 1250 | { |
1251 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1251 | struct btrfs_root *root = BTRFS_I(inode)->root; |
@@ -1313,7 +1313,7 @@ struct btrfs_writepage_fixup { | |||
1313 | struct btrfs_work work; | 1313 | struct btrfs_work work; |
1314 | }; | 1314 | }; |
1315 | 1315 | ||
1316 | void btrfs_writepage_fixup_worker(struct btrfs_work *work) | 1316 | static void btrfs_writepage_fixup_worker(struct btrfs_work *work) |
1317 | { | 1317 | { |
1318 | struct btrfs_writepage_fixup *fixup; | 1318 | struct btrfs_writepage_fixup *fixup; |
1319 | struct btrfs_ordered_extent *ordered; | 1319 | struct btrfs_ordered_extent *ordered; |
@@ -1372,7 +1372,7 @@ out_page: | |||
1372 | * to fix it up. The async helper will wait for ordered extents, set | 1372 | * to fix it up. The async helper will wait for ordered extents, set |
1373 | * the delalloc bit and make it safe to write the page. | 1373 | * the delalloc bit and make it safe to write the page. |
1374 | */ | 1374 | */ |
1375 | int btrfs_writepage_start_hook(struct page *page, u64 start, u64 end) | 1375 | static int btrfs_writepage_start_hook(struct page *page, u64 start, u64 end) |
1376 | { | 1376 | { |
1377 | struct inode *inode = page->mapping->host; | 1377 | struct inode *inode = page->mapping->host; |
1378 | struct btrfs_writepage_fixup *fixup; | 1378 | struct btrfs_writepage_fixup *fixup; |
@@ -1526,7 +1526,7 @@ nocow: | |||
1526 | return 0; | 1526 | return 0; |
1527 | } | 1527 | } |
1528 | 1528 | ||
1529 | int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end, | 1529 | static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end, |
1530 | struct extent_state *state, int uptodate) | 1530 | struct extent_state *state, int uptodate) |
1531 | { | 1531 | { |
1532 | return btrfs_finish_ordered_io(page->mapping->host, start, end); | 1532 | return btrfs_finish_ordered_io(page->mapping->host, start, end); |
@@ -1548,7 +1548,7 @@ struct io_failure_record { | |||
1548 | int last_mirror; | 1548 | int last_mirror; |
1549 | }; | 1549 | }; |
1550 | 1550 | ||
1551 | int btrfs_io_failed_hook(struct bio *failed_bio, | 1551 | static int btrfs_io_failed_hook(struct bio *failed_bio, |
1552 | struct page *page, u64 start, u64 end, | 1552 | struct page *page, u64 start, u64 end, |
1553 | struct extent_state *state) | 1553 | struct extent_state *state) |
1554 | { | 1554 | { |
@@ -1642,7 +1642,7 @@ int btrfs_io_failed_hook(struct bio *failed_bio, | |||
1642 | * each time an IO finishes, we do a fast check in the IO failure tree | 1642 | * each time an IO finishes, we do a fast check in the IO failure tree |
1643 | * to see if we need to process or clean up an io_failure_record | 1643 | * to see if we need to process or clean up an io_failure_record |
1644 | */ | 1644 | */ |
1645 | int btrfs_clean_io_failures(struct inode *inode, u64 start) | 1645 | static int btrfs_clean_io_failures(struct inode *inode, u64 start) |
1646 | { | 1646 | { |
1647 | u64 private; | 1647 | u64 private; |
1648 | u64 private_failure; | 1648 | u64 private_failure; |
@@ -1675,7 +1675,7 @@ int btrfs_clean_io_failures(struct inode *inode, u64 start) | |||
1675 | * if there's a match, we allow the bio to finish. If not, we go through | 1675 | * if there's a match, we allow the bio to finish. If not, we go through |
1676 | * the io_failure_record routines to find good copies | 1676 | * the io_failure_record routines to find good copies |
1677 | */ | 1677 | */ |
1678 | int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, | 1678 | static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, |
1679 | struct extent_state *state) | 1679 | struct extent_state *state) |
1680 | { | 1680 | { |
1681 | size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT); | 1681 | size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT); |
@@ -4362,8 +4362,8 @@ out: | |||
4362 | * Invalidate a single dcache entry at the root of the filesystem. | 4362 | * Invalidate a single dcache entry at the root of the filesystem. |
4363 | * Needed after creation of snapshot or subvolume. | 4363 | * Needed after creation of snapshot or subvolume. |
4364 | */ | 4364 | */ |
4365 | void btrfs_invalidate_dcache_root(struct inode *dir, char *name, | 4365 | static void btrfs_invalidate_dcache_root(struct inode *dir, |
4366 | int namelen) | 4366 | char *name, int namelen) |
4367 | { | 4367 | { |
4368 | struct dentry *alias, *entry; | 4368 | struct dentry *alias, *entry; |
4369 | struct qstr qstr; | 4369 | struct qstr qstr; |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 35f650e183e1..cc7c5161e269 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -354,7 +354,7 @@ out_unlock: | |||
354 | } | 354 | } |
355 | 355 | ||
356 | 356 | ||
357 | int btrfs_defrag_file(struct file *file) | 357 | static int btrfs_defrag_file(struct file *file) |
358 | { | 358 | { |
359 | struct inode *inode = fdentry(file)->d_inode; | 359 | struct inode *inode = fdentry(file)->d_inode; |
360 | struct btrfs_root *root = BTRFS_I(inode)->root; | 360 | struct btrfs_root *root = BTRFS_I(inode)->root; |
@@ -649,7 +649,7 @@ static int btrfs_ioctl_defrag(struct file *file) | |||
649 | return 0; | 649 | return 0; |
650 | } | 650 | } |
651 | 651 | ||
652 | long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg) | 652 | static long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg) |
653 | { | 653 | { |
654 | struct btrfs_ioctl_vol_args *vol_args; | 654 | struct btrfs_ioctl_vol_args *vol_args; |
655 | int ret; | 655 | int ret; |
@@ -671,7 +671,7 @@ out: | |||
671 | return ret; | 671 | return ret; |
672 | } | 672 | } |
673 | 673 | ||
674 | long btrfs_ioctl_rm_dev(struct btrfs_root *root, void __user *arg) | 674 | static long btrfs_ioctl_rm_dev(struct btrfs_root *root, void __user *arg) |
675 | { | 675 | { |
676 | struct btrfs_ioctl_vol_args *vol_args; | 676 | struct btrfs_ioctl_vol_args *vol_args; |
677 | int ret; | 677 | int ret; |
@@ -696,8 +696,8 @@ out: | |||
696 | return ret; | 696 | return ret; |
697 | } | 697 | } |
698 | 698 | ||
699 | long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, u64 off, | 699 | static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, |
700 | u64 olen, u64 destoff) | 700 | u64 off, u64 olen, u64 destoff) |
701 | { | 701 | { |
702 | struct inode *inode = fdentry(file)->d_inode; | 702 | struct inode *inode = fdentry(file)->d_inode; |
703 | struct btrfs_root *root = BTRFS_I(inode)->root; | 703 | struct btrfs_root *root = BTRFS_I(inode)->root; |
@@ -1035,7 +1035,7 @@ out_fput: | |||
1035 | return ret; | 1035 | return ret; |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | long btrfs_ioctl_clone_range(struct file *file, unsigned long argptr) | 1038 | static long btrfs_ioctl_clone_range(struct file *file, unsigned long argptr) |
1039 | { | 1039 | { |
1040 | struct btrfs_ioctl_clone_range_args args; | 1040 | struct btrfs_ioctl_clone_range_args args; |
1041 | 1041 | ||
@@ -1051,7 +1051,7 @@ long btrfs_ioctl_clone_range(struct file *file, unsigned long argptr) | |||
1051 | * basically own the machine, and have a very in depth understanding | 1051 | * basically own the machine, and have a very in depth understanding |
1052 | * of all the possible deadlocks and enospc problems. | 1052 | * of all the possible deadlocks and enospc problems. |
1053 | */ | 1053 | */ |
1054 | long btrfs_ioctl_trans_start(struct file *file) | 1054 | static long btrfs_ioctl_trans_start(struct file *file) |
1055 | { | 1055 | { |
1056 | struct inode *inode = fdentry(file)->d_inode; | 1056 | struct inode *inode = fdentry(file)->d_inode; |
1057 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1057 | struct btrfs_root *root = BTRFS_I(inode)->root; |
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index dbe20d4c6ea4..f99335a999d6 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c | |||
@@ -276,6 +276,7 @@ out: | |||
276 | return ret; | 276 | return ret; |
277 | } | 277 | } |
278 | 278 | ||
279 | #if 0 /* this will get used when snapshot deletion is implemented */ | ||
279 | int btrfs_del_root_ref(struct btrfs_trans_handle *trans, | 280 | int btrfs_del_root_ref(struct btrfs_trans_handle *trans, |
280 | struct btrfs_root *tree_root, | 281 | struct btrfs_root *tree_root, |
281 | u64 root_id, u8 type, u64 ref_id) | 282 | u64 root_id, u8 type, u64 ref_id) |
@@ -299,6 +300,7 @@ int btrfs_del_root_ref(struct btrfs_trans_handle *trans, | |||
299 | btrfs_free_path(path); | 300 | btrfs_free_path(path); |
300 | return ret; | 301 | return ret; |
301 | } | 302 | } |
303 | #endif | ||
302 | 304 | ||
303 | int btrfs_find_root_ref(struct btrfs_root *tree_root, | 305 | int btrfs_find_root_ref(struct btrfs_root *tree_root, |
304 | struct btrfs_path *path, | 306 | struct btrfs_path *path, |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 1975ea273dc3..93a21c77064a 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -647,7 +647,7 @@ static int btrfs_interface_init(void) | |||
647 | return misc_register(&btrfs_misc); | 647 | return misc_register(&btrfs_misc); |
648 | } | 648 | } |
649 | 649 | ||
650 | void btrfs_interface_exit(void) | 650 | static void btrfs_interface_exit(void) |
651 | { | 651 | { |
652 | if (misc_deregister(&btrfs_misc) < 0) | 652 | if (misc_deregister(&btrfs_misc) < 0) |
653 | printk("misc_deregister failed for control device"); | 653 | printk("misc_deregister failed for control device"); |
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index be4fc30a30e4..4fcfc8b1189b 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "locking.h" | 23 | #include "locking.h" |
24 | #include "print-tree.h" | 24 | #include "print-tree.h" |
25 | #include "compat.h" | 25 | #include "compat.h" |
26 | #include "tree-log.h" | ||
26 | 27 | ||
27 | /* magic values for the inode_only field in btrfs_log_inode: | 28 | /* magic values for the inode_only field in btrfs_log_inode: |
28 | * | 29 | * |
@@ -78,7 +79,7 @@ static int __btrfs_log_inode(struct btrfs_trans_handle *trans, | |||
78 | * tree of log tree roots. This must be called with a tree log transaction | 79 | * tree of log tree roots. This must be called with a tree log transaction |
79 | * running (see start_log_trans). | 80 | * running (see start_log_trans). |
80 | */ | 81 | */ |
81 | int btrfs_add_log_tree(struct btrfs_trans_handle *trans, | 82 | static int btrfs_add_log_tree(struct btrfs_trans_handle *trans, |
82 | struct btrfs_root *root) | 83 | struct btrfs_root *root) |
83 | { | 84 | { |
84 | struct btrfs_key key; | 85 | struct btrfs_key key; |
@@ -1934,7 +1935,7 @@ static int walk_log_tree(struct btrfs_trans_handle *trans, | |||
1934 | return ret; | 1935 | return ret; |
1935 | } | 1936 | } |
1936 | 1937 | ||
1937 | int wait_log_commit(struct btrfs_root *log) | 1938 | static int wait_log_commit(struct btrfs_root *log) |
1938 | { | 1939 | { |
1939 | DEFINE_WAIT(wait); | 1940 | DEFINE_WAIT(wait); |
1940 | u64 transid = log->fs_info->tree_log_transid; | 1941 | u64 transid = log->fs_info->tree_log_transid; |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 724ead54529b..769f2c5d9e9e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -238,7 +238,7 @@ done: | |||
238 | return 0; | 238 | return 0; |
239 | } | 239 | } |
240 | 240 | ||
241 | void pending_bios_fn(struct btrfs_work *work) | 241 | static void pending_bios_fn(struct btrfs_work *work) |
242 | { | 242 | { |
243 | struct btrfs_device *device; | 243 | struct btrfs_device *device; |
244 | 244 | ||
@@ -686,7 +686,7 @@ error: | |||
686 | return ret; | 686 | return ret; |
687 | } | 687 | } |
688 | 688 | ||
689 | int btrfs_free_dev_extent(struct btrfs_trans_handle *trans, | 689 | static int btrfs_free_dev_extent(struct btrfs_trans_handle *trans, |
690 | struct btrfs_device *device, | 690 | struct btrfs_device *device, |
691 | u64 start) | 691 | u64 start) |
692 | { | 692 | { |
@@ -1393,7 +1393,7 @@ error: | |||
1393 | goto out; | 1393 | goto out; |
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | int noinline btrfs_update_device(struct btrfs_trans_handle *trans, | 1396 | static int noinline btrfs_update_device(struct btrfs_trans_handle *trans, |
1397 | struct btrfs_device *device) | 1397 | struct btrfs_device *device) |
1398 | { | 1398 | { |
1399 | int ret; | 1399 | int ret; |
@@ -1497,7 +1497,7 @@ static int btrfs_free_chunk(struct btrfs_trans_handle *trans, | |||
1497 | return 0; | 1497 | return 0; |
1498 | } | 1498 | } |
1499 | 1499 | ||
1500 | int btrfs_del_sys_chunk(struct btrfs_root *root, u64 chunk_objectid, u64 | 1500 | static int btrfs_del_sys_chunk(struct btrfs_root *root, u64 chunk_objectid, u64 |
1501 | chunk_offset) | 1501 | chunk_offset) |
1502 | { | 1502 | { |
1503 | struct btrfs_super_block *super_copy = &root->fs_info->super_copy; | 1503 | struct btrfs_super_block *super_copy = &root->fs_info->super_copy; |
@@ -1543,7 +1543,7 @@ int btrfs_del_sys_chunk(struct btrfs_root *root, u64 chunk_objectid, u64 | |||
1543 | return ret; | 1543 | return ret; |
1544 | } | 1544 | } |
1545 | 1545 | ||
1546 | int btrfs_relocate_chunk(struct btrfs_root *root, | 1546 | static int btrfs_relocate_chunk(struct btrfs_root *root, |
1547 | u64 chunk_tree, u64 chunk_objectid, | 1547 | u64 chunk_tree, u64 chunk_objectid, |
1548 | u64 chunk_offset) | 1548 | u64 chunk_offset) |
1549 | { | 1549 | { |
@@ -1884,7 +1884,7 @@ done: | |||
1884 | return ret; | 1884 | return ret; |
1885 | } | 1885 | } |
1886 | 1886 | ||
1887 | int btrfs_add_system_chunk(struct btrfs_trans_handle *trans, | 1887 | static int btrfs_add_system_chunk(struct btrfs_trans_handle *trans, |
1888 | struct btrfs_root *root, | 1888 | struct btrfs_root *root, |
1889 | struct btrfs_key *key, | 1889 | struct btrfs_key *key, |
1890 | struct btrfs_chunk *chunk, int item_size) | 1890 | struct btrfs_chunk *chunk, int item_size) |
diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c index 5b9f7002513c..c4617cde6c73 100644 --- a/fs/btrfs/zlib.c +++ b/fs/btrfs/zlib.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/sched.h> | 30 | #include <linux/sched.h> |
31 | #include <linux/pagemap.h> | 31 | #include <linux/pagemap.h> |
32 | #include <linux/bio.h> | 32 | #include <linux/bio.h> |
33 | #include "compression.h" | ||
33 | 34 | ||
34 | /* Plan: call deflate() with avail_in == *sourcelen, | 35 | /* Plan: call deflate() with avail_in == *sourcelen, |
35 | avail_out = *dstlen - 12 and flush == Z_FINISH. | 36 | avail_out = *dstlen - 12 and flush == Z_FINISH. |