diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-16 18:12:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-16 18:12:56 -0400 |
commit | a18f8775419d3df282dd83efdb51c5a64d092f31 (patch) | |
tree | 1e0abc5c1d30e8bc58dc23099017eca496992fd2 /fs/btrfs/backref.c | |
parent | 3eb514866f20c5eb74637279774b6d73b855480a (diff) | |
parent | e02d48eaaed77f6c36916a7aa65c451e1f9d9aab (diff) |
Merge tag 'for-5.3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs updates from David Sterba:
"Highlights:
- chunks that have been trimmed and unchanged since last mount are
tracked and skipped on repeated trims
- use hw assissed crc32c on more arches, speedups if native
instructions or optimized implementation is available
- the RAID56 incompat bit is automatically removed when the last
block group of that type is removed
Fixes:
- fsync fix for reflink on NODATACOW files that could lead to ENOSPC
- fix data loss after inode eviction, renaming it, and fsync it
- fix fsync not persisting dentry deletions due to inode evictions
- update ctime/mtime/iversion after hole punching
- fix compression type validation (reported by KASAN)
- send won't be allowed to start when relocation is in progress, this
can cause spurious errors or produce incorrect send stream
Core:
- new tracepoints for space update
- tree-checker: better check for end of extents for some tree items
- preparatory work for more checksum algorithms
- run delayed iput at unlink time and don't push the work to cleaner
thread where it's not properly throttled
- wrap block mapping to structures and helpers, base for further
refactoring
- split large files, part 1:
- space info handling
- block group reservations
- delayed refs
- delayed allocation
- other cleanups and refactoring"
* tag 'for-5.3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (103 commits)
btrfs: fix memory leak of path on error return path
btrfs: move the subvolume reservation stuff out of extent-tree.c
btrfs: migrate the delalloc space stuff to it's own home
btrfs: migrate btrfs_trans_release_chunk_metadata
btrfs: migrate the delayed refs rsv code
btrfs: Evaluate io_tree in find_lock_delalloc_range()
btrfs: migrate the global_block_rsv helpers to block-rsv.c
btrfs: migrate the block-rsv code to block-rsv.c
btrfs: stop using block_rsv_release_bytes everywhere
btrfs: cleanup the target logic in __btrfs_block_rsv_release
btrfs: export __btrfs_block_rsv_release
btrfs: export btrfs_block_rsv_add_bytes
btrfs: move btrfs_block_rsv definitions into it's own header
btrfs: Simplify update of space_info in __reserve_metadata_bytes()
btrfs: unexport can_overcommit
btrfs: move reserve_metadata_bytes and supporting code to space-info.c
btrfs: move dump_space_info to space-info.c
btrfs: export block_rsv_use_bytes
btrfs: move btrfs_space_info_add_*_bytes to space-info.c
btrfs: move the space info update macro to space-info.h
...
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r-- | fs/btrfs/backref.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 982152d3f920..89116afda7a2 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -1465,12 +1465,11 @@ int btrfs_find_all_roots(struct btrfs_trans_handle *trans, | |||
1465 | * | 1465 | * |
1466 | * Return: 0 if extent is not shared, 1 if it is shared, < 0 on error. | 1466 | * Return: 0 if extent is not shared, 1 if it is shared, < 0 on error. |
1467 | */ | 1467 | */ |
1468 | int btrfs_check_shared(struct btrfs_root *root, u64 inum, u64 bytenr) | 1468 | int btrfs_check_shared(struct btrfs_root *root, u64 inum, u64 bytenr, |
1469 | struct ulist *roots, struct ulist *tmp) | ||
1469 | { | 1470 | { |
1470 | struct btrfs_fs_info *fs_info = root->fs_info; | 1471 | struct btrfs_fs_info *fs_info = root->fs_info; |
1471 | struct btrfs_trans_handle *trans; | 1472 | struct btrfs_trans_handle *trans; |
1472 | struct ulist *tmp = NULL; | ||
1473 | struct ulist *roots = NULL; | ||
1474 | struct ulist_iterator uiter; | 1473 | struct ulist_iterator uiter; |
1475 | struct ulist_node *node; | 1474 | struct ulist_node *node; |
1476 | struct seq_list elem = SEQ_LIST_INIT(elem); | 1475 | struct seq_list elem = SEQ_LIST_INIT(elem); |
@@ -1481,12 +1480,8 @@ int btrfs_check_shared(struct btrfs_root *root, u64 inum, u64 bytenr) | |||
1481 | .share_count = 0, | 1480 | .share_count = 0, |
1482 | }; | 1481 | }; |
1483 | 1482 | ||
1484 | tmp = ulist_alloc(GFP_NOFS); | 1483 | ulist_init(roots); |
1485 | roots = ulist_alloc(GFP_NOFS); | 1484 | ulist_init(tmp); |
1486 | if (!tmp || !roots) { | ||
1487 | ret = -ENOMEM; | ||
1488 | goto out; | ||
1489 | } | ||
1490 | 1485 | ||
1491 | trans = btrfs_attach_transaction(root); | 1486 | trans = btrfs_attach_transaction(root); |
1492 | if (IS_ERR(trans)) { | 1487 | if (IS_ERR(trans)) { |
@@ -1527,8 +1522,8 @@ int btrfs_check_shared(struct btrfs_root *root, u64 inum, u64 bytenr) | |||
1527 | up_read(&fs_info->commit_root_sem); | 1522 | up_read(&fs_info->commit_root_sem); |
1528 | } | 1523 | } |
1529 | out: | 1524 | out: |
1530 | ulist_free(tmp); | 1525 | ulist_release(roots); |
1531 | ulist_free(roots); | 1526 | ulist_release(tmp); |
1532 | return ret; | 1527 | return ret; |
1533 | } | 1528 | } |
1534 | 1529 | ||