Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275327
b: refs/heads/master
c: 2f120c0
h: refs/heads/master
i:
  275325: a4f3df2
  275323: 1340876
  275319: 7dd998b
  275311: 1af534d
  275295: 07dcef6
  275263: 49eafea
  275199: cd56b3b
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Nov 11, 2011
1 parent 95d04c3 commit 63bccce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 76b9e23d25d5c99f994bee3172de39492e452e93
refs/heads/master: 2f120c05e67ae34c93786b1050c6828904314429
17 changes: 10 additions & 7 deletions trunk/fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,13 @@ static int io_ctl_read_entry(struct io_ctl *io_ctl,
struct btrfs_free_space *entry, u8 *type)
{
struct btrfs_free_space_entry *e;
int ret;

if (!io_ctl->cur) {
ret = io_ctl_check_crc(io_ctl, io_ctl->index);
if (ret)
return ret;
}

e = io_ctl->cur;
entry->offset = le64_to_cpu(e->offset);
Expand All @@ -550,20 +557,14 @@ static int io_ctl_read_entry(struct io_ctl *io_ctl,

io_ctl_unmap_page(io_ctl);

if (io_ctl->index >= io_ctl->num_pages)
return 0;

return io_ctl_check_crc(io_ctl, io_ctl->index);
return 0;
}

static int io_ctl_read_bitmap(struct io_ctl *io_ctl,
struct btrfs_free_space *entry)
{
int ret;

if (io_ctl->cur && io_ctl->cur != io_ctl->orig)
io_ctl_unmap_page(io_ctl);

ret = io_ctl_check_crc(io_ctl, io_ctl->index);
if (ret)
return ret;
Expand Down Expand Up @@ -699,6 +700,8 @@ int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,
num_entries--;
}

io_ctl_unmap_page(&io_ctl);

/*
* We add the bitmaps at the end of the entries in order that
* the bitmap entries are added to the cache.
Expand Down

0 comments on commit 63bccce

Please sign in to comment.