All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs: remove superfluous chunk_tree argument from btrfs_alloc_dev_extent
@ 2017-07-27 17:36 Nikolay Borisov
  2017-07-27 17:36 ` [PATCH 2/2] btrfs: Simplify btrfs_alloc_dev_extent Nikolay Borisov
  2017-08-18 14:14 ` [PATCH 1/2] btrfs: remove superfluous chunk_tree argument from btrfs_alloc_dev_extent David Sterba
  0 siblings, 2 replies; 11+ messages in thread
From: Nikolay Borisov @ 2017-07-27 17:36 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

Currently this function is always called with the object id of the root key of
the chunk_tree, which is always BTRFS_CHUNK_TREE_OBJECTID. So let's subsume it
straight into the function itself. No functional change.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/volumes.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1c0a5fff0e2f..5a1913956f20 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1578,8 +1578,7 @@ static int btrfs_free_dev_extent(struct btrfs_trans_handle *trans,
 
 static int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
 				  struct btrfs_device *device,
-				  u64 chunk_tree, u64 chunk_offset, u64 start,
-				  u64 num_bytes)
+				  u64 chunk_offset, u64 start, u64 num_bytes)
 {
 	int ret;
 	struct btrfs_path *path;
@@ -1606,7 +1605,8 @@ static int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
 	leaf = path->nodes[0];
 	extent = btrfs_item_ptr(leaf, path->slots[0],
 				struct btrfs_dev_extent);
-	btrfs_set_dev_extent_chunk_tree(leaf, extent, chunk_tree);
+	btrfs_set_dev_extent_chunk_tree(leaf, extent,
+					BTRFS_CHUNK_TREE_OBJECTID);
 	btrfs_set_dev_extent_chunk_objectid(leaf, extent,
 					    BTRFS_FIRST_CHUNK_TREE_OBJECTID);
 	btrfs_set_dev_extent_chunk_offset(leaf, extent, chunk_offset);
@@ -4931,10 +4931,8 @@ int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans,
 		ret = btrfs_update_device(trans, device);
 		if (ret)
 			break;
-		ret = btrfs_alloc_dev_extent(trans, device,
-					     chunk_root->root_key.objectid,
-					     chunk_offset, dev_offset,
-					     stripe_size);
+		ret = btrfs_alloc_dev_extent(trans, device, chunk_offset,
+					     dev_offset, stripe_size);
 		if (ret)
 			break;
 	}
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-08-21 16:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-27 17:36 [PATCH 1/2] btrfs: remove superfluous chunk_tree argument from btrfs_alloc_dev_extent Nikolay Borisov
2017-07-27 17:36 ` [PATCH 2/2] btrfs: Simplify btrfs_alloc_dev_extent Nikolay Borisov
2017-07-27 17:57   ` Filipe Manana
2017-07-28  5:59     ` Nikolay Borisov
2017-07-28  7:10       ` Filipe Manana
2017-08-18 14:22       ` David Sterba
2017-08-18 14:14 ` [PATCH 1/2] btrfs: remove superfluous chunk_tree argument from btrfs_alloc_dev_extent David Sterba
2017-08-18 14:58   ` [PATCH 1/2] btrfs: Remove chunk_objectid parameter of btrfs_alloc_dev_extent Nikolay Borisov
2017-08-18 14:58     ` [PATCH 2/2] btrfs: remove superfluous chunk_tree argument from btrfs_alloc_dev_extent Nikolay Borisov
2017-08-21 16:29       ` David Sterba
2017-08-21 16:29     ` [PATCH 1/2] btrfs: Remove chunk_objectid parameter of btrfs_alloc_dev_extent David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.