diff options
| author | Takashi Iwai <tiwai@suse.de> | 2014-09-22 10:12:16 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2014-09-22 10:12:16 +0200 |
| commit | 7639913f7298ed23a3f026ebcbb3b4e8850bcc39 (patch) | |
| tree | 26f08f061535015b748a96106f4869560e3afc63 /fs/btrfs/tree-log.c | |
| parent | 4e9c58cb1219bcbcf6e698ed6541b275048bfa88 (diff) | |
| parent | f8fb117034847634bff8f02632151f7535981fa1 (diff) | |
Merge branch 'topic/hda-jack-rework' into for-next
This is a merge of rework of HD-audio jack event handling code.
It extends the jack table to allow multiple callbacks.
Diffstat (limited to 'fs/btrfs/tree-log.c')
| -rw-r--r-- | fs/btrfs/tree-log.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 9e1f2cd5e67a..7e0e6e3029dd 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3298,7 +3298,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, struct list_head ordered_sums; int skip_csum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; bool has_extents = false; - bool need_find_last_extent = (*last_extent == 0); + bool need_find_last_extent = true; bool done = false; INIT_LIST_HEAD(&ordered_sums); @@ -3352,8 +3352,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, */ if (ins_keys[i].type == BTRFS_EXTENT_DATA_KEY) { has_extents = true; - if (need_find_last_extent && - first_key.objectid == (u64)-1) + if (first_key.objectid == (u64)-1) first_key = ins_keys[i]; } else { need_find_last_extent = false; @@ -3427,6 +3426,16 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, if (!has_extents) return ret; + if (need_find_last_extent && *last_extent == first_key.offset) { + /* + * We don't have any leafs between our current one and the one + * we processed before that can have file extent items for our + * inode (and have a generation number smaller than our current + * transaction id). + */ + need_find_last_extent = false; + } + /* * Because we use btrfs_search_forward we could skip leaves that were * not modified and then assume *last_extent is valid when it really @@ -3537,7 +3546,7 @@ fill_holes: 0, 0); if (ret) break; - *last_extent = offset + len; + *last_extent = extent_end; } /* * Need to let the callers know we dropped the path so they should |
