summaryrefslogtreecommitdiff
path: root/cmds-balance.c
Commit message (Collapse)AuthorAge
* btrfs-progs: cleanup option index argument from getopt_longDavid Sterba2015-04-08
| | | | | | | We're not using it anywhere. The best practice is to add enums with values > 255 for the long options, option index counting is error prone. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: drop old fi balance syntax from helpDavid Sterba2015-02-02
| | | | | | | The command 'btrfs fi balance' still works to keep any scripts working, we may remove it someday. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: unify getopt table terminatorsDavid Sterba2015-01-21
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: make getopt tables static constDavid Sterba2015-01-19
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: balance filter: add limit of processed chunksDavid Sterba2014-08-22
| | | | | | | | | | | | | | | Add more control to the balance behaviour. Usage filter may not be finegrained enough and can lead to moving too many chunks at once. Another example use is in connection with drange+devid or vrange filters that allow to work with a specific chunk or even with a chunk on a given device. The limit filter applies last, the value of 0 means no limiting. CC: Ilya Dryomov <idryomov@gmail.com> CC: Hugo Mills <hugo@carfax.org.uk> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fix minor grammar issuesMitchel Humpherys2014-01-31
| | | | | | | | Remove the extraneous `to' from `Can't access to X'. Signed-off-by: Mitchel Humpherys <mitch.special@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
* Btrfs-progs: fix magic return value in cmds-balance.cWang Shilong2013-10-16
| | | | | | | | | | | If there is no balance in progress, resume/pause/cancel will return 2. Usage or syntax errors will return 1. And 0 means operations return successfully. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: use NULL instead of 0Zach Brown2013-09-03
| | | | | | | | | These were mostly in option structs but there were a few gross string pointer arguments given as 0. Signed-off-by: Zach Brown <zab@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: fix closing of opendir()Wang Shilong2013-08-09
| | | | | | | | | | valgrind complains open_file_or_dir() causes a memory leak.That is because if we open a directoy by opendir(), and then we should call closedir() to free memory. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: no pending balance is not an errorAnand Jain2013-04-23
| | | | | | | | Having no balance running/ paused/completed is a normal situation, so the current output message should be positive with return val zero. Signed-off-by: Anand Jain <anand.jain@oracle.com>
* btrfs-progs: initialize save_ptr prior to strtok_rEric Sandeen2013-02-27
| | | | | | | | | | | | | The coverity runs had a false positive complaining that save_ptr is uninitialized in the call to strtok_r. Turns out that under the covers glibc was doing enough to confuse the checker about what was being called. Just to keep the noise down, do a harmless initialization, with a comment as to why. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* Btrfs-progs: make 0 a valid usage filter argumentIlya Dryomov2013-02-13
| | | | | | | | This is a progs counterpart to a "Btrfs: allow for selecting only completely empty chunks". usage=0 now means "select only only completely empty chunks and nothing else". Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* Merge branch 'for-chris' of git://repo.or.cz/btrfs-progs-unstable/devel into ↵Chris Mason2013-02-06
|\ | | | | | | | | | | | | | | | | raid56 Conflicts: ctree.h Signed-off-by: Chris Mason <chris.mason@fusionio.com>
| * Btrfs-progs: move open_file_or_dir() to utils.cAnand Jain2013-01-30
| | | | | | | | | | | | | | | | | | | | | | The definition of the function open_file_or_dir() is moved from common.c to utils.c in order to be able to share some common code between scrub and the device stats in the following step. That common code uses open_file_or_dir(). Since open_file_or_dir() makes use of the function dirfd(3), the required XOPEN version was raised from 6 to 7. Signed-off-by: Anand Jain <anand.jain@oracle.com> Original-Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
| * Btrfs-progs: Fix typo in balance start usage; filetrs -> filters.Andreas Fischer2013-01-22
| | | | | | | | | | | | | | Fix typo in "btrfs balance start" usage documentation: 'filetrs' should have been 'filters'. Signed-off-by: Andreas Fischer <info@andreasfischer.net>
* | Add basic RAID[56] supportDavid Woodhouse2013-02-01
|/ | | | | | | | | | | | | | | | David Woodhouse originally contributed this code, and Chris Mason changed it around to reflect the current design goals for raid56. The original code expected all metadata and data writes to be full stripes. This meant metadata block size == stripe size, and had a few other restrictions. This version allows metadata blocks smaller than the stripe size. It implements both raid5 and raid6, although it does not have code to rebuild from parity if one of the drives is missing or incorrect. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: allow multi-line command group synopsisIlya Dryomov2012-02-08
| | | | Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* Btrfs-progs: fall back to the v1 ioctl if the new balance ioctl failsChris Mason2012-02-05
| | | | | | | | This only falls back if the plain version of balance start is used. Any args make us report the ioctl isn't supported. Signed-off-by: Chris Mason <chris.mason@oracle.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* Btrfs-progs: add restriper commandsIlya Dryomov2012-02-03
| | | | Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* Btrfs-progs: add 'balance' command group infrastructureIlya Dryomov2012-02-03
Add balance command group under both 'btrfs' and 'btrfs filesystem'. Preserve the old 'btrfs filesystem balance <path>' behaviour. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>