Skip to contentSkip to conversation

Btrfs, remove unused structure members

PATCH New David Sterba 1 participant 5 messages May 16, 2017 Btrfs file system

lore
Share & tools
lore

David Sterba

author maintainer
#0 lore raw

cover Btrfs, remove unused structure members

With some help of coccinelle and coccigrep I found a few stucture members that are completely unused, we can remove them and reduce structure sizes.

David Sterba (4):
btrfs: remove unused member err from reada_extent
btrfs: remove unused member list from async_submit_bio
btrfs: remove unused members dir_path from recorded_ref
btrfs: remove unused member list from btrfs_end_io_wq

 fs/btrfs/disk-io.c | 2 --
 fs/btrfs/reada.c   | 1 -
 fs/btrfs/send.c    | 8 --------
 3 files changed, 11 deletions(-)
Signature · 1 line
2.12.0
author maintainer
#1 lore raw

PATCH 1/4 btrfs: remove unused member err from reada_extent

Seems to be unused since the initial commit, we ignore readahead errors anyway, the full read will handle that if necessary.

---
 fs/btrfs/reada.c | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/reada.c +0 -1
index a17e775a4a89..ab852b8e3e37 100644
@@ -66,7 +66,6 @@ struct reada_extctl {
 struct reada_extent {
 	u64			logical;
 	struct btrfs_key	top;
-	int			err;
 	struct list_head	extctl;
 	int 			refcnt;
 	spinlock_t		lock;
Signature · 1 line
2.12.0
author maintainer
#2 lore raw

PATCH 2/4 btrfs: remove unused member list from async_submit_bio

In reply to David Sterba

The list used to track checksums in the early version (2.6.29), but I was able not pinpoint the commit that stopped using it. Everything apparently works without it for a long time.

---
 fs/btrfs/disk-io.c | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/disk-io.c +0 -1
index 8685d67185d0..db805632b4c0 100644
@@ -120,7 +120,6 @@ void btrfs_end_io_wq_exit(void)
 struct async_submit_bio {
 	struct inode *inode;
 	struct bio *bio;
-	struct list_head list;
 	extent_submit_bio_hook_t *submit_bio_start;
 	extent_submit_bio_hook_t *submit_bio_done;
 	int mirror_num;
Signature · 1 line
2.12.0
author maintainer
#3 lore raw

PATCH 3/4 btrfs: remove unused members dir_path from recorded_ref

In reply to David Sterba

The two members do not seem to be used since the initial commit.

---
 fs/btrfs/send.c | 8 --------
 1 file changed, 8 deletions(-)
fs/btrfs/send.c +0 -8
index fc496a6f842a..e8185c83f667 100644
@@ -2769,12 +2769,10 @@ static int send_create_inode_if_needed(struct send_ctx *sctx)
 
 struct recorded_ref {
 	struct list_head list;
-	char *dir_path;
 	char *name;
 	struct fs_path *full_path;
 	u64 dir;
 	u64 dir_gen;
-	int dir_path_len;
 	int name_len;
 };
 
@@ -2798,12 +2796,6 @@ static int __record_ref(struct list_head *head, u64 dir,
 
 	ref->name = (char *)kbasename(ref->full_path->start);
 	ref->name_len = ref->full_path->end - ref->name;
-	ref->dir_path = ref->full_path->start;
-	if (ref->name == ref->full_path->start)
-		ref->dir_path_len = 0;
-	else
-		ref->dir_path_len = ref->full_path->end -
-				ref->full_path->start - 1 - ref->name_len;
 
 	list_add_tail(&ref->list, head);
 	return 0;
Signature · 1 line
2.12.0
author maintainer
#4 lore raw

PATCH 4/4 btrfs: remove unused member list from btrfs_end_io_wq

In reply to David Sterba

The end io work queue items have been tracked by the work queues since "Btrfs: Add async worker threads for pre and post IO checksumming" (8b7128429235d9bd72cfd5e) (2008).

---
 fs/btrfs/disk-io.c | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/disk-io.c +0 -1
index db805632b4c0..48b58a1f989e 100644
@@ -89,7 +89,6 @@ struct btrfs_end_io_wq {
 	struct btrfs_fs_info *info;
 	int error;
 	enum btrfs_wq_endio_type metadata;
-	struct list_head list;
 	struct btrfs_work work;
 };
 
Signature · 1 line
2.12.0