diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2015-05-24 23:20:22 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-06-03 07:03:06 -0400 |
commit | 0c304304feab8a576ed6ba6ec964255d00d2886e (patch) | |
tree | 16395772b4f084a490ebd44495ea3044e0910ce2 /fs/btrfs/ordered-data.c | |
parent | 39c2d7faccc5ca5a1be682b01c0db5fafa8adeda (diff) |
Btrfs: remove csum_bytes_left
After commit 8407f553268a
("Btrfs: fix data corruption after fast fsync and writeback error"),
during wait_ordered_extents(), we wait for ordered extent setting
BTRFS_ORDERED_IO_DONE or BTRFS_ORDERED_IOERR, at which point we've
already got checksum information, so we don't need to check
(csum_bytes_left == 0) in the whole logging path.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ordered-data.c')
-rw-r--r-- | fs/btrfs/ordered-data.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 760c4a5e096b..47966cb3d4b6 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -198,9 +198,6 @@ static int __btrfs_add_ordered_extent(struct inode *inode, u64 file_offset, | |||
198 | entry->file_offset = file_offset; | 198 | entry->file_offset = file_offset; |
199 | entry->start = start; | 199 | entry->start = start; |
200 | entry->len = len; | 200 | entry->len = len; |
201 | if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) && | ||
202 | !(type == BTRFS_ORDERED_NOCOW)) | ||
203 | entry->csum_bytes_left = disk_len; | ||
204 | entry->disk_len = disk_len; | 201 | entry->disk_len = disk_len; |
205 | entry->bytes_left = len; | 202 | entry->bytes_left = len; |
206 | entry->inode = igrab(inode); | 203 | entry->inode = igrab(inode); |
@@ -286,10 +283,6 @@ void btrfs_add_ordered_sum(struct inode *inode, | |||
286 | tree = &BTRFS_I(inode)->ordered_tree; | 283 | tree = &BTRFS_I(inode)->ordered_tree; |
287 | spin_lock_irq(&tree->lock); | 284 | spin_lock_irq(&tree->lock); |
288 | list_add_tail(&sum->list, &entry->list); | 285 | list_add_tail(&sum->list, &entry->list); |
289 | WARN_ON(entry->csum_bytes_left < sum->len); | ||
290 | entry->csum_bytes_left -= sum->len; | ||
291 | if (entry->csum_bytes_left == 0) | ||
292 | wake_up(&entry->wait); | ||
293 | spin_unlock_irq(&tree->lock); | 286 | spin_unlock_irq(&tree->lock); |
294 | } | 287 | } |
295 | 288 | ||