From cec572daccafa1e912cbed363df6f84687778c6f Mon Sep 17 00:00:00 2001 From: Nicholas D Steeves Date: Sat, 23 Apr 2016 00:41:30 +0100 Subject: btrfs-progs (4.4.1-1.1) unstable; urgency=medium * Non-maintainer upload. * New upstream release. * Rename package to btrfs-progs (Closes: #780081) * Update standards version to 3.9.7 (no changes needed). * debian/control: Add "Breaks" per Gianfranco Costamagna's suggestion * Change lintian override to reflect package rename * Switch from using postinst and postrm to using triggers per Christian Seiler's recommendation. # imported from the archive --- .gitignore | 75 + Android.mk | 111 + COPYING | 341 + Documentation/Makefile.in | 133 + Documentation/asciidoc.conf | 48 + Documentation/btrfs-balance.asciidoc | 217 + Documentation/btrfs-check.asciidoc | 60 + Documentation/btrfs-convert.asciidoc | 98 + Documentation/btrfs-debug-tree.asciidoc | 38 + Documentation/btrfs-device.asciidoc | 145 + Documentation/btrfs-filesystem.asciidoc | 338 + Documentation/btrfs-find-root.asciidoc | 35 + Documentation/btrfs-image.asciidoc | 66 + Documentation/btrfs-inspect-internal.asciidoc | 84 + Documentation/btrfs-man5.asciidoc | 406 + Documentation/btrfs-map-logical.asciidoc | 37 + Documentation/btrfs-property.asciidoc | 73 + Documentation/btrfs-qgroup.asciidoc | 145 + Documentation/btrfs-quota.asciidoc | 56 + Documentation/btrfs-receive.asciidoc | 67 + Documentation/btrfs-replace.asciidoc | 76 + Documentation/btrfs-rescue.asciidoc | 90 + Documentation/btrfs-restore.asciidoc | 91 + Documentation/btrfs-scrub.asciidoc | 94 + Documentation/btrfs-select-super.asciidoc | 29 + Documentation/btrfs-send.asciidoc | 63 + Documentation/btrfs-show-super.asciidoc | 54 + Documentation/btrfs-subvolume.asciidoc | 182 + Documentation/btrfs.asciidoc | 127 + Documentation/btrfstune.asciidoc | 75 + Documentation/fsck.btrfs.asciidoc | 51 + Documentation/manpage-base.xsl | 35 + Documentation/manpage-bold-literal.xsl | 17 + Documentation/manpage-normal.xsl | 13 + Documentation/mkfs.btrfs.asciidoc | 341 + INSTALL | 79 + Makefile.extrawarn | 90 + Makefile.in | 399 + README.md | 41 + androidcompat.h | 28 + autogen.sh | 99 + backref.c | 1651 ++++ backref.h | 73 + bcp | 159 + bitops.h | 224 + btrfs-calc-size.c | 506 + btrfs-completion | 152 + btrfs-convert.c | 3206 +++++++ btrfs-corrupt-block.c | 1310 +++ btrfs-crc.c | 90 + btrfs-debug-tree.c | 462 + btrfs-debugfs | 296 + btrfs-find-root.c | 222 + btrfs-fragments.c | 452 + btrfs-image.c | 2880 ++++++ btrfs-list.c | 1914 ++++ btrfs-list.h | 178 + btrfs-map-logical.c | 364 + btrfs-select-super.c | 108 + btrfs-show-super.c | 542 ++ btrfs-zero-log.c | 76 + btrfs.c | 248 + btrfsck.h | 203 + btrfstune.c | 554 ++ chunk-recover.c | 2407 +++++ cmds-balance.c | 857 ++ cmds-check.c | 9844 ++++++++++++++++++++ cmds-device.c | 543 ++ cmds-fi-usage.c | 1036 ++ cmds-fi-usage.h | 57 + cmds-filesystem.c | 1295 +++ cmds-inspect.c | 644 ++ cmds-property.c | 478 + cmds-qgroup.c | 492 + cmds-quota.c | 189 + cmds-receive.c | 1306 +++ cmds-replace.c | 561 ++ cmds-rescue.c | 219 + cmds-restore.c | 1612 ++++ cmds-scrub.c | 1803 ++++ cmds-send.c | 741 ++ cmds-subvolume.c | 1347 +++ commands.h | 134 + config.h.in | 129 + config/config.guess | 1568 ++++ config/config.sub | 1788 ++++ config/install-sh | 527 ++ configure | 7246 ++++++++++++++ configure.ac | 174 + crc32c.c | 222 + crc32c.h | 33 + ctree.c | 2940 ++++++ ctree.h | 2570 +++++ debian/btrfs-progs-udeb.install | 2 + debian/btrfs-progs.install | 3 + debian/btrfs-progs.lintian-overrides | 4 + debian/btrfs-progs.triggers | 1 + debian/changelog | 672 ++ debian/compat | 1 + debian/control | 65 + debian/copyright | 41 + debian/local/btrfs-lvm.udev | 6 + debian/local/btrfs.hook | 29 + debian/local/btrfs.local-premount | 23 + debian/local/btrfs.udev | 7 + debian/rules | 32 + debian/source/format | 1 + debian/source/options | 2 + debian/watch | 2 + dir-item.c | 351 + dir-test.c | 517 + disk-io.c | 1750 ++++ disk-io.h | 166 + extent-cache.c | 341 + extent-cache.h | 121 + extent-tree.c | 4122 ++++++++ extent_io.c | 892 ++ extent_io.h | 159 + file-item.c | 486 + file.c | 162 + find-root.c | 150 + find-root.h | 87 + free-space-cache.c | 878 ++ free-space-cache.h | 62 + free-space-tree.c | 273 + free-space-tree.h | 25 + fsck.btrfs | 39 + hash.h | 28 + hasher.c | 42 + help.c | 271 + inode-item.c | 460 + inode-map.c | 100 + inode.c | 536 ++ interval_tree_generic.h | 193 + ioctl-test.c | 37 + ioctl.h | 716 ++ kerncompat.h | 374 + library-test.c | 69 + list.h | 486 + list_sort.c | 144 + list_sort.h | 14 + mkfs.c | 1844 ++++ print-tree.c | 1137 +++ print-tree.h | 27 + props.c | 198 + props.h | 43 + qgroup-verify.c | 1179 +++ qgroup-verify.h | 30 + qgroup.c | 1390 +++ qgroup.h | 101 + quick-test.c | 221 + radix-tree.c | 849 ++ radix-tree.h | 97 + raid6.c | 101 + random-test.c | 433 + rbtree-utils.c | 82 + rbtree-utils.h | 53 + rbtree.c | 548 ++ rbtree.h | 118 + rbtree_augmented.h | 249 + repair.c | 50 + repair.h | 34 + root-tree.c | 192 + send-stream.c | 499 + send-stream.h | 80 + send-test.c | 447 + send-utils.c | 771 ++ send-utils.h | 108 + send.h | 147 + show-blocks | 325 + string-table.c | 151 + string-table.h | 34 + super-recover.c | 336 + task-utils.c | 143 + task-utils.h | 47 + tests/README.md | 136 + tests/clean-tests.sh | 24 + tests/common | 240 + tests/convert-tests.sh | 86 + tests/fsck-tests.sh | 68 + .../001-bad-file-extent-bytenr/default_case.img | Bin 0 -> 4096 bytes tests/fsck-tests/002-bad-transid/default_case.img | Bin 0 -> 4096 bytes .../fsck-tests/003-shift-offsets/default_case.img | Bin 0 -> 4096 bytes tests/fsck-tests/004-no-dir-index/default_case.img | Bin 0 -> 4096 bytes .../005-bad-item-offset/default_case.img | Bin 0 -> 398336 bytes .../006-bad-root-items/default_case.tar.xz | Bin 0 -> 24980 bytes .../006-bad-root-items/skinny_case.tar.xz | Bin 0 -> 26520 bytes tests/fsck-tests/006-bad-root-items/test.sh | 17 + .../007-bad-offset-snapshots/default_case.img | Bin 0 -> 249856 bytes .../008-bad-dir-index-name/default_case.img | Bin 0 -> 4096 bytes .../009-no-dir-item-or-index/default_case.img | Bin 0 -> 4953088 bytes .../010-no-rootdir-inode-item/default_case.img | Bin 0 -> 398336 bytes .../fsck-tests/011-no-inode-item/default_case.img | Bin 0 -> 398336 bytes .../012-leaf-corruption/no_data_extent.tar.xz | Bin 0 -> 130260 bytes tests/fsck-tests/012-leaf-corruption/test.sh | 117 + tests/fsck-tests/013-extent-tree-rebuild/test.sh | 44 + .../fsck-tests/014-no-extent-info/default_case.img | Bin 0 -> 4096 bytes .../bko-97171-btrfs-image.raw.txt | 254 + .../bko-97171-btrfs-image.raw.xz | Bin 0 -> 6748 bytes .../016-wrong-inode-nbytes/default_case.img.xz | Bin 0 -> 1996 bytes .../default_case.img.xz | Bin 0 -> 1104 bytes .../018-leaf-crossing-stripes/default_case.raw.xz | Bin 0 -> 105064 bytes tests/fsck-tests/018-leaf-crossing-stripes/test.sh | 12 + .../019-non-skinny-false-alert/default_case.img.xz | Bin 0 -> 15236 bytes .../fsck-tests/019-non-skinny-false-alert/test.sh | 23 + tests/fuzz-tests.sh | 41 + tests/fuzz-tests/001-simple-unmounted/test.sh | 20 + tests/fuzz-tests/images/bad-superblock-1.raw.xz | Bin 0 -> 228 bytes tests/fuzz-tests/images/bad-superblock-2.raw.xz | Bin 0 -> 228 bytes tests/fuzz-tests/images/bad-superblock-3.raw.xz | Bin 0 -> 228 bytes tests/fuzz-tests/images/bad-superblock.txt | 17 + .../images/bko-104131-fsck-oob-read.raw.xz | Bin 0 -> 192 bytes .../fuzz-tests/images/bko-104131-fsck-oob-read.txt | 31 + .../images/bko-104141-fsck-exception.raw.xz | Bin 0 -> 196 bytes .../images/bko-104141-fsck-exception.txt | 9 + .../images/bko-97191-btrfs-image.raw.txt | 137 + .../fuzz-tests/images/bko-97191-btrfs-image.raw.xz | Bin 0 -> 7076 bytes .../images/bko-97271-btrfs-image.raw.txt | 54 + .../fuzz-tests/images/bko-97271-btrfs-image.raw.xz | Bin 0 -> 6580 bytes .../images/sys-array-num-stripes-0.raw.txt | 30 + .../images/sys-array-num-stripes-0.raw.xz | Bin 0 -> 8364 bytes tests/misc-tests.sh | 47 + tests/misc-tests/001-btrfstune-features/test.sh | 46 + tests/misc-tests/002-uuid-rewrite/test.sh | 66 + tests/misc-tests/003-zero-log/test.sh | 52 + tests/misc-tests/004-shrink-fs/test.sh | 72 + .../005-convert-progress-thread-crash/test.sh | 15 + .../misc-tests/006-image-on-missing-device/test.sh | 78 + tests/misc-tests/007-subvolume-sync/test.sh | 32 + tests/misc-tests/008-leaf-crossing-stripes/test.sh | 25 + .../009-subvolume-sync-must-wait/test.sh | 52 + .../010-convert-delete-ext2-subvol/test.sh | 26 + tests/misc-tests/011-delete-missing-device/test.sh | 83 + .../first_meta_chunk.btrfs-image | Bin 0 -> 4096 bytes tests/misc-tests/012-find-root-no-result/test.sh | 24 + tests/mkfs-tests.sh | 44 + tests/mkfs-tests/001-basic-profiles/test.sh | 91 + .../002-no-force-mixed-on-small-volume/test.sh | 13 + .../003-mixed-with-wrong-nodesize/test.sh | 12 + tests/mkfs-tests/004-rootdir-keeps-size/test.sh | 31 + .../005-long-device-name-for-ssd/test.sh | 40 + .../006-partitioned-loopdev/partition-1g-1g | Bin 0 -> 512 bytes tests/mkfs-tests/006-partitioned-loopdev/test.sh | 27 + .../mkfs-tests/007-mix-nodesize-sectorsize/test.sh | 36 + .../008-secorsize-nodesize-combination/test.sh | 50 + transaction.h | 64 + ulist.c | 253 + ulist.h | 81 + utils-lib.c | 40 + utils.c | 3150 +++++++ utils.h | 338 + uuid-tree.c | 105 + version.h.in | 14 + version.sh | 37 + volumes.c | 2133 +++++ volumes.h | 229 + 256 files changed, 99051 insertions(+) create mode 100644 .gitignore create mode 100644 Android.mk create mode 100644 COPYING create mode 100644 Documentation/Makefile.in create mode 100644 Documentation/asciidoc.conf create mode 100644 Documentation/btrfs-balance.asciidoc create mode 100644 Documentation/btrfs-check.asciidoc create mode 100644 Documentation/btrfs-convert.asciidoc create mode 100644 Documentation/btrfs-debug-tree.asciidoc create mode 100644 Documentation/btrfs-device.asciidoc create mode 100644 Documentation/btrfs-filesystem.asciidoc create mode 100644 Documentation/btrfs-find-root.asciidoc create mode 100644 Documentation/btrfs-image.asciidoc create mode 100644 Documentation/btrfs-inspect-internal.asciidoc create mode 100644 Documentation/btrfs-man5.asciidoc create mode 100644 Documentation/btrfs-map-logical.asciidoc create mode 100644 Documentation/btrfs-property.asciidoc create mode 100644 Documentation/btrfs-qgroup.asciidoc create mode 100644 Documentation/btrfs-quota.asciidoc create mode 100644 Documentation/btrfs-receive.asciidoc create mode 100644 Documentation/btrfs-replace.asciidoc create mode 100644 Documentation/btrfs-rescue.asciidoc create mode 100644 Documentation/btrfs-restore.asciidoc create mode 100644 Documentation/btrfs-scrub.asciidoc create mode 100644 Documentation/btrfs-select-super.asciidoc create mode 100644 Documentation/btrfs-send.asciidoc create mode 100644 Documentation/btrfs-show-super.asciidoc create mode 100644 Documentation/btrfs-subvolume.asciidoc create mode 100644 Documentation/btrfs.asciidoc create mode 100644 Documentation/btrfstune.asciidoc create mode 100644 Documentation/fsck.btrfs.asciidoc create mode 100644 Documentation/manpage-base.xsl create mode 100644 Documentation/manpage-bold-literal.xsl create mode 100644 Documentation/manpage-normal.xsl create mode 100644 Documentation/mkfs.btrfs.asciidoc create mode 100644 INSTALL create mode 100644 Makefile.extrawarn create mode 100644 Makefile.in create mode 100644 README.md create mode 100644 androidcompat.h create mode 100755 autogen.sh create mode 100644 backref.c create mode 100644 backref.h create mode 100755 bcp create mode 100644 bitops.h create mode 100644 btrfs-calc-size.c create mode 100644 btrfs-completion create mode 100644 btrfs-convert.c create mode 100644 btrfs-corrupt-block.c create mode 100644 btrfs-crc.c create mode 100644 btrfs-debug-tree.c create mode 100755 btrfs-debugfs create mode 100644 btrfs-find-root.c create mode 100644 btrfs-fragments.c create mode 100644 btrfs-image.c create mode 100644 btrfs-list.c create mode 100644 btrfs-list.h create mode 100644 btrfs-map-logical.c create mode 100644 btrfs-select-super.c create mode 100644 btrfs-show-super.c create mode 100644 btrfs-zero-log.c create mode 100644 btrfs.c create mode 100644 btrfsck.h create mode 100644 btrfstune.c create mode 100644 chunk-recover.c create mode 100644 cmds-balance.c create mode 100644 cmds-check.c create mode 100644 cmds-device.c create mode 100644 cmds-fi-usage.c create mode 100644 cmds-fi-usage.h create mode 100644 cmds-filesystem.c create mode 100644 cmds-inspect.c create mode 100644 cmds-property.c create mode 100644 cmds-qgroup.c create mode 100644 cmds-quota.c create mode 100644 cmds-receive.c create mode 100644 cmds-replace.c create mode 100644 cmds-rescue.c create mode 100644 cmds-restore.c create mode 100644 cmds-scrub.c create mode 100644 cmds-send.c create mode 100644 cmds-subvolume.c create mode 100644 commands.h create mode 100644 config.h.in create mode 100755 config/config.guess create mode 100755 config/config.sub create mode 100755 config/install-sh create mode 100755 configure create mode 100644 configure.ac create mode 100644 crc32c.c create mode 100644 crc32c.h create mode 100644 ctree.c create mode 100644 ctree.h create mode 100644 debian/btrfs-progs-udeb.install create mode 100644 debian/btrfs-progs.install create mode 100644 debian/btrfs-progs.lintian-overrides create mode 100644 debian/btrfs-progs.triggers create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/local/btrfs-lvm.udev create mode 100644 debian/local/btrfs.hook create mode 100644 debian/local/btrfs.local-premount create mode 100644 debian/local/btrfs.udev create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/source/options create mode 100644 debian/watch create mode 100644 dir-item.c create mode 100644 dir-test.c create mode 100644 disk-io.c create mode 100644 disk-io.h create mode 100644 extent-cache.c create mode 100644 extent-cache.h create mode 100644 extent-tree.c create mode 100644 extent_io.c create mode 100644 extent_io.h create mode 100644 file-item.c create mode 100644 file.c create mode 100644 find-root.c create mode 100644 find-root.h create mode 100644 free-space-cache.c create mode 100644 free-space-cache.h create mode 100644 free-space-tree.c create mode 100644 free-space-tree.h create mode 100755 fsck.btrfs create mode 100644 hash.h create mode 100644 hasher.c create mode 100644 help.c create mode 100644 inode-item.c create mode 100644 inode-map.c create mode 100644 inode.c create mode 100644 interval_tree_generic.h create mode 100644 ioctl-test.c create mode 100644 ioctl.h create mode 100644 kerncompat.h create mode 100644 library-test.c create mode 100644 list.h create mode 100644 list_sort.c create mode 100644 list_sort.h create mode 100644 mkfs.c create mode 100644 print-tree.c create mode 100644 print-tree.h create mode 100644 props.c create mode 100644 props.h create mode 100644 qgroup-verify.c create mode 100644 qgroup-verify.h create mode 100644 qgroup.c create mode 100644 qgroup.h create mode 100644 quick-test.c create mode 100644 radix-tree.c create mode 100644 radix-tree.h create mode 100644 raid6.c create mode 100644 random-test.c create mode 100644 rbtree-utils.c create mode 100644 rbtree-utils.h create mode 100644 rbtree.c create mode 100644 rbtree.h create mode 100644 rbtree_augmented.h create mode 100644 repair.c create mode 100644 repair.h create mode 100644 root-tree.c create mode 100644 send-stream.c create mode 100644 send-stream.h create mode 100644 send-test.c create mode 100644 send-utils.c create mode 100644 send-utils.h create mode 100644 send.h create mode 100755 show-blocks create mode 100644 string-table.c create mode 100644 string-table.h create mode 100644 super-recover.c create mode 100644 task-utils.c create mode 100644 task-utils.h create mode 100644 tests/README.md create mode 100755 tests/clean-tests.sh create mode 100644 tests/common create mode 100644 tests/convert-tests.sh create mode 100755 tests/fsck-tests.sh create mode 100644 tests/fsck-tests/001-bad-file-extent-bytenr/default_case.img create mode 100644 tests/fsck-tests/002-bad-transid/default_case.img create mode 100644 tests/fsck-tests/003-shift-offsets/default_case.img create mode 100644 tests/fsck-tests/004-no-dir-index/default_case.img create mode 100644 tests/fsck-tests/005-bad-item-offset/default_case.img create mode 100644 tests/fsck-tests/006-bad-root-items/default_case.tar.xz create mode 100644 tests/fsck-tests/006-bad-root-items/skinny_case.tar.xz create mode 100755 tests/fsck-tests/006-bad-root-items/test.sh create mode 100644 tests/fsck-tests/007-bad-offset-snapshots/default_case.img create mode 100644 tests/fsck-tests/008-bad-dir-index-name/default_case.img create mode 100644 tests/fsck-tests/009-no-dir-item-or-index/default_case.img create mode 100644 tests/fsck-tests/010-no-rootdir-inode-item/default_case.img create mode 100644 tests/fsck-tests/011-no-inode-item/default_case.img create mode 100644 tests/fsck-tests/012-leaf-corruption/no_data_extent.tar.xz create mode 100755 tests/fsck-tests/012-leaf-corruption/test.sh create mode 100755 tests/fsck-tests/013-extent-tree-rebuild/test.sh create mode 100644 tests/fsck-tests/014-no-extent-info/default_case.img create mode 100644 tests/fsck-tests/015-check-bad-memory-access/bko-97171-btrfs-image.raw.txt create mode 100644 tests/fsck-tests/015-check-bad-memory-access/bko-97171-btrfs-image.raw.xz create mode 100644 tests/fsck-tests/016-wrong-inode-nbytes/default_case.img.xz create mode 100644 tests/fsck-tests/017-missing-all-file-extent/default_case.img.xz create mode 100644 tests/fsck-tests/018-leaf-crossing-stripes/default_case.raw.xz create mode 100755 tests/fsck-tests/018-leaf-crossing-stripes/test.sh create mode 100644 tests/fsck-tests/019-non-skinny-false-alert/default_case.img.xz create mode 100755 tests/fsck-tests/019-non-skinny-false-alert/test.sh create mode 100755 tests/fuzz-tests.sh create mode 100755 tests/fuzz-tests/001-simple-unmounted/test.sh create mode 100644 tests/fuzz-tests/images/bad-superblock-1.raw.xz create mode 100644 tests/fuzz-tests/images/bad-superblock-2.raw.xz create mode 100644 tests/fuzz-tests/images/bad-superblock-3.raw.xz create mode 100644 tests/fuzz-tests/images/bad-superblock.txt create mode 100644 tests/fuzz-tests/images/bko-104131-fsck-oob-read.raw.xz create mode 100644 tests/fuzz-tests/images/bko-104131-fsck-oob-read.txt create mode 100644 tests/fuzz-tests/images/bko-104141-fsck-exception.raw.xz create mode 100644 tests/fuzz-tests/images/bko-104141-fsck-exception.txt create mode 100644 tests/fuzz-tests/images/bko-97191-btrfs-image.raw.txt create mode 100644 tests/fuzz-tests/images/bko-97191-btrfs-image.raw.xz create mode 100644 tests/fuzz-tests/images/bko-97271-btrfs-image.raw.txt create mode 100644 tests/fuzz-tests/images/bko-97271-btrfs-image.raw.xz create mode 100644 tests/fuzz-tests/images/sys-array-num-stripes-0.raw.txt create mode 100644 tests/fuzz-tests/images/sys-array-num-stripes-0.raw.xz create mode 100755 tests/misc-tests.sh create mode 100755 tests/misc-tests/001-btrfstune-features/test.sh create mode 100755 tests/misc-tests/002-uuid-rewrite/test.sh create mode 100755 tests/misc-tests/003-zero-log/test.sh create mode 100755 tests/misc-tests/004-shrink-fs/test.sh create mode 100755 tests/misc-tests/005-convert-progress-thread-crash/test.sh create mode 100755 tests/misc-tests/006-image-on-missing-device/test.sh create mode 100755 tests/misc-tests/007-subvolume-sync/test.sh create mode 100755 tests/misc-tests/008-leaf-crossing-stripes/test.sh create mode 100755 tests/misc-tests/009-subvolume-sync-must-wait/test.sh create mode 100755 tests/misc-tests/010-convert-delete-ext2-subvol/test.sh create mode 100755 tests/misc-tests/011-delete-missing-device/test.sh create mode 100644 tests/misc-tests/012-find-root-no-result/first_meta_chunk.btrfs-image create mode 100755 tests/misc-tests/012-find-root-no-result/test.sh create mode 100755 tests/mkfs-tests.sh create mode 100755 tests/mkfs-tests/001-basic-profiles/test.sh create mode 100755 tests/mkfs-tests/002-no-force-mixed-on-small-volume/test.sh create mode 100755 tests/mkfs-tests/003-mixed-with-wrong-nodesize/test.sh create mode 100755 tests/mkfs-tests/004-rootdir-keeps-size/test.sh create mode 100755 tests/mkfs-tests/005-long-device-name-for-ssd/test.sh create mode 100644 tests/mkfs-tests/006-partitioned-loopdev/partition-1g-1g create mode 100755 tests/mkfs-tests/006-partitioned-loopdev/test.sh create mode 100755 tests/mkfs-tests/007-mix-nodesize-sectorsize/test.sh create mode 100755 tests/mkfs-tests/008-secorsize-nodesize-combination/test.sh create mode 100644 transaction.h create mode 100644 ulist.c create mode 100644 ulist.h create mode 100644 utils-lib.c create mode 100644 utils.c create mode 100644 utils.h create mode 100644 uuid-tree.c create mode 100644 version.h.in create mode 100755 version.sh create mode 100644 volumes.c create mode 100644 volumes.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..a27cb0d9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,75 @@ +*.o +*.static.o +*.o.d +tags +.cc-defines.h +version.h +version +man/*.gz +Documentation/*.gz +Documentation/*.html +btrfs +btrfs.static +btrfs-debug-tree +btrfs-map-logical +btrfs-fragments +btrfsck +calc-size +ioctl-test +dir-test +send-test +quick-test +find-root +mkfs.btrfs +mkfs.btrfs.static +repair +restore +btrfs-convert +btrfs-find-root +btrfs-find-root.static +btrfs-image +btrfs-show-super +btrfs-zero-log +btrfs-corrupt-block +btrfs-select-super +btrfs-calc-size +btrfstune +libbtrfs.a +libbtrfs.so +libbtrfs.so.0 +libbtrfs.so.0.1 +library-test +library-test-static + +/tests/*-tests-results.txt +/tests/test.img + +aclocal.m4 +autom4te.cache +compile +config.cache +config.guess +config.h +config.h.in +config.h.in~ +config.log +config.rpath +config.status +config.sub +config/ltmain.sh +config/py-compile +config/test-driver +configure +cscope.out +depcomp +libtool +m4/*.m4 +Makefile +Documentation/Makefile +missing +mkinstalldirs +stamp-h +stamp-h.in +stamp-h1 +config/* + diff --git a/Android.mk b/Android.mk new file mode 100644 index 00000000..fe3209b6 --- /dev/null +++ b/Android.mk @@ -0,0 +1,111 @@ +LOCAL_PATH:= $(call my-dir) + +#include $(call all-subdir-makefiles) + +CFLAGS := -g -O1 -Wall -D_FORTIFY_SOURCE=2 -include config.h \ + -DBTRFS_FLAT_INCLUDES -D_XOPEN_SOURCE=700 -fno-strict-aliasing -fPIC + +LDFLAGS := -static -rdynamic + +LIBS := -luuid -lblkid -lz -llzo2 -L. -lpthread +LIBBTRFS_LIBS := $(LIBS) + +STATIC_CFLAGS := $(CFLAGS) -ffunction-sections -fdata-sections +STATIC_LDFLAGS := -static -Wl,--gc-sections +STATIC_LIBS := -luuid -lblkid -luuid -lz -llzo2 -L. -pthread + +btrfs_shared_libraries := libext2_uuid \ + libext2_blkid + +objects := ctree.c disk-io.c radix-tree.c extent-tree.c print-tree.c \ + root-tree.c dir-item.c file-item.c inode-item.c inode-map.c \ + extent-cache.c extent_io.c volumes.c utils.c repair.c \ + qgroup.c raid6.c free-space-cache.c list_sort.c props.c \ + ulist.c qgroup-verify.c backref.c string-table.c task-utils.c \ + inode.c file.c find-root.c +cmds_objects := cmds-subvolume.c cmds-filesystem.c cmds-device.c cmds-scrub.c \ + cmds-inspect.c cmds-balance.c cmds-send.c cmds-receive.c \ + cmds-quota.c cmds-qgroup.c cmds-replace.c cmds-check.c \ + cmds-restore.c cmds-rescue.c chunk-recover.c super-recover.c \ + cmds-property.c cmds-fi-usage.c +libbtrfs_objects := send-stream.c send-utils.c rbtree.c btrfs-list.c crc32c.c \ + uuid-tree.c utils-lib.c rbtree-utils.c +libbtrfs_headers := send-stream.h send-utils.h send.h rbtree.h btrfs-list.h \ + crc32c.h list.h kerncompat.h radix-tree.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/ + + +# external/e2fsprogs/lib is needed for uuid/uuid.h +common_C_INCLUDES := $(LOCAL_PATH) external/e2fsprogs/lib/ external/lzo/include/ external/zlib/ + +#---------------------------------------------------------- +include $(CLEAR_VARS) +LOCAL_SRC_FILES := $(libbtrfs_objects) +LOCAL_CFLAGS := $(STATIC_CFLAGS) +LOCAL_MODULE := libbtrfs +LOCAL_C_INCLUDES := $(common_C_INCLUDES) +include $(BUILD_STATIC_LIBRARY) + +#---------------------------------------------------------- +include $(CLEAR_VARS) +LOCAL_MODULE := btrfs +#LOCAL_FORCE_STATIC_EXECUTABLE := true +LOCAL_SRC_FILES := \ + $(objects) \ + $(cmds_objects) \ + btrfs.c \ + help.c \ + +LOCAL_C_INCLUDES := $(common_C_INCLUDES) +LOCAL_CFLAGS := $(STATIC_CFLAGS) +#LOCAL_LDLIBS := $(LIBBTRFS_LIBS) +#LOCAL_LDFLAGS := $(STATIC_LDFLAGS) +LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries) +LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static libz +LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils + +LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES) +#LOCAL_MODULE_TAGS := optional +include $(BUILD_EXECUTABLE) + +#---------------------------------------------------------- +include $(CLEAR_VARS) +LOCAL_MODULE := mkfs.btrfs +LOCAL_SRC_FILES := \ + $(objects) \ + mkfs.c + +LOCAL_C_INCLUDES := $(common_C_INCLUDES) +LOCAL_CFLAGS := $(STATIC_CFLAGS) +#LOCAL_LDLIBS := $(LIBBTRFS_LIBS) +#LOCAL_LDFLAGS := $(STATIC_LDFLAGS) +LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries) +LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static +LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils + +LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES) +#LOCAL_MODULE_TAGS := optional +include $(BUILD_EXECUTABLE) + +#--------------------------------------------------------------- +include $(CLEAR_VARS) +LOCAL_MODULE := btrfstune +LOCAL_SRC_FILES := \ + $(objects) \ + btrfstune.c + +LOCAL_C_INCLUDES := $(common_C_INCLUDES) +LOCAL_CFLAGS := $(STATIC_CFLAGS) +LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries) +#LOCAL_LDLIBS := $(LIBBTRFS_LIBS) +#LOCAL_LDFLAGS := $(STATIC_LDFLAGS) +LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries) +LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static +LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils + +LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES) +LOCAL_MODULE_TAGS := optional +include $(BUILD_EXECUTABLE) +#-------------------------------------------------------------- diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..10828e06 --- /dev/null +++ b/COPYING @@ -0,0 +1,341 @@ + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in new file mode 100644 index 00000000..f046abd5 --- /dev/null +++ b/Documentation/Makefile.in @@ -0,0 +1,133 @@ +# Guard against environment variables +MAN8_TXT = + +# Top level commands +MAN8_TXT += btrfs.asciidoc +MAN8_TXT += btrfs-convert.asciidoc +MAN8_TXT += btrfs-debug-tree.asciidoc +MAN8_TXT += btrfs-find-root.asciidoc +MAN8_TXT += btrfs-image.asciidoc +MAN8_TXT += btrfs-map-logical.asciidoc +MAN8_TXT += btrfs-show-super.asciidoc +MAN8_TXT += btrfs-select-super.asciidoc +MAN8_TXT += btrfstune.asciidoc +MAN8_TXT += fsck.btrfs.asciidoc +MAN8_TXT += mkfs.btrfs.asciidoc + +# Sub commands for btrfs +MAN8_TXT += btrfs-subvolume.asciidoc +MAN8_TXT += btrfs-filesystem.asciidoc +MAN8_TXT += btrfs-balance.asciidoc +MAN8_TXT += btrfs-device.asciidoc +MAN8_TXT += btrfs-scrub.asciidoc +MAN8_TXT += btrfs-check.asciidoc +MAN8_TXT += btrfs-rescue.asciidoc +MAN8_TXT += btrfs-inspect-internal.asciidoc +MAN8_TXT += btrfs-send.asciidoc +MAN8_TXT += btrfs-receive.asciidoc +MAN8_TXT += btrfs-quota.asciidoc +MAN8_TXT += btrfs-qgroup.asciidoc +MAN8_TXT += btrfs-replace.asciidoc +MAN8_TXT += btrfs-restore.asciidoc +MAN8_TXT += btrfs-property.asciidoc + +# Category 5 manual page +MAN5_TXT += btrfs-man5.asciidoc + +MAN_TXT = $(MAN8_TXT) $(MAN5_TXT) +MAN_XML = $(patsubst %.asciidoc,%.xml,$(MAN_TXT)) +MAN_HTML = $(patsubst %.asciidoc,%.html,$(MAN_TXT)) + +DOC_MAN5 = $(patsubst %.asciidoc,%.5,$(MAN5_TXT)) +GZ_MAN5 = $(patsubst %.asciidoc,%.5.gz,$(MAN5_TXT)) + +DOC_MAN8 = $(patsubst %.asciidoc,%.8,$(MAN8_TXT)) +GZ_MAN8 = $(patsubst %.asciidoc,%.8.gz,$(MAN8_TXT)) + +mandir ?= $(prefix)/share/man +man8dir = $(mandir)/man8 +man5dir = $(mandir)/man5 + +ASCIIDOC = @ASCIIDOC@ +ASCIIDOC_EXTRA = +MANPAGE_XSL = manpage-normal.xsl +XMLTO = @XMLTO@ +XMLTO_EXTRA = +XMLTO_EXTRA = -m manpage-bold-literal.xsl +GZIPCMD = @GZIP@ +INSTALL = @INSTALL@ +RM = @RM@ +RMDIR = @RMDIR@ +LN_S = @LN_S@ +MV = @MV@ +SED = @SED@ +BTRFS_VERSION = $(shell $(SED) -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p'\ + ../config.h) + +ifneq ($(findstring $(MAKEFLAGS),s),s) +ifndef V + QUIET_RM = @ + QUIET_ASCIIDOC = @echo " [ASCII] $@"; + QUIET_XMLTO = @echo " [XMLTO] $@"; + QUIET_GZIP = @echo " [GZ] $@"; + QUIET_STDERR = 2> /dev/null + QUIET_SUBDIR0 = +@subdir= + QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ + $(MAKE) $(PRINT_DIR) -C $$subdir + export V +endif +endif + +all: man +man: man5 man8 +man5: $(GZ_MAN5) +man8: $(GZ_MAN8) +html: $(MAN_HTML) + +install: install-man + +install-man: man + $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir) + $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir) + $(INSTALL) -m 644 $(GZ_MAN5) $(DESTDIR)$(man5dir) + # the source file name of btrfs.5 clashes with section 8 page, but we + # want to keep the code generic + $(MV) $(DESTDIR)$(man5dir)/btrfs-man5.5.gz $(DESTDIR)$(man5dir)/btrfs.5.gz + $(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir) + $(LN_S) -f btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz + $(LN_S) -f btrfs-rescue.8.gz $(DESTDIR)$(man8dir)/btrfs-zero-log.8.gz + +uninstall: + cd $(DESTDIR)$(man8dir); rm -f btrfs-check.8.gz $(GZ_MAN8) + $(RMDIR) -p --ignore-fail-on-non-empty $(DESTDIR)$(man8dir) + +clean: + $(QUIET_RM)$(RM) -f *.xml *.xml+ *.5 *.5.gz *.8 *.8.gz *.html + +%.5.gz : %.5 + $(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@ + +%.8.gz : %.8 + $(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@ + +%.5 : %.xml + $(QUIET_XMLTO)$(RM) -f $@ && \ + $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< + +%.8 : %.xml + $(QUIET_XMLTO)$(RM) -f $@ && \ + $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< + +%.xml : %.asciidoc asciidoc.conf + $(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \ + $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \ + $(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \ + -o $@+ $< && \ + $(MV) $@+ $@ + +%.html : %.asciidoc asciidoc.conf + $(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \ + $(ASCIIDOC) -b html -d article -f asciidoc.conf \ + $(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \ + -o $@+ $< && \ + $(MV) $@+ $@ diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf new file mode 100644 index 00000000..1ea74591 --- /dev/null +++ b/Documentation/asciidoc.conf @@ -0,0 +1,48 @@ +## linkbtrfs: macro +# +# Usage: linkbtrfs:command[manpage-section] +# +# Note, {0} is the manpage section, while {target} is the command. +# +# Show Btrfslink as: (
); if section is defined, else just show +# the command. + +[macros] +(?su)[\\]?(?Plinkbtrfs):(?P\S*?)\[(?P.*?)\]= + +[tags] +bracket-emphasis={1?[{1}]}<|> + +[quotes] +<|>=#bracket-emphasis + +[attributes] +asterisk=* +plus=+ +caret=^ +startsb=[ +endsb=] +backslash=\ +tilde=~ +apostrophe=' +backtick=` +litdd=-- + +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[header] +template::[header-declarations] + + +{mantitle} +{manvolnum} +Btrfs +{btrfs_version} +Btrfs Manual + + + {manname} + {manpurpose} + +endif::backend-docbook[] +endif::doctype-manpage[] diff --git a/Documentation/btrfs-balance.asciidoc b/Documentation/btrfs-balance.asciidoc new file mode 100644 index 00000000..c8407419 --- /dev/null +++ b/Documentation/btrfs-balance.asciidoc @@ -0,0 +1,217 @@ +btrfs-balance(8) +================ + +NAME +---- +btrfs-balance - balance block groups on a btrfs filesystem + +SYNOPSIS +-------- +*btrfs balance* + +DESCRIPTION +----------- +The primary purpose of the balance feature is to spread block groups accross +all devices so they match constraints defined by the respective profiles. See +`mkfs.btrfs`(8) section 'PROFILES' for more details. +The scope of the balancing process can be further tuned by use of filters that +can select the block groups to process. Balance works only on a mounted +filesystem. + +The balance operation is cancellable by the user. The on-disk state of the +filesystem is always consistent so an unexpected interruption (eg. system crash, +reboot) does not corrupt the filesystem. The progress of the balance operation +is temporarily stored and will be resumed upon mount, unless the mount option +'skip_balance' is specified. + +WARNING: running balance without filters will take a lot of time as it basically +rewrites the entire filesystem and needs to update all block pointers. + +The filters can be used to perform following actions: + +- convert block group profiles (filter 'convert') +- make block group usage more compact (filter 'usage') +- perform actions only on a given device (filters 'devid', 'drange') + +The filters can be applied to a combination of block group types (data, +metadata, system). Note that changing 'system' needs the force option. + +NOTE: the balance operation needs enough work space, ie. space that is +completely unused in the filesystem, otherwise this may lead to ENOSPC reports. +See the section 'ENOSPC' for more details. + +COMPATIBILITY +------------- + +NOTE: The balance subcommand also exists under the *btrfs filesystem* +namespace. This still works for backward compatibility but is deprecated and +should not be used anymore. + +NOTE: A short syntax *btrfs balance * works due to backward compatibility +but is deprecated and should not be used anymore. Use *btrfs balance start* +command instead. + +SUBCOMMAND +---------- +*cancel* :: +cancel running or paused balance + +*pause* :: +pause running balance operation, this will store the state of the balance +progress and used filters to the filesystem + +*resume* :: +resume interrupted balance + +*start* [options] :: +start the balance operation according to the specified filters, no filters +will rewrite the entire filesystem. The process runs in the foreground. ++ +`Options` ++ +-d[]:::: +act on data block groups, see `FILTERS` section for details about 'filters' +-m[]:::: +act on metadata chunks, see `FILTERS` section for details about 'filters' +-s[]:::: +act on system chunks (requires '-f'), see `FILTERS` section for details about 'filters'. +-v:::: +be verbose and print balance filter arguments +-f:::: +force reducing of metadata integrity, eg. when going from 'raid1' to 'single' + +*status* [-v] :: +Show status of running or paused balance. ++ +If '-v' option is given, output will be verbose. + +FILTERS +------- +From kernel 3.3 onwards, btrfs balance can limit its action to a subset of the +full filesystem, and can be used to change the replication configuration (e.g. +moving data from single to RAID1). This functionality is accessed through the +'-d', '-m' or '-s' options to btrfs balance start, which filter on data, +metadata and system blocks respectively. + +A filter has the following stucture: 'type'[='params'][,'type'=...] + +The available types are: + +*profiles=*:: +Balances only block groups with the given profiles. Parameters +are a list of profile names separated by "'|'" (pipe). + +*usage=*:: +*usage=*:: +Balances only block groups with usage under the given percentage. The +value of 0 is allowed and will clean up completely unused block groups, this +should not require any new work space allocated. You may want to use 'usage=0' +in case balance is returnin ENOSPC and your filesystem is not too full. ++ +The argument may be a single value or a range. The single value 'N' means 'at +most N percent used', equivalent to '..N' range syntax. Kernels prior to 4.4 +accept only the single value format. +The minimum range boundary is inclusive, maximum is exclusive. + +*devid=*:: +Balances only block groups which have at least one chunk on the given +device. To list devices with ids use *btrfs fi show*. + +*drange=*:: +Balance only block groups which overlap with the given byte range on any +device. Use in conjunction with 'devid' to filter on a specific device. The +parameter is a range specified as 'start..end'. + +*vrange=*:: +Balance only block groups which overlap with the given byte range in the +filesystem's internal virtual address space. This is the address space that +most reports from btrfs in the kernel log use. The parameter is a range +specified as 'start..end'. + +*convert=*:: +Convert each selected block group to the given profile name identified by +parameters. ++ +NOTE: starting with kernel 4.5, the 'data' chunks can be converted to/from the +'DUP' profile on a single device. + +*limit=*:: +*limit=*:: +Process only given number of chunks, after all filters are applied. This can be +used to specifically target a chunk in connection with other filters ('drange', +'vrange') or just simply limit the amount of work done by a single balance run. ++ +The argument may be a single value or a range. The single value 'N' means 'at +most N chunks', equivalent to '..N' range syntax. Kernels prior to 4.4 accept +only the single value format. The range minimum and maximum are inclusive. + +*stripes=*:: +Balance only block groups which have the given number of stripes. The parameter +is a range specified as 'start..end'. Makes sense fo block group profiles that +utilize striping, ie. RAID0/10/5/6. The range minimum and maximum are +inclusive. + +*soft*:: +Takes no parameters. Only has meaning when converting between profiles. +When doing convert from one profile to another and soft mode is on, +chunks that already have the target profile are left untouched. +This is useful e.g. when half of the filesystem was converted earlier but got +cancelled. ++ +The soft mode switch is (like every other filter) per-type. +For example, this means that we can convert metadata chunks the "hard" way +while converting data chunks selectively with soft switch. + +Profile names, used in 'profiles' and 'convert' are one of: 'raid0', 'raid1', +'raid10', 'raid5', 'raid6', 'dup', 'single'. The mixed data/metadata profiles +can be converted in the same way, but it's conversion between mixed and non-mixed +is not implemented. For the constraints of the profiles please refer to `mkfs.btrfs`(8), +section 'PROFILES'. + +ENOSPC +------ + +The way balance operates, it usually needs to temporarily create a new block +group and move the old data there. For that it needs work space, otherwise +it fails for ENOSPC reasons. +This is not the same ENOSPC as if the free space is exhausted. This refers to +the space on the level of block groups. + +The free work space can be calculated from the output of the *btrfs filesystem show* +command: + +------------------------------ + Label: 'BTRFS' uuid: 8a9d72cd-ead3-469d-b371-9c7203276265 + Total devices 2 FS bytes used 77.03GiB + devid 1 size 53.90GiB used 51.90GiB path /dev/sdc2 + devid 2 size 53.90GiB used 51.90GiB path /dev/sde1 +------------------------------ + +'size' - 'used' = 'free work space' + +'53.90GiB' - '51.90GiB' = '2.00GiB' + +An example of a filter that does not require workspace is 'usage=0'. This will +scan through all unused block groups of a given type and will reclaim the +space. Ater that it might be possible to run other filters. + +**CONVERSIONS ON MULTIPLE DEVICES** + +Conversion to profiles based on striping (RAID0, RAID5/6) require the work +space on each device. An interrupted balance may leave partially filled block +groups that might consume the work space. + +EXIT STATUS +----------- +*btrfs balance* returns a zero exit status if it succeeds. Non zero is +returned in case of failure. + +AVAILABILITY +------------ +*btrfs* is part of btrfs-progs. +Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for +further details. + +SEE ALSO +-------- +`mkfs.btrfs`(8), +`btrfs-device`(8) diff --git a/Documentation/btrfs-check.asciidoc b/Documentation/btrfs-check.asciidoc new file mode 100644 index 00000000..327a45d6 --- /dev/null +++ b/Documentation/btrfs-check.asciidoc @@ -0,0 +1,60 @@ +btrfs-check(8) +============== + +NAME +---- +btrfs-check - check or repair an unmounted btrfs filesystem + +SYNOPSIS +-------- +*btrfs check* [options] + +DESCRIPTION +----------- +*btrfs check* is used to check or repair an unmounted btrfs filesystem. + +NOTE: Since btrfs is under development, the *btrfs check* capabilities are +continuously enhanced. It's highly recommended to read the following btrfs +wiki before executing *btrfs check* with '--repair' option: + +https://btrfs.wiki.kernel.org/index.php/Btrfsck + +*btrfsck* is an alias of *btrfs check* command and is now deprecated. + +OPTIONS +------- +-s|--super :: +use th superblock copy, valid values are 0 up to 2 if the +respective superblock offset is within the filesystem +--repair:: +try to repair the filesystem +--init-csum-tree:: +create a new CRC tree and recalculate all checksums +--init-extent-tree:: +create a new extent tree +--check-data-csum:: +verify checksums of data blocks +-p|--progress:: +indicate progress at various checking phases +--qgroup-report:: +verify qgroup accounting and compare against filesystem accounting +--subvol-extents :: +show extent state for a subvolume +--tree-root :: +use the given bytenr for the tree root + +EXIT STATUS +----------- +*btrfs check* returns a zero exit status if it succeeds. Non zero is +returned in case of failure. + +AVAILABILITY +------------ +*btrfs* is part of btrfs-progs. +Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for +further details. + +SEE ALSO +-------- +`mkfs.btrfs`(8), +`btrfs-scrub`(8), +`btrfs-rescue`(8) diff --git a/Documentation/btrfs-convert.asciidoc b/Documentation/btrfs-convert.asciidoc new file mode 100644 index 00000000..ca3417f4 --- /dev/null +++ b/Documentation/btrfs-convert.asciidoc @@ -0,0 +1,98 @@ +btrfs-convert(8) +================ + +NAME +---- +btrfs-convert - convert from ext2/3/4 filesystem to btrfs + +SYNOPSIS +-------- +*btrfs-convert* [options] + +DESCRIPTION +----------- +*btrfs-convert* is used to convert existing ext2/3/4 filesystem image to a +btrfs filesystem in-place. The original filesystem image is accessible +subvolume named 'ext2_saved' as file 'image'. + +WARNING: If you are going to perform rollback to ext2/3/4, you should not +execute *btrfs balance* command on the converted filesystem. This will change +the extent layout and make *btrfs-convert* unable to rollback. + +The conversion utilizes free space of the original filesystem. The exact +estimate of the required space cannot be foretold. The final btrfs metadata +might occupy several gigabytes on a hundreds-gigabyte filesystem. + +If you decide not to rollback anymore, it is recommended to perform a few more +steps to transform the btrfs filesystem to a more compact layout. The +conversion inherits the original data block fragmentation and the metadata +blocks are bound to the original free space layout. + +**REMOVE THE ORIGINAL FILESYSTEM METADATA** + +By removing the 'ext2_saved' subvolume, all metadata of the original filesystem +will be removed: + + # btrfs subvolume delete /mnt/ext2_saved + +At this point it's not possible to do rollback. The filesystem is usable but may +be impacted by the fragmentation. + +**MAKE FILE DATA MORE CONTIGUOUS** + +An optional but recommended step is to run defragmentation on the entire +filesystem. This will attempt to make file extents more contiguous. + + # btrfs filesystem defrag -v -r -f -t 32M /mnt/btrfs + +Verbose recursive defragmentation ('-v', '-r'), flush data per-file ('-f') with target +extent size 32M ('-t'). + +**ATTEMPT TO MAKE BTRFS METADATA MORE COMPACT** + +Optional but recommended step. + +The metadata block groups after conversion may be smaller than the default size +(256MiB or 1GiB). Running a balance will attempt to merge the block groups. +This depends on the free space layout (and fragmentation) and may fail. This is +a soft error leaving the filesystem usable but the block group layout may +remain unchanged. + +Note that balance operation takes a lot of time. + + # btrfs balance start -m /mnt/btrfs + +OPTIONS +------- +-d|--no-datasum:: +disable data checksum calculations and set NODATASUM file flag, this can speed +up the conversion +-i|--no-xattr:: +ignore xattrs and ACLs of files +-n|--no-inline:: +disable inlining of small files to metadata blocks, this will decrease the metadata +consumption and may help to convert a filesystem with low free space +-N|--nodesize :: +set filesystem nodesize, the tree block size in which btrfs stores its metadata. +The default value is 16KB (16384) or the page size, whichever is bigger. +Must be a multiple of the sectorsize, but not larger than 65536. Se +`mkfs.btrfs`(8) for more details. +-r|--rollback:: +rollback to the original ext2/3/4 filesystem if possible +-l|--label