From 1e4abbdf96cae7cbf17a3bf1376d7a56e78153fa Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 3 May 2016 16:20:52 +0200 Subject: btrfs-progs: use ioctl search headers everywhere Generated by following semantic patch and manually tweaked. @@ struct btrfs_ioctl_search_header *SH; @@ ( - SH->objectid + btrfs_search_header_objectid(SH) | - SH->offset + btrfs_search_header_offset(SH) | - SH->transid + btrfs_search_header_transid(SH) | - SH->len + btrfs_search_header_len(SH) | - SH->type + btrfs_search_header_type(SH) ) Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=112131 Reported-and-tested-by: Anatoly Pugachev Signed-off-by: David Sterba --- cmds-subvolume.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'cmds-subvolume.c') diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 2319684e..7c8ab8f2 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -1142,7 +1142,8 @@ static int enumerate_dead_subvols(int fd, u64 **ids) sh = (struct btrfs_ioctl_search_header*)(args.buf + off); off += sizeof(*sh); - if (sh->type == BTRFS_ORPHAN_ITEM_KEY) { + if (btrfs_search_header_type(sh) + == BTRFS_ORPHAN_ITEM_KEY) { if (idx >= count) { u64 *newids; @@ -1153,14 +1154,14 @@ static int enumerate_dead_subvols(int fd, u64 **ids) return -ENOMEM; *ids = newids; } - (*ids)[idx] = sh->offset; + (*ids)[idx] = btrfs_search_header_offset(sh); idx++; } - off += sh->len; + off += btrfs_search_header_len(sh); - sk->min_objectid = sh->objectid; - sk->min_type = sh->type; - sk->min_offset = sh->offset; + sk->min_objectid = btrfs_search_header_objectid(sh); + sk->min_type = btrfs_search_header_type(sh); + sk->min_offset = btrfs_search_header_offset(sh); } if (sk->min_offset < (u64)-1) sk->min_offset++; -- cgit v1.2.3