Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 Jeff Mahoney <jeffm@suse.com> |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 3 | * Copyright (c) 2016-2018 The strace developers. |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 4 | * All rights reserved. |
| 5 | * |
| 6 | * Redistribution and use in source and binary forms, with or without |
| 7 | * modification, are permitted provided that the following conditions |
| 8 | * are met: |
| 9 | * 1. Redistributions of source code must retain the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer. |
| 11 | * 2. Redistributions in binary form must reproduce the above copyright |
| 12 | * notice, this list of conditions and the following disclaimer in the |
| 13 | * documentation and/or other materials provided with the distribution. |
| 14 | * 3. The name of the author may not be used to endorse or promote products |
| 15 | * derived from this software without specific prior written permission. |
| 16 | * |
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | #include "defs.h" |
Dmitry V. Levin | fb0c609 | 2016-05-24 01:28:26 +0000 | [diff] [blame] | 30 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 31 | #ifdef HAVE_LINUX_BTRFS_H |
Dmitry V. Levin | fb0c609 | 2016-05-24 01:28:26 +0000 | [diff] [blame] | 32 | |
| 33 | #include DEF_MPERS_TYPE(struct_btrfs_ioctl_dev_replace_args) |
| 34 | #include DEF_MPERS_TYPE(struct_btrfs_ioctl_send_args) |
| 35 | #include DEF_MPERS_TYPE(struct_btrfs_ioctl_received_subvol_args) |
Dmitry V. Levin | e7d3d64 | 2016-08-25 21:24:33 +0000 | [diff] [blame] | 36 | #include DEF_MPERS_TYPE(struct_btrfs_ioctl_vol_args_v2) |
Dmitry V. Levin | fb0c609 | 2016-05-24 01:28:26 +0000 | [diff] [blame] | 37 | |
| 38 | # include <linux/btrfs.h> |
| 39 | |
| 40 | typedef struct btrfs_ioctl_dev_replace_args |
| 41 | struct_btrfs_ioctl_dev_replace_args; |
| 42 | typedef struct btrfs_ioctl_send_args |
| 43 | struct_btrfs_ioctl_send_args; |
| 44 | typedef struct btrfs_ioctl_received_subvol_args |
| 45 | struct_btrfs_ioctl_received_subvol_args; |
Dmitry V. Levin | e7d3d64 | 2016-08-25 21:24:33 +0000 | [diff] [blame] | 46 | typedef struct btrfs_ioctl_vol_args_v2 |
| 47 | struct_btrfs_ioctl_vol_args_v2; |
Dmitry V. Levin | fb0c609 | 2016-05-24 01:28:26 +0000 | [diff] [blame] | 48 | |
| 49 | #endif /* HAVE_LINUX_BTRFS_H */ |
| 50 | |
| 51 | #include MPERS_DEFS |
| 52 | |
| 53 | #ifdef HAVE_LINUX_BTRFS_H |
| 54 | |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 55 | #include "print_fields.h" |
Dmitry V. Levin | fb0c609 | 2016-05-24 01:28:26 +0000 | [diff] [blame] | 56 | #include <linux/fs.h> |
| 57 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 58 | /* |
| 59 | * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in |
| 60 | * its definition, which isn't exported by the kernel. |
| 61 | */ |
| 62 | typedef __u64 u64; |
| 63 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 64 | #ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS |
| 65 | struct btrfs_ioctl_feature_flags { |
| 66 | uint64_t compat_flags; |
| 67 | uint64_t compat_ro_flags; |
| 68 | uint64_t incompat_flags; |
| 69 | }; |
| 70 | #endif |
| 71 | |
| 72 | #ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START |
| 73 | struct btrfs_ioctl_defrag_range_args { |
| 74 | uint64_t start; |
| 75 | uint64_t len; |
| 76 | uint64_t flags; |
| 77 | uint32_t extent_thresh; |
| 78 | uint32_t compress_type; |
| 79 | uint32_t unused[4]; |
| 80 | }; |
| 81 | #endif |
| 82 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 83 | #ifndef BTRFS_LABEL_SIZE |
Dmitry V. Levin | 2be39ec | 2016-05-24 00:23:31 +0000 | [diff] [blame] | 84 | # define BTRFS_LABEL_SIZE 256 |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 85 | #endif |
| 86 | |
Dmitry V. Levin | fe7a451 | 2016-06-17 03:02:46 +0300 | [diff] [blame] | 87 | #ifndef BTRFS_IOC_QUOTA_RESCAN |
| 88 | struct btrfs_ioctl_quota_rescan_args { |
| 89 | uint64_t flags, progress, reserved[6]; |
| 90 | }; |
| 91 | # define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ |
| 92 | struct btrfs_ioctl_quota_rescan_args) |
| 93 | # define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ |
| 94 | struct btrfs_ioctl_quota_rescan_args) |
| 95 | #endif |
| 96 | |
| 97 | #ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT |
| 98 | # define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) |
| 99 | #endif |
| 100 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 101 | #ifndef BTRFS_IOC_GET_FEATURES |
Dmitry V. Levin | 2be39ec | 2016-05-24 00:23:31 +0000 | [diff] [blame] | 102 | # define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ |
| 103 | struct btrfs_ioctl_feature_flags) |
| 104 | # define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ |
| 105 | struct btrfs_ioctl_feature_flags[2]) |
| 106 | # define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ |
| 107 | struct btrfs_ioctl_feature_flags[3]) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 108 | #endif |
| 109 | |
| 110 | #ifndef BTRFS_IOC_TREE_SEARCH_V2 |
Dmitry V. Levin | 2be39ec | 2016-05-24 00:23:31 +0000 | [diff] [blame] | 111 | # define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ |
| 112 | struct btrfs_ioctl_search_args_v2) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 113 | struct btrfs_ioctl_search_args_v2 { |
| 114 | struct btrfs_ioctl_search_key key; /* in/out - search parameters */ |
| 115 | uint64_t buf_size; /* in - size of buffer |
| 116 | * out - on EOVERFLOW: needed size |
| 117 | * to store item */ |
| 118 | uint64_t buf[0]; /* out - found items */ |
| 119 | }; |
| 120 | #endif |
| 121 | |
| 122 | #include "xlat/btrfs_balance_args.h" |
| 123 | #include "xlat/btrfs_balance_ctl_cmds.h" |
| 124 | #include "xlat/btrfs_balance_flags.h" |
| 125 | #include "xlat/btrfs_balance_state.h" |
| 126 | #include "xlat/btrfs_compress_types.h" |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 127 | #include "xlat/btrfs_cont_reading_from_srcdev_mode.h" |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 128 | #include "xlat/btrfs_defrag_flags.h" |
| 129 | #include "xlat/btrfs_dev_replace_cmds.h" |
| 130 | #include "xlat/btrfs_dev_replace_results.h" |
| 131 | #include "xlat/btrfs_dev_replace_state.h" |
| 132 | #include "xlat/btrfs_dev_stats_flags.h" |
| 133 | #include "xlat/btrfs_dev_stats_values.h" |
| 134 | #include "xlat/btrfs_features_compat.h" |
| 135 | #include "xlat/btrfs_features_compat_ro.h" |
| 136 | #include "xlat/btrfs_features_incompat.h" |
| 137 | #include "xlat/btrfs_key_types.h" |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 138 | #include "xlat/btrfs_logical_ino_args_flags.h" |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 139 | #include "xlat/btrfs_qgroup_ctl_cmds.h" |
| 140 | #include "xlat/btrfs_qgroup_inherit_flags.h" |
| 141 | #include "xlat/btrfs_qgroup_limit_flags.h" |
| 142 | #include "xlat/btrfs_qgroup_status_flags.h" |
| 143 | #include "xlat/btrfs_scrub_flags.h" |
| 144 | #include "xlat/btrfs_send_flags.h" |
| 145 | #include "xlat/btrfs_snap_flags_v2.h" |
| 146 | #include "xlat/btrfs_space_info_flags.h" |
| 147 | #include "xlat/btrfs_tree_objectids.h" |
| 148 | |
| 149 | static inline char |
| 150 | prnibble(char v) |
| 151 | { |
| 152 | if (v >= 10) |
| 153 | return 'a' + (v - 10); |
| 154 | return '0' + v; |
| 155 | } |
| 156 | |
| 157 | /* 8-4-4-4-12 = 36 characters */ |
| 158 | #define UUID_STRING_SIZE 36 |
| 159 | |
| 160 | /* Formats uuid, returns 0 if it's all zeroes */ |
| 161 | static int |
| 162 | btrfs_unparse_uuid(unsigned char *uuid, char *out) |
| 163 | { |
| 164 | int i; |
| 165 | int ret = 0; |
| 166 | for (i = 0; i < BTRFS_UUID_SIZE; i++) { |
| 167 | if (i == 4 || i == 6 || i == 8 || i == 10) |
| 168 | *out++ = '-'; |
| 169 | *out++ = prnibble(uuid[i] >> 4); |
| 170 | *out++ = prnibble(uuid[i] & 0xf); |
| 171 | if (uuid[i]) |
| 172 | ret = 1; |
| 173 | } |
| 174 | *out = '\0'; |
| 175 | return ret; |
| 176 | } |
| 177 | |
| 178 | static void |
Dmitry V. Levin | b85d09f | 2016-05-24 00:56:08 +0000 | [diff] [blame] | 179 | btrfs_print_balance_args(const char *name, const struct btrfs_balance_args *bba) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 180 | { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 181 | tprintf(", %s=", name); |
| 182 | PRINT_FIELD_FLAGS("{", *bba, profiles, btrfs_space_info_flags, |
| 183 | "BTRFS_BLOCK_GROUP_???"); |
| 184 | PRINT_FIELD_U64(", ", *bba, usage); |
| 185 | PRINT_FIELD_DEV(", ", *bba, devid); |
| 186 | PRINT_FIELD_U64(", ", *bba, pstart); |
| 187 | PRINT_FIELD_U64(", ", *bba, pend); |
| 188 | PRINT_FIELD_U64(", ", *bba, vstart); |
| 189 | PRINT_FIELD_U64(", ", *bba, vend); |
| 190 | PRINT_FIELD_U64(", ", *bba, target); |
| 191 | PRINT_FIELD_FLAGS(", ", *bba, flags, btrfs_balance_args, |
| 192 | "BTRFS_BALANCE_ARGS_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 193 | tprints("}"); |
| 194 | } |
| 195 | |
| 196 | static void |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 197 | btrfs_print_balance(struct tcb *const tcp, const kernel_ulong_t arg, bool out) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 198 | { |
| 199 | struct btrfs_ioctl_balance_args balance_args; |
| 200 | |
| 201 | if (umove_or_printaddr(tcp, arg, &balance_args)) |
| 202 | return; |
| 203 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 204 | PRINT_FIELD_FLAGS("{", balance_args, flags, btrfs_balance_flags, |
| 205 | "BTRFS_BALANCE_???"); |
| 206 | if (out) |
| 207 | PRINT_FIELD_FLAGS(", ", balance_args, state, |
| 208 | btrfs_balance_state, |
| 209 | "BTRFS_BALANCE_STATE_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 210 | |
| 211 | if (balance_args.flags & BTRFS_BALANCE_DATA) |
| 212 | btrfs_print_balance_args("data", &balance_args.data); |
| 213 | if (balance_args.flags & BTRFS_BALANCE_METADATA) |
| 214 | btrfs_print_balance_args("meta", &balance_args.meta); |
| 215 | if (balance_args.flags & BTRFS_BALANCE_SYSTEM) |
| 216 | btrfs_print_balance_args("sys", &balance_args.sys); |
| 217 | tprints("}"); |
| 218 | } |
| 219 | |
| 220 | static void |
Dmitry V. Levin | b85d09f | 2016-05-24 00:56:08 +0000 | [diff] [blame] | 221 | btrfs_print_features(const struct btrfs_ioctl_feature_flags *flags) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 222 | { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 223 | PRINT_FIELD_FLAGS("{", *flags, compat_flags, btrfs_features_compat, |
| 224 | "BTRFS_FEATURE_COMPAT_???"); |
| 225 | PRINT_FIELD_FLAGS(", ", *flags, compat_ro_flags, |
| 226 | btrfs_features_compat_ro, |
| 227 | "BTRFS_FEATURE_COMPAT_RO_???"); |
| 228 | PRINT_FIELD_FLAGS(", ", *flags, incompat_flags, btrfs_features_incompat, |
| 229 | "BTRFS_FEATURE_INCOMPAT_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 230 | tprints("}"); |
| 231 | } |
| 232 | |
| 233 | static void |
Dmitry V. Levin | b85d09f | 2016-05-24 00:56:08 +0000 | [diff] [blame] | 234 | btrfs_print_qgroup_limit(const struct btrfs_qgroup_limit *lim) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 235 | { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 236 | PRINT_FIELD_FLAGS(", lim={", *lim, flags, btrfs_qgroup_limit_flags, |
| 237 | "BTRFS_QGROUP_LIMIT_???"); |
| 238 | PRINT_FIELD_U(", ", *lim, max_rfer); |
| 239 | PRINT_FIELD_U(", ", *lim, max_excl); |
| 240 | PRINT_FIELD_U(", ", *lim, rsv_rfer); |
| 241 | PRINT_FIELD_U(", ", *lim, rsv_excl); |
| 242 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 243 | } |
| 244 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 245 | #define btrfs_print_key_type(prefix_, where_, field_) \ |
| 246 | PRINT_FIELD_XVAL_U((prefix_), (where_), field_, btrfs_key_types, NULL) |
| 247 | #define btrfs_print_objectid(prefix_, where_, field_) \ |
| 248 | PRINT_FIELD_XVAL_U((prefix_), (where_), field_, btrfs_tree_objectids, \ |
| 249 | NULL) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 250 | |
| 251 | static void |
Dmitry V. Levin | b85d09f | 2016-05-24 00:56:08 +0000 | [diff] [blame] | 252 | btrfs_print_data_container_header(const struct btrfs_data_container *container) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 253 | { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 254 | PRINT_FIELD_U("{", *container, bytes_left); |
| 255 | PRINT_FIELD_U(", ", *container, bytes_missing); |
| 256 | PRINT_FIELD_U(", ", *container, elem_cnt); |
| 257 | PRINT_FIELD_U(", ", *container, elem_missed); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | static void |
| 261 | btrfs_print_data_container_footer(void) |
| 262 | { |
| 263 | tprints("}"); |
| 264 | } |
| 265 | |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 266 | static bool |
| 267 | print_btrfs_data_container_logical_ino(struct tcb *tcp, void *elem_buf, |
| 268 | size_t elem_size, void *data) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 269 | { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 270 | const struct { |
| 271 | uint64_t inum; |
| 272 | uint64_t offset; |
| 273 | uint64_t root; |
| 274 | } *const record = elem_buf; |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 275 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 276 | PRINT_FIELD_U("{", *record, inum); |
| 277 | PRINT_FIELD_U(", ", *record, offset); |
| 278 | PRINT_FIELD_U(", ", *record, root); |
| 279 | tprints("}"); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 280 | |
| 281 | return true; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 282 | } |
| 283 | |
| 284 | static void |
Dmitry V. Levin | b85d09f | 2016-05-24 00:56:08 +0000 | [diff] [blame] | 285 | btrfs_print_logical_ino_container(struct tcb *tcp, |
| 286 | const uint64_t inodes_addr) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 287 | { |
| 288 | struct btrfs_data_container container; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 289 | |
Dmitry V. Levin | 90ffbc7 | 2016-05-24 00:49:50 +0000 | [diff] [blame] | 290 | if (umove_or_printaddr(tcp, inodes_addr, &container)) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 291 | return; |
| 292 | |
| 293 | btrfs_print_data_container_header(&container); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 294 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 295 | if (abbrev(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 296 | tprints(", ..."); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 297 | } else { |
| 298 | const uint64_t val_addr = |
| 299 | inodes_addr + offsetof(typeof(container), val); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 300 | uint64_t record[3]; |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 301 | tprints(", val="); |
Jeff Mahoney | 2060d97 | 2016-05-26 23:33:03 -0400 | [diff] [blame] | 302 | print_array(tcp, val_addr, container.elem_cnt / 3, |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 303 | record, sizeof(record), |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 304 | tfetch_mem, |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 305 | print_btrfs_data_container_logical_ino, 0); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 306 | } |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 307 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 308 | btrfs_print_data_container_footer(); |
| 309 | } |
| 310 | |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 311 | static bool |
| 312 | print_btrfs_data_container_ino_path(struct tcb *tcp, void *elem_buf, |
| 313 | size_t elem_size, void *data) |
| 314 | { |
| 315 | const uint64_t *const offset = elem_buf; |
| 316 | const uint64_t *const val_addr = data; |
| 317 | |
| 318 | printpath(tcp, *val_addr + *offset); |
| 319 | |
| 320 | return true; |
| 321 | } |
| 322 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 323 | static void |
Dmitry V. Levin | b85d09f | 2016-05-24 00:56:08 +0000 | [diff] [blame] | 324 | btrfs_print_ino_path_container(struct tcb *tcp, |
| 325 | const uint64_t fspath_addr) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 326 | { |
| 327 | struct btrfs_data_container container; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 328 | |
Dmitry V. Levin | 90ffbc7 | 2016-05-24 00:49:50 +0000 | [diff] [blame] | 329 | if (umove_or_printaddr(tcp, fspath_addr, &container)) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 330 | return; |
| 331 | |
| 332 | btrfs_print_data_container_header(&container); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 333 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 334 | if (abbrev(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 335 | tprints(", ..."); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 336 | } else { |
| 337 | uint64_t val_addr = |
| 338 | fspath_addr + offsetof(typeof(container), val); |
| 339 | uint64_t offset; |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 340 | tprints(", val="); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 341 | print_array(tcp, val_addr, container.elem_cnt, |
| 342 | &offset, sizeof(offset), |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 343 | tfetch_mem, |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 344 | print_btrfs_data_container_ino_path, &val_addr); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 345 | } |
| 346 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 347 | btrfs_print_data_container_footer(); |
| 348 | } |
| 349 | |
| 350 | static void |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 351 | btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ulong_t qgi_addr) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 352 | { |
| 353 | struct btrfs_qgroup_inherit inherit; |
| 354 | |
Dmitry V. Levin | 90ffbc7 | 2016-05-24 00:49:50 +0000 | [diff] [blame] | 355 | if (umove_or_printaddr(tcp, qgi_addr, &inherit)) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 356 | return; |
| 357 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 358 | PRINT_FIELD_FLAGS("{", inherit, flags, btrfs_qgroup_inherit_flags, |
| 359 | "BTRFS_QGROUP_INHERIT_???"); |
| 360 | PRINT_FIELD_U(", ", inherit, num_qgroups); |
| 361 | PRINT_FIELD_U(", ", inherit, num_ref_copies); |
| 362 | PRINT_FIELD_U(", ", inherit, num_excl_copies); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 363 | |
| 364 | btrfs_print_qgroup_limit(&inherit.lim); |
| 365 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 366 | if (abbrev(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 367 | tprints(", ..."); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 368 | } else { |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 369 | uint64_t record; |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 370 | tprints(", qgroups="); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 371 | print_array(tcp, qgi_addr + offsetof(typeof(inherit), qgroups), |
| 372 | inherit.num_qgroups, &record, sizeof(record), |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 373 | tfetch_mem, print_uint64_array_member, 0); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 374 | } |
| 375 | tprints("}"); |
| 376 | } |
| 377 | |
| 378 | static void |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 379 | btrfs_print_tree_search(struct tcb *tcp, struct btrfs_ioctl_search_key *key, |
| 380 | uint64_t buf_addr, uint64_t buf_size, bool print_size) |
| 381 | { |
| 382 | if (entering(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 383 | btrfs_print_objectid("{key={", *key, tree_id); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 384 | |
| 385 | if (key->min_objectid != BTRFS_FIRST_FREE_OBJECTID || |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 386 | !abbrev(tcp)) |
| 387 | btrfs_print_objectid(", ", *key, min_objectid); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 388 | |
| 389 | if (key->max_objectid != BTRFS_LAST_FREE_OBJECTID || |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 390 | !abbrev(tcp)) |
| 391 | btrfs_print_objectid(", ", *key, max_objectid); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 392 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 393 | PRINT_FIELD_U64(", ", *key, min_offset); |
| 394 | PRINT_FIELD_U64(", ", *key, max_offset); |
| 395 | PRINT_FIELD_U64(", ", *key, min_transid); |
| 396 | PRINT_FIELD_U64(", ", *key, max_transid); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 397 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 398 | btrfs_print_key_type(", ", *key, min_type); |
| 399 | btrfs_print_key_type(", ", *key, max_type); |
| 400 | PRINT_FIELD_U(", ", *key, nr_items); |
| 401 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 402 | if (print_size) |
| 403 | tprintf(", buf_size=%" PRIu64, buf_size); |
| 404 | tprints("}"); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 405 | } else { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 406 | PRINT_FIELD_U("{key={", *key, nr_items); |
| 407 | tprints("}"); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 408 | if (print_size) |
| 409 | tprintf(", buf_size=%" PRIu64, buf_size); |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 410 | if (abbrev(tcp)) { |
| 411 | tprints(", ..."); |
| 412 | } else { |
Jeff Mahoney | d32d95a | 2016-05-26 23:33:04 -0400 | [diff] [blame] | 413 | uint64_t i; |
| 414 | uint64_t off = 0; |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 415 | tprints(", buf=["); |
Jeff Mahoney | d32d95a | 2016-05-26 23:33:04 -0400 | [diff] [blame] | 416 | for (i = 0; i < key->nr_items; i++) { |
| 417 | struct btrfs_ioctl_search_header sh; |
| 418 | uint64_t addr = buf_addr + off; |
| 419 | if (i) |
| 420 | tprints(", "); |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 421 | if (i > max_strlen) { |
Jeff Mahoney | d32d95a | 2016-05-26 23:33:04 -0400 | [diff] [blame] | 422 | tprints("..."); |
| 423 | break; |
| 424 | } |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 425 | if (umove(tcp, addr, &sh)) { |
| 426 | tprints("..."); |
| 427 | printaddr_comment(addr); |
| 428 | break; |
| 429 | } |
| 430 | PRINT_FIELD_U("{", sh, transid); |
| 431 | btrfs_print_objectid(", ", sh, objectid); |
| 432 | PRINT_FIELD_U(", ", sh, offset); |
| 433 | btrfs_print_key_type(", ", sh, type); |
| 434 | PRINT_FIELD_U(", ", sh, len); |
| 435 | tprints("}"); |
Jeff Mahoney | d32d95a | 2016-05-26 23:33:04 -0400 | [diff] [blame] | 436 | off += sizeof(sh) + sh.len; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 437 | |
Jeff Mahoney | d32d95a | 2016-05-26 23:33:04 -0400 | [diff] [blame] | 438 | } |
| 439 | tprints("]"); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 440 | } |
| 441 | tprints("}"); |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | static bool |
| 446 | print_objectid_callback(struct tcb *tcp, void *elem_buf, |
| 447 | size_t elem_size, void *data) |
| 448 | { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 449 | printxvals_ex(*(uint64_t *) elem_buf, NULL, XLAT_STYLE_FMT_U, |
| 450 | btrfs_tree_objectids, NULL); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 451 | |
| 452 | return true; |
| 453 | } |
| 454 | |
| 455 | static bool |
| 456 | print_btrfs_ioctl_space_info(struct tcb *tcp, void *elem_buf, |
| 457 | size_t elem_size, void *data) |
| 458 | { |
| 459 | const struct btrfs_ioctl_space_info *info = elem_buf; |
| 460 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 461 | PRINT_FIELD_FLAGS("{", *info, flags, btrfs_space_info_flags, |
| 462 | "BTRFS_SPACE_INFO_???"); |
| 463 | PRINT_FIELD_U(", ", *info, total_bytes); |
| 464 | PRINT_FIELD_U(", ", *info, used_bytes); |
| 465 | tprints("}"); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 466 | |
| 467 | return true; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 468 | } |
| 469 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 470 | static void |
| 471 | print_btrfs_timespec(const char *prefix, uint64_t sec, uint32_t nsec) |
| 472 | { |
| 473 | tprintf("%s{sec=%" PRIu64 ", nsec=%u}", prefix, sec, nsec); |
| 474 | tprints_comment(sprinttime_nsec(sec, nsec)); |
| 475 | } |
| 476 | |
Dmitry V. Levin | fb0c609 | 2016-05-24 01:28:26 +0000 | [diff] [blame] | 477 | MPERS_PRINTER_DECL(int, btrfs_ioctl, |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 478 | struct tcb *const tcp, const unsigned int code, |
| 479 | const kernel_ulong_t arg) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 480 | { |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 481 | switch (code) { |
Dmitry V. Levin | 3ce2dfc | 2016-05-24 00:45:05 +0000 | [diff] [blame] | 482 | /* Take no arguments; command only. */ |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 483 | case BTRFS_IOC_TRANS_START: |
| 484 | case BTRFS_IOC_TRANS_END: |
| 485 | case BTRFS_IOC_SYNC: |
| 486 | case BTRFS_IOC_SCRUB_CANCEL: |
| 487 | case BTRFS_IOC_QUOTA_RESCAN_WAIT: |
| 488 | /* |
| 489 | * The codes for these ioctls are based on each accepting a |
| 490 | * vol_args but none of them actually consume an argument. |
| 491 | */ |
| 492 | case BTRFS_IOC_DEFRAG: |
| 493 | case BTRFS_IOC_BALANCE: |
| 494 | break; |
| 495 | |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 496 | /* takes a signed int */ |
| 497 | case BTRFS_IOC_BALANCE_CTL: |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 498 | tprints(", "); |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 499 | printxval(btrfs_balance_ctl_cmds, arg, "BTRFS_BALANCE_CTL_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 500 | break; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 501 | |
| 502 | /* returns a 64 */ |
| 503 | case BTRFS_IOC_START_SYNC: /* R */ |
| 504 | if (entering(tcp)) |
| 505 | return 0; |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 506 | ATTRIBUTE_FALLTHROUGH; |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 507 | /* takes a u64 */ |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 508 | case BTRFS_IOC_DEFAULT_SUBVOL: /* W */ |
| 509 | case BTRFS_IOC_WAIT_SYNC: /* W */ |
| 510 | tprints(", "); |
| 511 | printnum_int64(tcp, arg, "%" PRIu64); |
| 512 | break; |
| 513 | |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 514 | /* u64 but describe a flags bitfield; we can make that symbolic */ |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 515 | case BTRFS_IOC_SUBVOL_GETFLAGS: { /* R */ |
| 516 | uint64_t flags; |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 517 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 518 | if (entering(tcp)) |
| 519 | return 0; |
| 520 | |
| 521 | tprints(", "); |
| 522 | |
| 523 | if (umove_or_printaddr(tcp, arg, &flags)) |
| 524 | break; |
| 525 | |
| 526 | printflags64(btrfs_snap_flags_v2, flags, "BTRFS_SUBVOL_???"); |
| 527 | break; |
| 528 | } |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 529 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 530 | case BTRFS_IOC_SUBVOL_SETFLAGS: { /* W */ |
| 531 | uint64_t flags; |
| 532 | |
| 533 | tprints(", "); |
| 534 | |
| 535 | if (umove_or_printaddr(tcp, arg, &flags)) |
| 536 | break; |
| 537 | |
| 538 | printflags64(btrfs_snap_flags_v2, flags, "BTRFS_SUBVOL_???"); |
| 539 | break; |
| 540 | } |
| 541 | |
| 542 | /* More complex types */ |
| 543 | case BTRFS_IOC_BALANCE_V2: /* RW */ |
| 544 | if (entering(tcp)) { |
| 545 | tprints(", "); |
| 546 | btrfs_print_balance(tcp, arg, false); |
| 547 | return 0; |
| 548 | } |
| 549 | |
| 550 | if (syserror(tcp)) |
| 551 | break; |
| 552 | |
| 553 | tprints(" => "); |
| 554 | btrfs_print_balance(tcp, arg, true); |
| 555 | break; |
| 556 | case BTRFS_IOC_BALANCE_PROGRESS: /* R */ |
| 557 | if (entering(tcp)) |
| 558 | return 0; |
| 559 | |
| 560 | tprints(", "); |
| 561 | btrfs_print_balance(tcp, arg, true); |
| 562 | break; |
| 563 | |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 564 | case BTRFS_IOC_DEFRAG_RANGE: { /* W */ |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 565 | struct btrfs_ioctl_defrag_range_args args; |
| 566 | |
| 567 | tprints(", "); |
| 568 | |
| 569 | if (umove_or_printaddr(tcp, arg, &args)) |
| 570 | break; |
| 571 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 572 | PRINT_FIELD_U("{", args, start); |
| 573 | PRINT_FIELD_U64(", ", args, len); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 574 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 575 | PRINT_FIELD_FLAGS(", ", args, flags, btrfs_defrag_flags, |
| 576 | "BTRFS_DEFRAG_RANGE_???"); |
| 577 | PRINT_FIELD_U(", ", args, extent_thresh); |
| 578 | PRINT_FIELD_XVAL(", ", args, compress_type, |
| 579 | btrfs_compress_types, "BTRFS_COMPRESS_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 580 | tprints("}"); |
| 581 | break; |
| 582 | } |
| 583 | |
| 584 | case BTRFS_IOC_DEV_INFO: { /* RW */ |
| 585 | struct btrfs_ioctl_dev_info_args args; |
| 586 | char uuid[UUID_STRING_SIZE+1]; |
| 587 | int valid; |
| 588 | |
| 589 | if (entering(tcp)) |
| 590 | tprints(", "); |
| 591 | else if (syserror(tcp)) |
| 592 | break; |
| 593 | else |
| 594 | tprints(" => "); |
| 595 | if (umove_or_printaddr(tcp, arg, &args)) |
| 596 | break; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 597 | |
| 598 | valid = btrfs_unparse_uuid(args.uuid, uuid); |
| 599 | if (entering(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 600 | PRINT_FIELD_DEV("{", args, devid); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 601 | if (valid) |
| 602 | tprintf(", uuid=%s", uuid); |
| 603 | tprints("}"); |
| 604 | return 0; |
| 605 | } |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 606 | |
| 607 | tprints("{"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 608 | if (valid) |
| 609 | tprintf("uuid=%s, ", uuid); |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 610 | |
| 611 | PRINT_FIELD_U("", args, bytes_used); |
| 612 | PRINT_FIELD_U(", ", args, total_bytes); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 613 | PRINT_FIELD_CSTRING(", ", args, path); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 614 | tprints("}"); |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 615 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 616 | break; |
| 617 | } |
| 618 | |
| 619 | case BTRFS_IOC_DEV_REPLACE: { /* RW */ |
Dmitry V. Levin | fb0c609 | 2016-05-24 01:28:26 +0000 | [diff] [blame] | 620 | struct_btrfs_ioctl_dev_replace_args args; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 621 | |
| 622 | if (entering(tcp)) |
| 623 | tprints(", "); |
| 624 | else if (syserror(tcp)) |
| 625 | break; |
| 626 | else |
| 627 | tprints(" => "); |
| 628 | |
| 629 | if (umove_or_printaddr(tcp, arg, &args)) |
| 630 | break; |
| 631 | |
| 632 | if (entering(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 633 | PRINT_FIELD_XVAL("{", args, cmd, btrfs_dev_replace_cmds, |
| 634 | "BTRFS_IOCTL_DEV_REPLACE_CMD_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 635 | if (args.cmd == BTRFS_IOCTL_DEV_REPLACE_CMD_START) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 636 | PRINT_FIELD_DEV(", start={", args.start, |
| 637 | srcdevid); |
| 638 | PRINT_FIELD_XVAL(", ", args.start, |
| 639 | cont_reading_from_srcdev_mode, |
| 640 | btrfs_cont_reading_from_srcdev_mode, |
| 641 | "BTRFS_IOCTL_DEV_REPLACE_CONT_READING" |
| 642 | "_FROM_SRCDEV_MODE_???"); |
| 643 | PRINT_FIELD_CSTRING(", ", args.start, |
| 644 | srcdev_name); |
| 645 | PRINT_FIELD_CSTRING(", ", args.start, |
| 646 | tgtdev_name); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 647 | tprints("}"); |
| 648 | |
| 649 | } |
| 650 | tprints("}"); |
| 651 | return 0; |
| 652 | } |
| 653 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 654 | PRINT_FIELD_XVAL("{", args, result, btrfs_dev_replace_results, |
| 655 | "BTRFS_IOCTL_DEV_REPLACE_RESULT_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 656 | if (args.cmd == BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 657 | PRINT_FIELD_XVAL(", status={", args.status, |
| 658 | replace_state, btrfs_dev_replace_state, |
| 659 | "BTRFS_IOCTL_DEV_REPLACE_STATE_???"); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 660 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 661 | PRINT_FIELD_U(", ", args.status, progress_1000); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 662 | if (args.status.progress_1000 <= 1000) |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 663 | tprintf_comment("%u.%u%%", |
| 664 | (unsigned) args.status.progress_1000 / 10, |
| 665 | (unsigned) args.status.progress_1000 % 10); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 666 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 667 | PRINT_FIELD_U(", ", args.status, time_started); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 668 | tprints_comment(sprinttime(args.status.time_started)); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 669 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 670 | PRINT_FIELD_U(", ", args.status, time_stopped); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 671 | tprints_comment(sprinttime(args.status.time_stopped)); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 672 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 673 | PRINT_FIELD_U(", ", args.status, num_write_errors); |
| 674 | PRINT_FIELD_U(", ", args.status, |
| 675 | num_uncorrectable_read_errors); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 676 | } |
| 677 | tprints("}"); |
| 678 | break; |
| 679 | } |
| 680 | |
| 681 | case BTRFS_IOC_GET_FEATURES: { /* R */ |
| 682 | struct btrfs_ioctl_feature_flags flags; |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 683 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 684 | if (entering(tcp)) |
| 685 | return 0; |
| 686 | |
| 687 | tprints(", "); |
| 688 | if (umove_or_printaddr(tcp, arg, &flags)) |
| 689 | break; |
| 690 | |
| 691 | btrfs_print_features(&flags); |
| 692 | break; |
| 693 | } |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 694 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 695 | case BTRFS_IOC_SET_FEATURES: { /* W */ |
| 696 | struct btrfs_ioctl_feature_flags flarg[2]; |
| 697 | |
| 698 | tprints(", "); |
| 699 | |
| 700 | if (umove_or_printaddr(tcp, arg, &flarg)) |
| 701 | break; |
| 702 | |
| 703 | tprints("["); |
| 704 | btrfs_print_features(&flarg[0]); |
| 705 | tprints(", "); |
| 706 | btrfs_print_features(&flarg[1]); |
| 707 | tprints("]"); |
| 708 | break; |
| 709 | } |
| 710 | |
| 711 | case BTRFS_IOC_GET_SUPPORTED_FEATURES: { /* R */ |
| 712 | struct btrfs_ioctl_feature_flags flarg[3]; |
| 713 | |
| 714 | if (entering(tcp)) |
| 715 | return 0; |
| 716 | |
| 717 | tprints(", "); |
| 718 | if (umove_or_printaddr(tcp, arg, &flarg)) |
| 719 | break; |
| 720 | |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 721 | tprints("["); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 722 | btrfs_print_features(&flarg[0]); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 723 | tprints_comment("supported"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 724 | |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 725 | tprints(", "); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 726 | btrfs_print_features(&flarg[1]); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 727 | tprints_comment("safe to set"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 728 | |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 729 | tprints(", "); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 730 | btrfs_print_features(&flarg[2]); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 731 | tprints_comment("safe to clear"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 732 | tprints("]"); |
| 733 | |
| 734 | break; |
| 735 | } |
| 736 | |
| 737 | case BTRFS_IOC_FS_INFO: { /* R */ |
| 738 | struct btrfs_ioctl_fs_info_args args; |
| 739 | char uuid[UUID_STRING_SIZE+1]; |
| 740 | uint32_t nodesize, sectorsize, clone_alignment; |
| 741 | #ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 742 | uint32_t *reserved32; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 743 | #endif |
| 744 | |
| 745 | if (entering(tcp)) |
| 746 | return 0; |
| 747 | |
| 748 | tprints(", "); |
| 749 | if (umove_or_printaddr(tcp, arg, &args)) |
| 750 | break; |
| 751 | |
| 752 | #ifdef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE |
| 753 | nodesize = args.nodesize, |
| 754 | sectorsize = args.sectorsize, |
| 755 | clone_alignment = args.clone_alignment; |
| 756 | #else |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 757 | reserved32 = (void *) args.reserved; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 758 | nodesize = reserved32[0]; |
| 759 | sectorsize = reserved32[1]; |
| 760 | clone_alignment = reserved32[2]; |
| 761 | #endif |
| 762 | btrfs_unparse_uuid(args.fsid, uuid); |
| 763 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 764 | PRINT_FIELD_U("{", args, max_id); |
| 765 | PRINT_FIELD_U(", ", args, num_devices); |
| 766 | tprintf(", fsid=%s, nodesize=%u, sectorsize=%u" |
Dmitry V. Levin | 2be39ec | 2016-05-24 00:23:31 +0000 | [diff] [blame] | 767 | ", clone_alignment=%u", |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 768 | uuid, nodesize, sectorsize, clone_alignment); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 769 | tprints("}"); |
| 770 | break; |
| 771 | } |
| 772 | |
| 773 | case BTRFS_IOC_GET_DEV_STATS: { /* RW */ |
| 774 | struct btrfs_ioctl_get_dev_stats args; |
Dmitry V. Levin | 92b9062 | 2016-05-24 01:04:56 +0000 | [diff] [blame] | 775 | uint64_t i; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 776 | |
| 777 | if (entering(tcp)) |
| 778 | tprints(", "); |
| 779 | else if (syserror(tcp)) |
| 780 | break; |
| 781 | else |
| 782 | tprints(" => "); |
| 783 | if (umove_or_printaddr(tcp, arg, &args)) |
| 784 | break; |
| 785 | |
| 786 | tprints("{"); |
| 787 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 788 | if (entering(tcp)) { |
| 789 | PRINT_FIELD_DEV("", args, devid); |
| 790 | tprints(", "); |
| 791 | } |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 792 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 793 | PRINT_FIELD_U("", args, nr_items); |
| 794 | PRINT_FIELD_FLAGS(", ", args, flags, btrfs_dev_stats_flags, |
| 795 | "BTRFS_DEV_STATS_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 796 | |
| 797 | if (entering(tcp)) { |
| 798 | tprints("}"); |
| 799 | return 0; |
| 800 | } |
| 801 | |
| 802 | /* |
| 803 | * The structure has a 1k limit; Let's make sure we don't |
| 804 | * go off into the middle of nowhere with a bad nr_items |
| 805 | * value. |
| 806 | */ |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 807 | tprints(", ["); |
| 808 | for (i = 0; i < args.nr_items; i++) { |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 809 | if (i) |
| 810 | tprints(", "); |
Dmitry V. Levin | 92b9062 | 2016-05-24 01:04:56 +0000 | [diff] [blame] | 811 | if (i >= ARRAY_SIZE(args.values)) { |
| 812 | tprints("..."); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 813 | break; |
| 814 | } |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 815 | |
| 816 | tprints("["); |
| 817 | printxval_u(btrfs_dev_stats_values, i, NULL); |
| 818 | tprintf("] = %" PRI__u64, args.values[i]); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 819 | } |
| 820 | tprints("]}"); |
| 821 | break; |
| 822 | } |
| 823 | |
| 824 | case BTRFS_IOC_INO_LOOKUP: { /* RW */ |
| 825 | struct btrfs_ioctl_ino_lookup_args args; |
| 826 | |
| 827 | if (entering(tcp)) |
| 828 | tprints(", "); |
| 829 | else if (syserror(tcp)) |
| 830 | break; |
| 831 | else |
| 832 | tprints(" => "); |
| 833 | |
| 834 | if (umove_or_printaddr(tcp, arg, &args)) |
| 835 | break; |
| 836 | |
| 837 | if (entering(tcp)) { |
| 838 | /* Use subvolume id of the containing root */ |
| 839 | if (args.treeid == 0) |
Dmitry V. Levin | b759d27 | 2016-07-15 16:08:19 +0000 | [diff] [blame] | 840 | set_tcb_priv_ulong(tcp, 1); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 841 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 842 | btrfs_print_objectid("{", args, treeid); |
| 843 | btrfs_print_objectid(", ", args, objectid); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 844 | tprints("}"); |
| 845 | return 0; |
| 846 | } |
| 847 | |
| 848 | tprints("{"); |
Dmitry V. Levin | b759d27 | 2016-07-15 16:08:19 +0000 | [diff] [blame] | 849 | if (get_tcb_priv_ulong(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 850 | btrfs_print_objectid("", args, treeid); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 851 | tprints(", "); |
| 852 | } |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 853 | |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 854 | PRINT_FIELD_CSTRING("", args, name); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 855 | tprints("}"); |
| 856 | break; |
| 857 | } |
| 858 | |
| 859 | case BTRFS_IOC_INO_PATHS: { /* RW */ |
| 860 | struct btrfs_ioctl_ino_path_args args; |
| 861 | |
| 862 | if (entering(tcp)) |
| 863 | tprints(", "); |
| 864 | else if (syserror(tcp)) |
| 865 | break; |
| 866 | else |
| 867 | tprints(" => "); |
| 868 | |
| 869 | if (umove_or_printaddr(tcp, arg, &args)) |
| 870 | break; |
| 871 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 872 | if (entering(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 873 | PRINT_FIELD_U("{", args, inum); |
| 874 | PRINT_FIELD_U(", ", args, size); |
| 875 | PRINT_FIELD_ADDR64(", ", args, fspath); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 876 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 877 | return 0; |
| 878 | } |
| 879 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 880 | tprints("{fspath="); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 881 | btrfs_print_ino_path_container(tcp, args.fspath); |
| 882 | |
| 883 | tprints("}"); |
| 884 | break; |
| 885 | } |
| 886 | |
| 887 | case BTRFS_IOC_LOGICAL_INO: { /* RW */ |
| 888 | struct btrfs_ioctl_logical_ino_args args; |
| 889 | |
| 890 | if (entering(tcp)) |
| 891 | tprints(", "); |
| 892 | else if (syserror(tcp)) |
| 893 | break; |
| 894 | else |
| 895 | tprints(" => "); |
| 896 | |
| 897 | if (umove_or_printaddr(tcp, arg, &args)) |
| 898 | break; |
| 899 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 900 | if (entering(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 901 | PRINT_FIELD_U("{", args, logical); |
| 902 | PRINT_FIELD_U(", ", args, size); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 903 | |
| 904 | if (!IS_ARRAY_ZERO(args.reserved)) { |
| 905 | tprints(", reserved=["); |
| 906 | for (size_t i = 0; i < 3; ++i) |
| 907 | tprintf("%s%#" PRI__x64, |
| 908 | i ? ", " : "", |
| 909 | args.reserved[i]); |
| 910 | tprints("]"); |
| 911 | } |
| 912 | |
| 913 | tprintf(", flags="); |
| 914 | printflags64(btrfs_logical_ino_args_flags, |
| 915 | #ifdef HAVE_STRUCT_BTRFS_IOCTL_LOGICAL_INO_ARGS_FLAGS |
| 916 | args.flags |
| 917 | #else |
| 918 | args.reserved[3] |
| 919 | #endif |
| 920 | , "BTRFS_LOGICAL_INO_ARGS_???"); |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 921 | PRINT_FIELD_ADDR64(", ", args, inodes); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 922 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 923 | return 0; |
| 924 | } |
| 925 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 926 | tprints("{inodes="); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 927 | btrfs_print_logical_ino_container(tcp, args.inodes); |
| 928 | |
| 929 | tprints("}"); |
| 930 | break; |
| 931 | } |
| 932 | |
| 933 | case BTRFS_IOC_QGROUP_ASSIGN: { /* W */ |
| 934 | struct btrfs_ioctl_qgroup_assign_args args; |
| 935 | |
| 936 | tprints(", "); |
| 937 | if (umove_or_printaddr(tcp, arg, &args)) |
| 938 | break; |
| 939 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 940 | PRINT_FIELD_U("{", args, assign); |
| 941 | PRINT_FIELD_U(", ", args, src); |
| 942 | PRINT_FIELD_U(", ", args, dst); |
| 943 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 944 | break; |
| 945 | } |
| 946 | |
| 947 | case BTRFS_IOC_QGROUP_CREATE: { /* W */ |
| 948 | struct btrfs_ioctl_qgroup_create_args args; |
| 949 | |
| 950 | tprints(", "); |
| 951 | if (umove_or_printaddr(tcp, arg, &args)) |
| 952 | break; |
| 953 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 954 | PRINT_FIELD_U("{", args, create); |
| 955 | PRINT_FIELD_U(", ", args, qgroupid); |
| 956 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 957 | break; |
| 958 | } |
| 959 | |
| 960 | case BTRFS_IOC_QGROUP_LIMIT: { /* R */ |
| 961 | struct btrfs_ioctl_qgroup_limit_args args; |
| 962 | |
| 963 | if (entering(tcp)) |
| 964 | return 0; |
| 965 | |
| 966 | tprints(", "); |
| 967 | if (umove_or_printaddr(tcp, arg, &args)) |
| 968 | break; |
| 969 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 970 | PRINT_FIELD_U("{", args, qgroupid); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 971 | btrfs_print_qgroup_limit(&args.lim); |
| 972 | tprints("}"); |
| 973 | break; |
| 974 | } |
| 975 | |
| 976 | case BTRFS_IOC_QUOTA_CTL: { /* W */ |
| 977 | struct btrfs_ioctl_quota_ctl_args args; |
| 978 | |
| 979 | tprints(", "); |
| 980 | if (umove_or_printaddr(tcp, arg, &args)) |
| 981 | break; |
| 982 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 983 | PRINT_FIELD_XVAL("{", args, cmd, btrfs_qgroup_ctl_cmds, |
| 984 | "BTRFS_QUOTA_CTL_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 985 | tprints("}"); |
| 986 | |
| 987 | break; |
| 988 | } |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 989 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 990 | case BTRFS_IOC_QUOTA_RESCAN: { /* W */ |
| 991 | struct btrfs_ioctl_quota_rescan_args args; |
| 992 | |
| 993 | tprints(", "); |
| 994 | if (umove_or_printaddr(tcp, arg, &args)) |
| 995 | break; |
| 996 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 997 | PRINT_FIELD_U("{", args, flags); |
| 998 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 999 | break; |
| 1000 | } |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 1001 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1002 | case BTRFS_IOC_QUOTA_RESCAN_STATUS: { /* R */ |
| 1003 | struct btrfs_ioctl_quota_rescan_args args; |
| 1004 | |
| 1005 | if (entering(tcp)) |
| 1006 | return 0; |
| 1007 | |
| 1008 | tprints(", "); |
| 1009 | if (umove_or_printaddr(tcp, arg, &args)) |
| 1010 | break; |
| 1011 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1012 | PRINT_FIELD_U("{", args, flags); |
| 1013 | btrfs_print_objectid(", ", args, progress); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1014 | tprints("}"); |
| 1015 | break; |
| 1016 | } |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 1017 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1018 | case BTRFS_IOC_SET_RECEIVED_SUBVOL: { /* RW */ |
Dmitry V. Levin | fb0c609 | 2016-05-24 01:28:26 +0000 | [diff] [blame] | 1019 | struct_btrfs_ioctl_received_subvol_args args; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1020 | char uuid[UUID_STRING_SIZE+1]; |
| 1021 | |
| 1022 | if (entering(tcp)) |
| 1023 | tprints(", "); |
| 1024 | else if (syserror(tcp)) |
| 1025 | break; |
| 1026 | else |
| 1027 | tprints(" => "); |
| 1028 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1029 | if (umove_or_printaddr(tcp, arg, &args)) |
| 1030 | break; |
| 1031 | |
| 1032 | if (entering(tcp)) { |
| 1033 | btrfs_unparse_uuid((unsigned char *)args.uuid, uuid); |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1034 | tprintf("{uuid=%s", uuid); |
| 1035 | PRINT_FIELD_U(", ", args, stransid); |
| 1036 | print_btrfs_timespec(", stime=", |
| 1037 | args.stime.sec, args.stime.nsec); |
| 1038 | PRINT_FIELD_U(", ", args, flags); |
| 1039 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1040 | return 0; |
| 1041 | } |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1042 | PRINT_FIELD_U("{", args, rtransid); |
| 1043 | print_btrfs_timespec(", rtime=", |
| 1044 | args.rtime.sec, args.rtime.nsec); |
| 1045 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1046 | break; |
| 1047 | } |
Dmitry V. Levin | 95577cf | 2016-05-24 00:35:49 +0000 | [diff] [blame] | 1048 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1049 | case BTRFS_IOC_SCRUB: /* RW */ |
| 1050 | case BTRFS_IOC_SCRUB_PROGRESS: { /* RW */ |
| 1051 | struct btrfs_ioctl_scrub_args args; |
| 1052 | |
| 1053 | if (entering(tcp)) |
| 1054 | tprints(", "); |
| 1055 | else if (syserror(tcp)) |
| 1056 | break; |
| 1057 | else |
| 1058 | tprints(" => "); |
| 1059 | |
| 1060 | if (umove_or_printaddr(tcp, arg, &args)) |
| 1061 | break; |
| 1062 | |
| 1063 | if (entering(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1064 | PRINT_FIELD_DEV("{", args, devid); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1065 | if (code == BTRFS_IOC_SCRUB) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1066 | PRINT_FIELD_U(", ", args, start); |
| 1067 | PRINT_FIELD_U64(", ", args, end); |
| 1068 | PRINT_FIELD_FLAGS(", ", args, flags, |
| 1069 | btrfs_scrub_flags, |
| 1070 | "BTRFS_SCRUB_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1071 | } |
| 1072 | tprints("}"); |
| 1073 | return 0; |
| 1074 | } |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1075 | PRINT_FIELD_U("{progress={", args.progress, |
| 1076 | data_extents_scrubbed); |
| 1077 | PRINT_FIELD_U(", ", args.progress, tree_extents_scrubbed); |
| 1078 | PRINT_FIELD_U(", ", args.progress, data_bytes_scrubbed); |
| 1079 | PRINT_FIELD_U(", ", args.progress, tree_bytes_scrubbed); |
| 1080 | PRINT_FIELD_U(", ", args.progress, read_errors); |
| 1081 | PRINT_FIELD_U(", ", args.progress, csum_errors); |
| 1082 | PRINT_FIELD_U(", ", args.progress, verify_errors); |
| 1083 | PRINT_FIELD_U(", ", args.progress, no_csum); |
| 1084 | PRINT_FIELD_U(", ", args.progress, csum_discards); |
| 1085 | PRINT_FIELD_U(", ", args.progress, super_errors); |
| 1086 | PRINT_FIELD_U(", ", args.progress, malloc_errors); |
| 1087 | PRINT_FIELD_U(", ", args.progress, uncorrectable_errors); |
| 1088 | PRINT_FIELD_U(", ", args.progress, corrected_errors); |
| 1089 | PRINT_FIELD_U(", ", args.progress, last_physical); |
| 1090 | PRINT_FIELD_U(", ", args.progress, unverified_errors); |
| 1091 | tprints("}}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1092 | break; |
| 1093 | } |
| 1094 | |
| 1095 | case BTRFS_IOC_TREE_SEARCH: { /* RW */ |
| 1096 | struct btrfs_ioctl_search_args args; |
| 1097 | uint64_t buf_offset; |
| 1098 | |
| 1099 | if (entering(tcp)) |
| 1100 | tprints(", "); |
| 1101 | else if (syserror(tcp)) |
| 1102 | break; |
| 1103 | else |
| 1104 | tprints(" => "); |
| 1105 | |
| 1106 | if (umove_or_printaddr(tcp, arg, &args)) |
| 1107 | break; |
| 1108 | |
| 1109 | buf_offset = offsetof(struct btrfs_ioctl_search_args, buf); |
| 1110 | btrfs_print_tree_search(tcp, &args.key, arg + buf_offset, |
| 1111 | sizeof(args.buf), false); |
| 1112 | if (entering(tcp)) |
| 1113 | return 0; |
| 1114 | break; |
| 1115 | } |
| 1116 | |
| 1117 | case BTRFS_IOC_TREE_SEARCH_V2: { /* RW */ |
| 1118 | struct btrfs_ioctl_search_args_v2 args; |
| 1119 | uint64_t buf_offset; |
| 1120 | |
| 1121 | if (entering(tcp)) |
| 1122 | tprints(", "); |
| 1123 | else if (syserror(tcp)) { |
| 1124 | if (tcp->u_error == EOVERFLOW) { |
Dmitry V. Levin | d67b217 | 2016-05-24 01:10:53 +0000 | [diff] [blame] | 1125 | tprints(" => "); |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1126 | if (!umove_or_printaddr_ignore_syserror(tcp, |
| 1127 | arg, &args)) { |
| 1128 | PRINT_FIELD_U("{", args, buf_size); |
| 1129 | tprints("}"); |
| 1130 | } |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1131 | } |
| 1132 | break; |
| 1133 | } else |
| 1134 | tprints(" => "); |
| 1135 | |
| 1136 | if (umove_or_printaddr(tcp, arg, &args)) |
| 1137 | break; |
| 1138 | |
| 1139 | buf_offset = offsetof(struct btrfs_ioctl_search_args_v2, buf); |
| 1140 | btrfs_print_tree_search(tcp, &args.key, arg + buf_offset, |
| 1141 | args.buf_size, true); |
| 1142 | if (entering(tcp)) |
| 1143 | return 0; |
| 1144 | break; |
| 1145 | } |
| 1146 | |
| 1147 | case BTRFS_IOC_SEND: { /* W */ |
Dmitry V. Levin | fb0c609 | 2016-05-24 01:28:26 +0000 | [diff] [blame] | 1148 | struct_btrfs_ioctl_send_args args; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1149 | |
| 1150 | tprints(", "); |
| 1151 | if (umove_or_printaddr(tcp, arg, &args)) |
| 1152 | break; |
| 1153 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1154 | PRINT_FIELD_FD("{", args, send_fd, tcp); |
| 1155 | PRINT_FIELD_U(", ", args, clone_sources_count); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1156 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1157 | tprints(", clone_sources="); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 1158 | if (abbrev(tcp)) |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1159 | printaddr((uintptr_t) args.clone_sources); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 1160 | else { |
| 1161 | uint64_t record; |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 1162 | print_array(tcp, ptr_to_kulong(args.clone_sources), |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 1163 | args.clone_sources_count, |
| 1164 | &record, sizeof(record), |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1165 | tfetch_mem, |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 1166 | print_objectid_callback, 0); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1167 | } |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1168 | btrfs_print_objectid(", ", args, parent_root); |
| 1169 | PRINT_FIELD_FLAGS(", ", args, flags, btrfs_send_flags, |
| 1170 | "BTRFS_SEND_FLAGS_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1171 | tprints("}"); |
| 1172 | break; |
| 1173 | } |
| 1174 | |
| 1175 | case BTRFS_IOC_SPACE_INFO: { /* RW */ |
| 1176 | struct btrfs_ioctl_space_args args; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1177 | |
| 1178 | if (entering(tcp)) |
| 1179 | tprints(", "); |
| 1180 | else if (syserror(tcp)) |
| 1181 | break; |
| 1182 | else |
| 1183 | tprints(" => "); |
| 1184 | |
| 1185 | if (umove_or_printaddr(tcp, arg, &args)) |
| 1186 | break; |
| 1187 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1188 | if (entering(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1189 | PRINT_FIELD_U("{", args, space_slots); |
| 1190 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1191 | return 0; |
| 1192 | } |
| 1193 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1194 | PRINT_FIELD_U("{", args, total_spaces); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1195 | |
| 1196 | if (args.space_slots == 0 && args.total_spaces) { |
| 1197 | tprints("}"); |
| 1198 | break; |
| 1199 | } |
| 1200 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1201 | if (abbrev(tcp)) { |
| 1202 | tprints(", ..."); |
| 1203 | } else { |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1204 | struct btrfs_ioctl_space_info info; |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1205 | tprints(", spaces="); |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 1206 | print_array(tcp, arg + offsetof(typeof(args), spaces), |
| 1207 | args.total_spaces, |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1208 | &info, sizeof(info), tfetch_mem, |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 1209 | print_btrfs_ioctl_space_info, 0); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1210 | } |
Dmitry V. Levin | d57cc26 | 2016-05-24 01:15:18 +0000 | [diff] [blame] | 1211 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1212 | break; |
| 1213 | } |
| 1214 | |
| 1215 | case BTRFS_IOC_SNAP_CREATE: |
| 1216 | case BTRFS_IOC_RESIZE: |
| 1217 | case BTRFS_IOC_SCAN_DEV: |
| 1218 | case BTRFS_IOC_ADD_DEV: |
| 1219 | case BTRFS_IOC_RM_DEV: |
| 1220 | case BTRFS_IOC_SUBVOL_CREATE: |
| 1221 | case BTRFS_IOC_SNAP_DESTROY: |
| 1222 | case BTRFS_IOC_DEVICES_READY: { /* W */ |
| 1223 | struct btrfs_ioctl_vol_args args; |
| 1224 | |
| 1225 | tprints(", "); |
| 1226 | if (umove_or_printaddr(tcp, arg, &args)) |
| 1227 | break; |
| 1228 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1229 | PRINT_FIELD_FD("{", args, fd, tcp); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 1230 | PRINT_FIELD_CSTRING(", ", args, name); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1231 | tprints("}"); |
| 1232 | break; |
| 1233 | } |
| 1234 | |
| 1235 | case BTRFS_IOC_SNAP_CREATE_V2: |
| 1236 | case BTRFS_IOC_SUBVOL_CREATE_V2: { /* code is W, but is actually RW */ |
Dmitry V. Levin | e7d3d64 | 2016-08-25 21:24:33 +0000 | [diff] [blame] | 1237 | struct_btrfs_ioctl_vol_args_v2 args; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1238 | |
| 1239 | if (entering(tcp)) |
| 1240 | tprints(", "); |
| 1241 | else if (syserror(tcp)) |
| 1242 | break; |
| 1243 | else |
| 1244 | tprints(" => "); |
| 1245 | |
| 1246 | if (umove_or_printaddr(tcp, arg, &args)) |
| 1247 | break; |
| 1248 | |
| 1249 | if (entering(tcp)) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1250 | PRINT_FIELD_FD("{", args, fd, tcp); |
| 1251 | PRINT_FIELD_FLAGS(", ", args, flags, |
| 1252 | btrfs_snap_flags_v2, |
| 1253 | "BTRFS_SUBVOL_???"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1254 | if (args.flags & BTRFS_SUBVOL_QGROUP_INHERIT) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1255 | PRINT_FIELD_U(", ", args, size); |
| 1256 | tprints(", qgroup_inherit="); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1257 | btrfs_print_qgroup_inherit(tcp, |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 1258 | ptr_to_kulong(args.qgroup_inherit)); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1259 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 1260 | PRINT_FIELD_CSTRING(", ", args, name); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1261 | tprints("}"); |
| 1262 | return 0; |
| 1263 | } |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 1264 | PRINT_FIELD_U("{", args, transid); |
| 1265 | tprints("}"); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1266 | break; |
| 1267 | } |
Dmitry V. Levin | 82b9e34 | 2016-05-24 01:12:41 +0000 | [diff] [blame] | 1268 | |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1269 | case BTRFS_IOC_GET_FSLABEL: /* R */ |
Dmitry V. Levin | 82b9e34 | 2016-05-24 01:12:41 +0000 | [diff] [blame] | 1270 | if (entering(tcp)) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1271 | return 0; |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 1272 | ATTRIBUTE_FALLTHROUGH; |
Dmitry V. Levin | 82b9e34 | 2016-05-24 01:12:41 +0000 | [diff] [blame] | 1273 | case BTRFS_IOC_SET_FSLABEL: { /* W */ |
| 1274 | char label[BTRFS_LABEL_SIZE]; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1275 | |
| 1276 | tprints(", "); |
Dmitry V. Levin | 90ffbc7 | 2016-05-24 00:49:50 +0000 | [diff] [blame] | 1277 | if (umove_or_printaddr(tcp, arg, &label)) |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1278 | break; |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 1279 | print_quoted_cstring(label, sizeof(label)); |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1280 | break; |
| 1281 | } |
| 1282 | |
| 1283 | case BTRFS_IOC_CLONE: /* FICLONE */ |
| 1284 | case BTRFS_IOC_CLONE_RANGE: /* FICLONERANGE */ |
Dmitry V. Levin | ea516df | 2016-05-24 02:40:13 +0000 | [diff] [blame] | 1285 | #ifdef BTRFS_IOC_FILE_EXTENT_SAME |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1286 | case BTRFS_IOC_FILE_EXTENT_SAME: /* FIDEDUPERANGE */ |
Dmitry V. Levin | ea516df | 2016-05-24 02:40:13 +0000 | [diff] [blame] | 1287 | #endif |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1288 | /* |
| 1289 | * FICLONE, FICLONERANGE, and FIDEDUPERANGE started out as |
| 1290 | * btrfs ioctls and the code was kept for the generic |
| 1291 | * implementations. We use the BTRFS_* names here because |
| 1292 | * they will be available on older systems. |
| 1293 | */ |
| 1294 | return file_ioctl(tcp, code, arg); |
| 1295 | |
| 1296 | default: |
| 1297 | return RVAL_DECODED; |
| 1298 | }; |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 1299 | return RVAL_IOCTL_DECODED; |
Jeff Mahoney | 8cc6962 | 2016-05-18 18:09:39 -0400 | [diff] [blame] | 1300 | } |
| 1301 | #endif /* HAVE_LINUX_BTRFS_H */ |