linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs-progs: Remove unused parameter trans
@ 2017-10-31  9:23 Gu Jinxiang
  2017-10-31  9:23 ` [PATCH 2/2] btrfs-progs: Remove unused variable Gu Jinxiang
  2018-01-08 18:26 ` [PATCH 1/2] btrfs-progs: Remove unused parameter trans David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Gu Jinxiang @ 2017-10-31  9:23 UTC (permalink / raw)
  To: linux-btrfs

Some parameter of trans is not used indeed.
Let's remove them.

Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
---
 cmds-check.c  |  9 ++++-----
 ctree.h       |  3 +--
 extent-tree.c | 18 ++++++++----------
 3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index a6198bad..a7a36ee9 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -2626,8 +2626,7 @@ static int repair_tree_block_ref(struct btrfs_trans_handle *trans,
 		}
 		btrfs_mark_buffer_dirty(eb);
 		printf("Added an extent item [%llu %u]\n", bytenr, node_size);
-		btrfs_update_block_group(trans, extent_root, bytenr, node_size,
-					 1, 0);
+		btrfs_update_block_group(extent_root, bytenr, node_size, 1, 0);
 
 		nrefs->refs[level] = 0;
 		nrefs->full_backref[level] =
@@ -9656,7 +9655,7 @@ static int delete_extent_records(struct btrfs_trans_handle *trans,
 			u64 bytes = (found_key.type == BTRFS_EXTENT_ITEM_KEY) ?
 				found_key.offset : root->fs_info->nodesize;
 
-			ret = btrfs_update_block_group(trans, root, bytenr,
+			ret = btrfs_update_block_group(root, bytenr,
 						       bytes, 0, 0);
 			if (ret)
 				break;
@@ -9735,7 +9734,7 @@ static int record_extent(struct btrfs_trans_handle *trans,
 		}
 
 		btrfs_mark_buffer_dirty(leaf);
-		ret = btrfs_update_block_group(trans, extent_root, rec->start,
+		ret = btrfs_update_block_group(extent_root, rec->start,
 					       rec->max_size, 1, 0);
 		if (ret)
 			goto fail;
@@ -11944,7 +11943,7 @@ static int repair_extent_data_item(struct btrfs_trans_handle *trans,
 		btrfs_set_extent_flags(eb, ei, BTRFS_EXTENT_FLAG_DATA);
 
 		btrfs_mark_buffer_dirty(eb);
-		ret = btrfs_update_block_group(trans, extent_root, disk_bytenr,
+		ret = btrfs_update_block_group(extent_root, disk_bytenr,
 					       num_bytes, 1, 0);
 		btrfs_release_path(&path);
 	}
diff --git a/ctree.h b/ctree.h
index b92df1c1..a8f0ec5e 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2504,8 +2504,7 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans,
 			   u64 size);
 int btrfs_make_block_groups(struct btrfs_trans_handle *trans,
 			    struct btrfs_fs_info *fs_info);
-int btrfs_update_block_group(struct btrfs_trans_handle *trans,
-			     struct btrfs_root *root, u64 bytenr, u64 num,
+int btrfs_update_block_group(struct btrfs_root *root, u64 bytenr, u64 num,
 			     int alloc, int mark_free);
 int btrfs_record_file_extent(struct btrfs_trans_handle *trans,
 			      struct btrfs_root *root, u64 objectid,
diff --git a/extent-tree.c b/extent-tree.c
index 055582c3..edf659d5 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -1921,8 +1921,7 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans,
 	return 0;
 }
 
-static int update_block_group(struct btrfs_trans_handle *trans,
-			      struct btrfs_root *root,
+static int update_block_group(struct btrfs_root *root,
 			      u64 bytenr, u64 num_bytes, int alloc,
 			      int mark_free)
 {
@@ -2387,7 +2386,7 @@ static int __free_extent(struct btrfs_trans_handle *trans,
 			BUG_ON(ret);
 		}
 
-		update_block_group(trans, root, bytenr, num_bytes, 0, mark_free);
+		update_block_group(root, bytenr, num_bytes, 0, mark_free);
 	}
 fail:
 	btrfs_free_path(path);
@@ -2747,7 +2746,7 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
 	btrfs_mark_buffer_dirty(leaf);
 	btrfs_free_path(path);
 
-	ret = update_block_group(trans, root, ins->objectid, fs_info->nodesize,
+	ret = update_block_group(root, ins->objectid, fs_info->nodesize,
 				 1, 0);
 	return ret;
 }
@@ -3474,12 +3473,11 @@ int btrfs_make_block_groups(struct btrfs_trans_handle *trans,
 	return 0;
 }
 
-int btrfs_update_block_group(struct btrfs_trans_handle *trans,
-			     struct btrfs_root *root,
+int btrfs_update_block_group(struct btrfs_root *root,
 			     u64 bytenr, u64 num_bytes, int alloc,
 			     int mark_free)
 {
-	return update_block_group(trans, root, bytenr, num_bytes,
+	return update_block_group(root, bytenr, num_bytes,
 				  alloc, mark_free);
 }
 
@@ -3898,12 +3896,12 @@ int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans,
 		btrfs_item_key_to_cpu(leaf, &key, slot);
 		if (key.type == BTRFS_EXTENT_ITEM_KEY) {
 			bytes_used += key.offset;
-			ret = btrfs_update_block_group(trans, root,
+			ret = btrfs_update_block_group(root,
 				  key.objectid, key.offset, 1, 0);
 			BUG_ON(ret);
 		} else if (key.type == BTRFS_METADATA_ITEM_KEY) {
 			bytes_used += fs_info->nodesize;
-			ret = btrfs_update_block_group(trans, root,
+			ret = btrfs_update_block_group(root,
 				  key.objectid, fs_info->nodesize, 1, 0);
 			if (ret)
 				goto out;
@@ -4058,7 +4056,7 @@ static int __btrfs_record_file_extent(struct btrfs_trans_handle *trans,
 					       BTRFS_EXTENT_FLAG_DATA);
 			btrfs_mark_buffer_dirty(leaf);
 
-			ret = btrfs_update_block_group(trans, root, disk_bytenr,
+			ret = btrfs_update_block_group(root, disk_bytenr,
 						       num_bytes, 1, 0);
 			if (ret)
 				goto fail;
-- 
2.13.6




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

* [PATCH 2/2] btrfs-progs: Remove unused variable
  2017-10-31  9:23 [PATCH 1/2] btrfs-progs: Remove unused parameter trans Gu Jinxiang
@ 2017-10-31  9:23 ` Gu Jinxiang
  2018-01-08 18:26 ` [PATCH 1/2] btrfs-progs: Remove unused parameter trans David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Gu Jinxiang @ 2017-10-31  9:23 UTC (permalink / raw)
  To: linux-btrfs

Some variable is never used.
Remove them.

Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
---
 Android.mk | 1 -
 Makefile   | 2 --
 2 files changed, 3 deletions(-)

diff --git a/Android.mk b/Android.mk
index 958b8bd7..de71a5d1 100644
--- a/Android.mk
+++ b/Android.mk
@@ -38,7 +38,6 @@ libbtrfs_headers := send-stream.h send-utils.h send.h kernel-lib/rbtree.h btrfs-
                    kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
                    kernel-lib/radix-tree.h kernel-lib/sizes.h kernel-lib/raid56.h \
                    extent-cache.h extent_io.h ioctl.h ctree.h btrfsck.h version.h
-TESTS := fsck-tests.sh convert-tests.sh
 blkid_objects := partition/ superblocks/ topology/
 
 
diff --git a/Makefile b/Makefile
index 8ca5e63f..7c12f222 100644
--- a/Makefile
+++ b/Makefile
@@ -129,8 +129,6 @@ image_objects = image/main.o image/sanitize.o
 all_objects = $(objects) $(cmds_objects) $(libbtrfs_objects) $(convert_objects) \
 	      $(mkfs_objects) $(image_objects)
 
-TESTS = fsck-tests.sh convert-tests.sh
-
 udev_rules = 64-btrfs-dm.rules
 
 ifeq ("$(origin V)", "command line")
-- 
2.13.6




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

* Re: [PATCH 1/2] btrfs-progs: Remove unused parameter trans
  2017-10-31  9:23 [PATCH 1/2] btrfs-progs: Remove unused parameter trans Gu Jinxiang
  2017-10-31  9:23 ` [PATCH 2/2] btrfs-progs: Remove unused variable Gu Jinxiang
@ 2018-01-08 18:26 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2018-01-08 18:26 UTC (permalink / raw)
  To: Gu Jinxiang; +Cc: linux-btrfs

On Tue, Oct 31, 2017 at 05:23:03PM +0800, Gu Jinxiang wrote:
> Some parameter of trans is not used indeed.
> Let's remove them.
> 
> Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>

1 and 2 applied, thanks.

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

end of thread, other threads:[~2018-01-08 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-31  9:23 [PATCH 1/2] btrfs-progs: Remove unused parameter trans Gu Jinxiang
2017-10-31  9:23 ` [PATCH 2/2] btrfs-progs: Remove unused variable Gu Jinxiang
2018-01-08 18:26 ` [PATCH 1/2] btrfs-progs: Remove unused parameter trans David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).