#define LEAK_DEBUG 0
#ifdef LEAK_DEBUG
-static spinlock_t leak_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(leak_lock);
#endif
#define BUFFER_LRU_MAX 64
while (!list_empty(&states)) {
state = list_entry(states.next, struct extent_state, leak_list);
- printk("state leak: start %Lu end %Lu state %lu in tree %p refs %d\n", state->start, state->end, state->state, state->tree, atomic_read(&state->refs));
+ printk(KERN_ERR "btrfs state leak: start %llu end %llu "
+ "state %lu in tree %p refs %d\n",
+ (unsigned long long)state->start,
+ (unsigned long long)state->end,
+ state->state, state->tree, atomic_read(&state->refs));
list_del(&state->leak_list);
kmem_cache_free(extent_state_cache, state);
while (!list_empty(&buffers)) {
eb = list_entry(buffers.next, struct extent_buffer, leak_list);
- printk("buffer leak start %Lu len %lu refs %d\n", eb->start, eb->len, atomic_read(&eb->refs));
+ printk(KERN_ERR "btrfs buffer leak start %llu len %lu "
+ "refs %d\n", (unsigned long long)eb->start,
+ eb->len, atomic_read(&eb->refs));
list_del(&eb->leak_list);
kmem_cache_free(extent_buffer_cache, eb);
}
spin_lock_init(&tree->buffer_lock);
tree->mapping = mapping;
}
-EXPORT_SYMBOL(extent_io_tree_init);
static struct extent_state *alloc_extent_state(gfp_t mask)
{
init_waitqueue_head(&state->wq);
return state;
}
-EXPORT_SYMBOL(alloc_extent_state);
static void free_extent_state(struct extent_state *state)
{
kmem_cache_free(extent_state_cache, state);
}
}
-EXPORT_SYMBOL(free_extent_state);
static struct rb_node *tree_insert(struct rb_root *root, u64 offset,
struct rb_node *node)
{
- struct rb_node ** p = &root->rb_node;
- struct rb_node * parent = NULL;
+ struct rb_node **p = &root->rb_node;
+ struct rb_node *parent = NULL;
struct tree_entry *entry;
- while(*p) {
+ while (*p) {
parent = *p;
entry = rb_entry(parent, struct tree_entry, rb_node);
struct rb_node **next_ret)
{
struct rb_root *root = &tree->state;
- struct rb_node * n = root->rb_node;
+ struct rb_node *n = root->rb_node;
struct rb_node *prev = NULL;
struct rb_node *orig_prev = NULL;
struct tree_entry *entry;
struct tree_entry *prev_entry = NULL;
- while(n) {
+ while (n) {
entry = rb_entry(n, struct tree_entry, rb_node);
prev = n;
prev_entry = entry;
n = n->rb_left;
else if (offset > entry->end)
n = n->rb_right;
- else {
+ else
return n;
- }
}
if (prev_ret) {
orig_prev = prev;
- while(prev && offset > prev_entry->end) {
+ while (prev && offset > prev_entry->end) {
prev = rb_next(prev);
prev_entry = rb_entry(prev, struct tree_entry, rb_node);
}
if (next_ret) {
prev_entry = rb_entry(prev, struct tree_entry, rb_node);
- while(prev && offset < prev_entry->start) {
+ while (prev && offset < prev_entry->start) {
prev = rb_prev(prev);
prev_entry = rb_entry(prev, struct tree_entry, rb_node);
}
struct rb_node *ret;
ret = __etree_search(tree, offset, &prev, NULL);
- if (!ret) {
+ if (!ret)
return prev;
- }
return ret;
}
u64 offset, struct rb_node *node)
{
struct rb_root *root = &tree->buffer;
- struct rb_node ** p = &root->rb_node;
- struct rb_node * parent = NULL;
+ struct rb_node **p = &root->rb_node;
+ struct rb_node *parent = NULL;
struct extent_buffer *eb;
- while(*p) {
+ while (*p) {
parent = *p;
eb = rb_entry(parent, struct extent_buffer, rb_node);
u64 offset)
{
struct rb_root *root = &tree->buffer;
- struct rb_node * n = root->rb_node;
+ struct rb_node *n = root->rb_node;
struct extent_buffer *eb;
- while(n) {
+ while (n) {
eb = rb_entry(n, struct extent_buffer, rb_node);
if (offset < eb->start)
n = n->rb_left;
struct rb_node *node;
if (end < start) {
- printk("end < start %Lu %Lu\n", end, start);
+ printk(KERN_ERR "btrfs end < start %llu %llu\n",
+ (unsigned long long)end,
+ (unsigned long long)start);
WARN_ON(1);
}
if (bits & EXTENT_DIRTY)
if (node) {
struct extent_state *found;
found = rb_entry(node, struct extent_state, rb_node);
- printk("found node %Lu %Lu on insert of %Lu %Lu\n", found->start, found->end, start, end);
+ printk(KERN_ERR "btrfs found node %llu %llu on insert of "
+ "%llu %llu\n", (unsigned long long)found->start,
+ (unsigned long long)found->end,
+ (unsigned long long)start, (unsigned long long)end);
free_extent_state(state);
return -EEXIST;
}
if (node) {
struct extent_state *found;
found = rb_entry(node, struct extent_state, rb_node);
- printk("found node %Lu %Lu on insert of %Lu %Lu\n", found->start, found->end, prealloc->start, prealloc->end);
free_extent_state(prealloc);
return -EEXIST;
}
cond_resched();
goto again;
}
-EXPORT_SYMBOL(clear_extent_bit);
static int wait_on_state(struct extent_io_tree *tree,
struct extent_state *state)
spin_unlock(&tree->lock);
return 0;
}
-EXPORT_SYMBOL(wait_extent_bit);
static void set_state_bits(struct extent_io_tree *tree,
struct extent_state *state,
* [start, end] is inclusive
* This takes the tree lock.
*/
-static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits,
- int exclusive, u64 *failed_start, gfp_t mask)
+static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
+ int bits, int exclusive, u64 *failed_start,
+ gfp_t mask)
{
struct extent_state *state;
struct extent_state *prealloc = NULL;
if (end < last_start)
this_end = end;
else
- this_end = last_start -1;
+ this_end = last_start - 1;
err = insert_state(tree, prealloc, start, this_end,
bits);
prealloc = NULL;
cond_resched();
goto again;
}
-EXPORT_SYMBOL(set_extent_bit);
/* wrappers around set/clear extent bit */
int set_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end,
return set_extent_bit(tree, start, end, EXTENT_DIRTY, 0, NULL,
mask);
}
-EXPORT_SYMBOL(set_extent_dirty);
int set_extent_ordered(struct extent_io_tree *tree, u64 start, u64 end,
gfp_t mask)
{
return set_extent_bit(tree, start, end, EXTENT_ORDERED, 0, NULL, mask);
}
-EXPORT_SYMBOL(set_extent_ordered);
int set_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
int bits, gfp_t mask)
return set_extent_bit(tree, start, end, bits, 0, NULL,
mask);
}
-EXPORT_SYMBOL(set_extent_bits);
int clear_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
int bits, gfp_t mask)
{
return clear_extent_bit(tree, start, end, bits, 0, 0, mask);
}
-EXPORT_SYMBOL(clear_extent_bits);
int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end,
gfp_t mask)
EXTENT_DELALLOC | EXTENT_DIRTY,
0, NULL, mask);
}
-EXPORT_SYMBOL(set_extent_delalloc);
int clear_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end,
gfp_t mask)
return clear_extent_bit(tree, start, end,
EXTENT_DIRTY | EXTENT_DELALLOC, 0, 0, mask);
}
-EXPORT_SYMBOL(clear_extent_dirty);
int clear_extent_ordered(struct extent_io_tree *tree, u64 start, u64 end,
gfp_t mask)
{
return clear_extent_bit(tree, start, end, EXTENT_ORDERED, 1, 0, mask);
}
-EXPORT_SYMBOL(clear_extent_ordered);
int set_extent_new(struct extent_io_tree *tree, u64 start, u64 end,
gfp_t mask)
return set_extent_bit(tree, start, end, EXTENT_NEW, 0, NULL,
mask);
}
-EXPORT_SYMBOL(set_extent_new);
static int clear_extent_new(struct extent_io_tree *tree, u64 start, u64 end,
gfp_t mask)
return set_extent_bit(tree, start, end, EXTENT_UPTODATE, 0, NULL,
mask);
}
-EXPORT_SYMBOL(set_extent_uptodate);
-static int clear_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end,
- gfp_t mask)
+static int clear_extent_uptodate(struct extent_io_tree *tree, u64 start,
+ u64 end, gfp_t mask)
{
return clear_extent_bit(tree, start, end, EXTENT_UPTODATE, 0, 0, mask);
}
0, NULL, mask);
}
-static int clear_extent_writeback(struct extent_io_tree *tree, u64 start, u64 end,
- gfp_t mask)
+static int clear_extent_writeback(struct extent_io_tree *tree, u64 start,
+ u64 end, gfp_t mask)
{
return clear_extent_bit(tree, start, end, EXTENT_WRITEBACK, 1, 0, mask);
}
{
return wait_extent_bit(tree, start, end, EXTENT_WRITEBACK);
}
-EXPORT_SYMBOL(wait_on_extent_writeback);
/*
* either insert or lock state struct between start and end use mask to tell
}
return err;
}
-EXPORT_SYMBOL(lock_extent);
int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end,
gfp_t mask)
}
return 1;
}
-EXPORT_SYMBOL(try_lock_extent);
int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end,
gfp_t mask)
{
return clear_extent_bit(tree, start, end, EXTENT_LOCKED, 1, 0, mask);
}
-EXPORT_SYMBOL(unlock_extent);
/*
* helper function to set pages and extents in the tree dirty
set_extent_dirty(tree, start, end, GFP_NOFS);
return 0;
}
-EXPORT_SYMBOL(set_range_dirty);
/*
* helper function to set both pages and extents in the tree writeback
* our range starts.
*/
node = tree_search(tree, start);
- if (!node) {
+ if (!node)
goto out;
- }
- while(1) {
+ while (1) {
state = rb_entry(node, struct extent_state, rb_node);
if (state->end >= start && (state->state & bits)) {
*start_ret = state->start;
spin_unlock(&tree->lock);
return ret;
}
-EXPORT_SYMBOL(find_first_extent_bit);
/* find the first state struct with 'bits' set after 'start', and
* return it. tree->lock must be held. NULL will returned if
* our range starts.
*/
node = tree_search(tree, start);
- if (!node) {
+ if (!node)
goto out;
- }
- while(1) {
+ while (1) {
state = rb_entry(node, struct extent_state, rb_node);
- if (state->end >= start && (state->state & bits)) {
+ if (state->end >= start && (state->state & bits))
return state;
- }
+
node = rb_next(node);
if (!node)
break;
out:
return NULL;
}
-EXPORT_SYMBOL(find_first_extent_bit_state);
/*
* find a contiguous range of bytes in the file marked as delalloc, not
goto out;
}
- while(1) {
+ while (1) {
state = rb_entry(node, struct extent_state, rb_node);
if (found && (state->start != cur_start ||
(state->state & EXTENT_BOUNDARY))) {
if (index == locked_page->index && end_index == index)
return 0;
- while(nr_pages > 0) {
+ while (nr_pages > 0) {
ret = find_get_pages_contig(inode->i_mapping, index,
min_t(unsigned long, nr_pages,
ARRAY_SIZE(pages)), pages);
/* skip the page at the start index */
nrpages = end_index - index + 1;
- while(nrpages > 0) {
+ while (nrpages > 0) {
ret = find_get_pages_contig(inode->i_mapping, index,
min_t(unsigned long,
nrpages, ARRAY_SIZE(pages)), pages);
* pages in order, so we can't process delalloc bytes before
* locked_page
*/
- if (delalloc_start < *start) {
+ if (delalloc_start < *start)
delalloc_start = *start;
- }
/*
* make sure to limit the number of pages we try to lock down
* if we're looping.
*/
- if (delalloc_end + 1 - delalloc_start > max_bytes && loops) {
+ if (delalloc_end + 1 - delalloc_start > max_bytes && loops)
delalloc_end = delalloc_start + PAGE_CACHE_SIZE - 1;
- }
+
/* step two, lock all the pages after the page that has start */
ret = lock_delalloc_pages(inode, locked_page,
delalloc_start, delalloc_end);
if (!(unlock_pages || clear_dirty || set_writeback || end_writeback))
return 0;
- while(nr_pages > 0) {
+ while (nr_pages > 0) {
ret = find_get_pages_contig(inode->i_mapping, index,
min_t(unsigned long,
nr_pages, ARRAY_SIZE(pages)), pages);
}
return 0;
}
-EXPORT_SYMBOL(extent_clear_unlock_delalloc);
/*
* count the number of bytes in the tree that have a given bit(s)
int found = 0;
if (search_end <= cur_start) {
- printk("search_end %Lu start %Lu\n", search_end, cur_start);
WARN_ON(1);
return 0;
}
* our range starts.
*/
node = tree_search(tree, cur_start);
- if (!node) {
+ if (!node)
goto out;
- }
- while(1) {
+ while (1) {
state = rb_entry(node, struct extent_state, rb_node);
if (state->start > search_end)
break;
spin_unlock(&tree->lock);
return bitset;
}
-EXPORT_SYMBOL(test_range_bit);
/*
* helper function to set a given page up to date if all the
nr = bio_get_nr_vecs(bdev);
bio = extent_bio_alloc(bdev, sector, nr, GFP_NOFS | __GFP_HIGH);
- if (!bio) {
- printk("failed to allocate bio nr %d\n", nr);
- }
bio_add_page(bio, page, page_size, offset);
bio->bi_end_io = end_io_func;
bio->bi_private = tree;
- if (bio_ret) {
+ if (bio_ret)
*bio_ret = bio;
- } else {
+ else
ret = submit_one_bio(rw, bio, mirror_num, bio_flags);
- }
return ret;
}
set_page_private(page, EXTENT_PAGE_PRIVATE);
}
}
-EXPORT_SYMBOL(set_page_extent_mapped);
static void set_page_extent_head(struct page *page, unsigned long len)
{
break;
}
extent_offset = cur - em->start;
- if (extent_map_end(em) <= cur) {
-printk("bad mapping em [%Lu %Lu] cur %Lu\n", em->start, extent_map_end(em), cur);
- }
BUG_ON(extent_map_end(em) <= cur);
- if (end < cur) {
-printk("2bad mapping end %Lu cur %Lu\n", end, cur);
- }
BUG_ON(end < cur);
if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags))
submit_one_bio(READ, bio, 0, bio_flags);
return ret;
}
-EXPORT_SYMBOL(extent_read_full_page);
/*
* the writepage semantics are similar to regular writepage. extent
delalloc_end = 0;
page_started = 0;
if (!epd->extent_locked) {
- while(delalloc_end < page_end) {
+ while (delalloc_end < page_end) {
nr_delalloc = find_lock_delalloc_range(inode, tree,
page,
&delalloc_start,
nr_written++;
end = page_end;
- if (test_range_bit(tree, start, page_end, EXTENT_DELALLOC, 0)) {
- printk("found delalloc bits after lock_extent\n");
- }
+ if (test_range_bit(tree, start, page_end, EXTENT_DELALLOC, 0))
+ printk(KERN_ERR "btrfs delalloc bits after lock_extent\n");
if (last_byte <= start) {
clear_extent_dirty(tree, start, page_end, GFP_NOFS);
clear_extent_dirty(tree, cur,
cur + iosize - 1, GFP_NOFS);
- unlock_extent(tree, unlock_start, cur + iosize -1,
+ unlock_extent(tree, unlock_start, cur + iosize - 1,
GFP_NOFS);
/*
set_range_writeback(tree, cur, cur + iosize - 1);
if (!PageWriteback(page)) {
- printk("warning page %lu not writeback, "
- "cur %llu end %llu\n", page->index,
- (unsigned long long)cur,
+ printk(KERN_ERR "btrfs warning page %lu not "
+ "writeback, cur %llu end %llu\n",
+ page->index, (unsigned long long)cur,
(unsigned long long)end);
}
retry:
while (!done && (index <= end) &&
(nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
- PAGECACHE_TAG_DIRTY,
- min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) {
+ PAGECACHE_TAG_DIRTY, min(end - index,
+ (pgoff_t)PAGEVEC_SIZE-1) + 1))) {
unsigned i;
scanned = 1;
extent_write_cache_pages(tree, mapping, &wbc_writepages,
__extent_writepage, &epd, flush_write_bio);
- if (epd.bio) {
+ if (epd.bio)
submit_one_bio(WRITE, epd.bio, 0, 0);
- }
return ret;
}
-EXPORT_SYMBOL(extent_write_full_page);
int extent_write_locked_range(struct extent_io_tree *tree, struct inode *inode,
u64 start, u64 end, get_extent_t *get_extent,
.range_end = end + 1,
};
- while(start <= end) {
+ while (start <= end) {
page = find_get_page(mapping, start >> PAGE_CACHE_SHIFT);
if (clear_page_dirty_for_io(page))
ret = __extent_writepage(page, &wbc_writepages, &epd);
submit_one_bio(WRITE, epd.bio, 0, 0);
return ret;
}
-EXPORT_SYMBOL(extent_write_locked_range);
-
int extent_writepages(struct extent_io_tree *tree,
struct address_space *mapping,
ret = extent_write_cache_pages(tree, mapping, wbc,
__extent_writepage, &epd,
flush_write_bio);
- if (epd.bio) {
+ if (epd.bio)
submit_one_bio(WRITE, epd.bio, 0, 0);
- }
return ret;
}
-EXPORT_SYMBOL(extent_writepages);
int extent_readpages(struct extent_io_tree *tree,
struct address_space *mapping,
submit_one_bio(READ, bio, 0, bio_flags);
return 0;
}
-EXPORT_SYMBOL(extent_readpages);
/*
* basic invalidatepage code, this waits on any locked or writeback
u64 end = start + PAGE_CACHE_SIZE - 1;
size_t blocksize = page->mapping->host->i_sb->s_blocksize;
- start += (offset + blocksize -1) & ~(blocksize - 1);
+ start += (offset + blocksize - 1) & ~(blocksize - 1);
if (start > end)
return 0;
1, 1, GFP_NOFS);
return 0;
}
-EXPORT_SYMBOL(extent_invalidatepage);
/*
* simple commit_write call, set_range_dirty is used to mark both
}
return 0;
}
-EXPORT_SYMBOL(extent_commit_write);
int extent_prepare_write(struct extent_io_tree *tree,
struct inode *inode, struct page *page,
orig_block_start = block_start;
lock_extent(tree, page_start, page_end, GFP_NOFS);
- while(block_start <= block_end) {
+ while (block_start <= block_end) {
em = get_extent(inode, page, page_offset, block_start,
block_end - block_start + 1, 1);
- if (IS_ERR(em) || !em) {
+ if (IS_ERR(em) || !em)
goto err;
- }
+
cur_end = min(block_end, extent_map_end(em) - 1);
block_off_start = block_start & (PAGE_CACHE_SIZE - 1);
block_off_end = block_off_start + blocksize;
/* FIXME, zero out newly allocated blocks on error */
return err;
}
-EXPORT_SYMBOL(extent_prepare_write);
/*
* a helper for releasepage, this tests for areas of the page that
}
return ret;
}
-EXPORT_SYMBOL(try_release_extent_state);
/*
* a helper for releasepage. As long as there are no locked extents
}
return try_release_extent_state(map, tree, page, mask);
}
-EXPORT_SYMBOL(try_release_extent_mapping);
sector_t extent_bmap(struct address_space *mapping, sector_t iblock,
get_extent_t *get_extent)
__free_extent_buffer(eb);
return exists;
}
-EXPORT_SYMBOL(alloc_extent_buffer);
struct extent_buffer *find_extent_buffer(struct extent_io_tree *tree,
u64 start, unsigned long len,
return eb;
}
-EXPORT_SYMBOL(find_extent_buffer);
void free_extent_buffer(struct extent_buffer *eb)
{
WARN_ON(1);
}
-EXPORT_SYMBOL(free_extent_buffer);
int clear_extent_buffer_dirty(struct extent_io_tree *tree,
struct extent_buffer *eb)
}
return 0;
}
-EXPORT_SYMBOL(clear_extent_buffer_dirty);
int wait_on_extent_buffer_writeback(struct extent_io_tree *tree,
struct extent_buffer *eb)
return wait_on_extent_writeback(tree, eb->start,
eb->start + eb->len - 1);
}
-EXPORT_SYMBOL(wait_on_extent_buffer_writeback);
int set_extent_buffer_dirty(struct extent_io_tree *tree,
struct extent_buffer *eb)
}
__set_page_dirty_nobuffers(extent_buffer_page(eb, i));
set_extent_dirty(tree, page_offset(page),
- page_offset(page) + PAGE_CACHE_SIZE -1,
+ page_offset(page) + PAGE_CACHE_SIZE - 1,
GFP_NOFS);
unlock_page(page);
}
return 0;
}
-EXPORT_SYMBOL(set_extent_buffer_dirty);
int clear_extent_buffer_uptodate(struct extent_io_tree *tree,
struct extent_buffer *eb)
}
return 0;
}
-EXPORT_SYMBOL(set_extent_buffer_uptodate);
int extent_range_uptodate(struct extent_io_tree *tree,
u64 start, u64 end)
ret = test_range_bit(tree, start, end, EXTENT_UPTODATE, 1);
if (ret)
return 1;
- while(start <= end) {
+ while (start <= end) {
index = start >> PAGE_CACHE_SHIFT;
page = find_get_page(tree->mapping, index);
uptodate = PageUptodate(page);
}
return pg_uptodate;
}
-EXPORT_SYMBOL(extent_buffer_uptodate);
int read_extent_buffer_pages(struct extent_io_tree *tree,
struct extent_buffer *eb,
lock_page(page);
}
locked_pages++;
- if (!PageUptodate(page)) {
+ if (!PageUptodate(page))
all_uptodate = 0;
- }
}
if (all_uptodate) {
if (start_i == 0)
eb->flags |= EXTENT_UPTODATE;
- if (ret) {
- printk("all up to date but ret is %d\n", ret);
- }
goto unlock_exit;
}
err = __extent_read_full_page(tree, page,
get_extent, &bio,
mirror_num, &bio_flags);
- if (err) {
+ if (err)
ret = err;
- printk("err %d from __extent_read_full_page\n", ret);
- }
} else {
unlock_page(page);
}
if (bio)
submit_one_bio(READ, bio, mirror_num, bio_flags);
- if (ret || !wait) {
- if (ret)
- printk("ret %d wait %d returning\n", ret, wait);
+ if (ret || !wait)
return ret;
- }
+
for (i = start_i; i < num_pages; i++) {
page = extent_buffer_page(eb, i);
wait_on_page_locked(page);
- if (!PageUptodate(page)) {
- printk("page not uptodate after wait_on_page_locked\n");
+ if (!PageUptodate(page))
ret = -EIO;
- }
}
+
if (!ret)
eb->flags |= EXTENT_UPTODATE;
return ret;
unlock_exit:
i = start_i;
- while(locked_pages > 0) {
+ while (locked_pages > 0) {
page = extent_buffer_page(eb, i);
i++;
unlock_page(page);
}
return ret;
}
-EXPORT_SYMBOL(read_extent_buffer_pages);
void read_extent_buffer(struct extent_buffer *eb, void *dstv,
unsigned long start,
offset = (start_offset + start) & ((unsigned long)PAGE_CACHE_SIZE - 1);
- while(len > 0) {
+ while (len > 0) {
page = extent_buffer_page(eb, i);
cur = min(len, (PAGE_CACHE_SIZE - offset));
i++;
}
}
-EXPORT_SYMBOL(read_extent_buffer);
int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
unsigned long min_len, char **token, char **map,
offset = 0;
*map_start = ((u64)i << PAGE_CACHE_SHIFT) - start_offset;
}
+
if (start + min_len > eb->len) {
-printk("bad mapping eb start %Lu len %lu, wanted %lu %lu\n", eb->start, eb->len, start, min_len);
+ printk(KERN_ERR "btrfs bad mapping eb start %llu len %lu, "
+ "wanted %lu %lu\n", (unsigned long long)eb->start,
+ eb->len, start, min_len);
WARN_ON(1);
}
*map_len = PAGE_CACHE_SIZE - offset;
return 0;
}
-EXPORT_SYMBOL(map_private_extent_buffer);
int map_extent_buffer(struct extent_buffer *eb, unsigned long start,
unsigned long min_len,
}
return err;
}
-EXPORT_SYMBOL(map_extent_buffer);
void unmap_extent_buffer(struct extent_buffer *eb, char *token, int km)
{
kunmap_atomic(token, km);
}
-EXPORT_SYMBOL(unmap_extent_buffer);
int memcmp_extent_buffer(struct extent_buffer *eb, const void *ptrv,
unsigned long start,
offset = (start_offset + start) & ((unsigned long)PAGE_CACHE_SIZE - 1);
- while(len > 0) {
+ while (len > 0) {
page = extent_buffer_page(eb, i);
cur = min(len, (PAGE_CACHE_SIZE - offset));
}
return ret;
}
-EXPORT_SYMBOL(memcmp_extent_buffer);
void write_extent_buffer(struct extent_buffer *eb, const void *srcv,
unsigned long start, unsigned long len)
offset = (start_offset + start) & ((unsigned long)PAGE_CACHE_SIZE - 1);
- while(len > 0) {
+ while (len > 0) {
page = extent_buffer_page(eb, i);
WARN_ON(!PageUptodate(page));
i++;
}
}
-EXPORT_SYMBOL(write_extent_buffer);
void memset_extent_buffer(struct extent_buffer *eb, char c,
unsigned long start, unsigned long len)
offset = (start_offset + start) & ((unsigned long)PAGE_CACHE_SIZE - 1);
- while(len > 0) {
+ while (len > 0) {
page = extent_buffer_page(eb, i);
WARN_ON(!PageUptodate(page));
i++;
}
}
-EXPORT_SYMBOL(memset_extent_buffer);
void copy_extent_buffer(struct extent_buffer *dst, struct extent_buffer *src,
unsigned long dst_offset, unsigned long src_offset,
offset = (start_offset + dst_offset) &
((unsigned long)PAGE_CACHE_SIZE - 1);
- while(len > 0) {
+ while (len > 0) {
page = extent_buffer_page(dst, i);
WARN_ON(!PageUptodate(page));
i++;
}
}
-EXPORT_SYMBOL(copy_extent_buffer);
static void move_pages(struct page *dst_page, struct page *src_page,
unsigned long dst_off, unsigned long src_off,
unsigned long src_i;
if (src_offset + len > dst->len) {
- printk("memmove bogus src_offset %lu move len %lu len %lu\n",
- src_offset, len, dst->len);
+ printk(KERN_ERR "btrfs memmove bogus src_offset %lu move "
+ "len %lu dst len %lu\n", src_offset, len, dst->len);
BUG_ON(1);
}
if (dst_offset + len > dst->len) {
- printk("memmove bogus dst_offset %lu move len %lu len %lu\n",
- dst_offset, len, dst->len);
+ printk(KERN_ERR "btrfs memmove bogus dst_offset %lu move "
+ "len %lu dst len %lu\n", dst_offset, len, dst->len);
BUG_ON(1);
}
- while(len > 0) {
+ while (len > 0) {
dst_off_in_page = (start_offset + dst_offset) &
((unsigned long)PAGE_CACHE_SIZE - 1);
src_off_in_page = (start_offset + src_offset) &
len -= cur;
}
}
-EXPORT_SYMBOL(memcpy_extent_buffer);
void memmove_extent_buffer(struct extent_buffer *dst, unsigned long dst_offset,
unsigned long src_offset, unsigned long len)
unsigned long src_i;
if (src_offset + len > dst->len) {
- printk("memmove bogus src_offset %lu move len %lu len %lu\n",
- src_offset, len, dst->len);
+ printk(KERN_ERR "btrfs memmove bogus src_offset %lu move "
+ "len %lu len %lu\n", src_offset, len, dst->len);
BUG_ON(1);
}
if (dst_offset + len > dst->len) {
- printk("memmove bogus dst_offset %lu move len %lu len %lu\n",
- dst_offset, len, dst->len);
+ printk(KERN_ERR "btrfs memmove bogus dst_offset %lu move "
+ "len %lu len %lu\n", dst_offset, len, dst->len);
BUG_ON(1);
}
if (dst_offset < src_offset) {
memcpy_extent_buffer(dst, dst_offset, src_offset, len);
return;
}
- while(len > 0) {
+ while (len > 0) {
dst_i = (start_offset + dst_end) >> PAGE_CACHE_SHIFT;
src_i = (start_offset + src_end) >> PAGE_CACHE_SHIFT;
len -= cur;
}
}
-EXPORT_SYMBOL(memmove_extent_buffer);
int try_release_extent_buffer(struct extent_io_tree *tree, struct page *page)
{
spin_unlock(&tree->buffer_lock);
return ret;
}
-EXPORT_SYMBOL(try_release_extent_buffer);