Btrfs, remove unused structure members
David Sterba
maintainercover 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
David Sterba
maintainerPATCH 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
@@ -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
David Sterba
maintainerPATCH 2/4 btrfs: remove unused member list from async_submit_bio
In reply to David SterbaThe 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
@@ -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
David Sterba
maintainerPATCH 3/4 btrfs: remove unused members dir_path from recorded_ref
In reply to David SterbaThe 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
@@ -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
David Sterba
maintainerPATCH 4/4 btrfs: remove unused member list from btrfs_end_io_wq
In reply to David SterbaThe 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
@@ -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