aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-09-05 16:09:51 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:07 -0400
commita1b32a5932cfac7c38b442582285f3da2a09dfd8 (patch)
treed468c51c7391ee1a0cfcc6ff1e76e11c01646efe /fs/btrfs/file.c
parent95819c05732c511338b43c115ffbcee978c02888 (diff)
Btrfs: Add debugging checks to track down corrupted metadata
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index eb8e4556fa71..e9e86fbaa243 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -39,9 +39,10 @@
39#include "compat.h" 39#include "compat.h"
40 40
41 41
42static int btrfs_copy_from_user(loff_t pos, int num_pages, int write_bytes, 42static int noinline btrfs_copy_from_user(loff_t pos, int num_pages,
43 struct page **prepared_pages, 43 int write_bytes,
44 const char __user * buf) 44 struct page **prepared_pages,
45 const char __user * buf)
45{ 46{
46 long page_fault = 0; 47 long page_fault = 0;
47 int i; 48 int i;
@@ -69,7 +70,7 @@ static int btrfs_copy_from_user(loff_t pos, int num_pages, int write_bytes,
69 return page_fault ? -EFAULT : 0; 70 return page_fault ? -EFAULT : 0;
70} 71}
71 72
72static void btrfs_drop_pages(struct page **pages, size_t num_pages) 73static void noinline btrfs_drop_pages(struct page **pages, size_t num_pages)
73{ 74{
74 size_t i; 75 size_t i;
75 for (i = 0; i < num_pages; i++) { 76 for (i = 0; i < num_pages; i++) {
@@ -359,7 +360,7 @@ out_unlock:
359 return err; 360 return err;
360} 361}
361 362
362int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end) 363int noinline btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end)
363{ 364{
364 struct extent_map *em; 365 struct extent_map *em;
365 struct extent_map *split = NULL; 366 struct extent_map *split = NULL;
@@ -515,7 +516,7 @@ out:
515 * it is either truncated or split. Anything entirely inside the range 516 * it is either truncated or split. Anything entirely inside the range
516 * is deleted from the tree. 517 * is deleted from the tree.
517 */ 518 */
518int btrfs_drop_extents(struct btrfs_trans_handle *trans, 519int noinline btrfs_drop_extents(struct btrfs_trans_handle *trans,
519 struct btrfs_root *root, struct inode *inode, 520 struct btrfs_root *root, struct inode *inode,
520 u64 start, u64 end, u64 inline_limit, u64 *hint_byte) 521 u64 start, u64 end, u64 inline_limit, u64 *hint_byte)
521{ 522{
@@ -785,7 +786,7 @@ out:
785/* 786/*
786 * this gets pages into the page cache and locks them down 787 * this gets pages into the page cache and locks them down
787 */ 788 */
788static int prepare_pages(struct btrfs_root *root, struct file *file, 789static int noinline prepare_pages(struct btrfs_root *root, struct file *file,
789 struct page **pages, size_t num_pages, 790 struct page **pages, size_t num_pages,
790 loff_t pos, unsigned long first_index, 791 loff_t pos, unsigned long first_index,
791 unsigned long last_index, size_t write_bytes) 792 unsigned long last_index, size_t write_bytes)