summaryrefslogtreecommitdiffstats
path: root/sys-utils/blkzone.c
Commit message (Collapse)AuthorAgeFilesLines
* blkzone: remove never read valueKarel Zak2019-05-231-3/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-6/+5Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: fix report zones sector offset checkMasato Suzuki2018-10-231-2/+3
| | | | | | | To catch an offset error, an offset should be begger than or equal to a device size in the condition. Signed-off-by: Masato Suzuki <masato.suzuki@wdc.com>
* blkzone: use new ul_path_* APIKarel Zak2018-06-211-8/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: fix whole device detectionKarel Zak2018-06-081-4/+5
| | | | | | | | | | | | | | Matias Bjørling wrote: The current detection code for chunk size assumes that the underlying device is a device that uses the minor device id as the partition id, and that the whole device has minor id 0. This is not true for example null_blk and nvme device drivers. Let's use sysfs_devno_to_wholedisk() to get whole-disk devno. Addresses: https://github.com/karelzak/util-linux/pull/646 Reported-by: Matias Bjørling matias.bjorling@wdc.com Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-291-2/+2
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-271-2/+1Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cosmetics, remove argument from usage(FILE*)Ruediger Meier2017-06-261-3/+4
| | | | | | | | | | | | | | This patch is trivial and changes nothing, because we were always using usage(stdout) Now all our usage() functions look very similar. If wanted we could auto-generate another big cosmetical patch to remove all the useless "FILE *out" constants and use printf and puts rather than their f* friends. Such patch could be automatically synchronized with the translation project (newlines!) to not make the translators sick. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* include/c.h: add USAGE_COMMANDS and USAGE_COLUMNSJ William Piggott2017-06-241-1/+1
| | | | | | | | | | | | * login-utils/lslogins.c: all uses changed * misc-utils/findmnt.c: likewise * sys-utils/blkzone.c: likewise * disk-utils/sfdisk.c: likewise * sys-utils/lscpu.c: likewise * sys-utils/lsmem.c: likewise * sys-utils/wdctl.c: likewise Signed-off-by: J William Piggott <elseifthen@gmx.com>
* blkzone: Fix zone condition strings handlingDamien Le Moal2017-04-181-4/+4
| | | | | | | | | | | Fixed the condition strings for implicit open and explicit open to match the man page defined strings ("oi" and "oe"). Also while at it, correct the condition_str array entries adding the reserved "xC" case so that the read_only, full and offline conditions match the condition codes. This increases the array size to 16, so also fix the condition code masking when displaying the result. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
* misc: fix some printf format stringsRuediger Meier2017-04-101-4/+4
| | | | | | | | | | | Fix compiler warnings seen on Linux/i586 and OSX/travis. #type #format #cast unsigned long %lu - uint64_t PRIu64 - fdisk_sector_t %ju (uintmax_t) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* blkzone: use optutils.h to check mutually exclusive optionsKarel Zak2017-02-241-6/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: Add --count optionDamien Le Moal2017-02-241-24/+52
| | | | | | | | | | | The length option is used to specify the number of zones to operate on. To be more consistent with other tools, have this option use a number of sectors and introduce the --count option to allow users to specify a number of zones. The --count and --length options cannot be used together on the command line. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
* blkzone: Improve zone information printDamien Le Moal2017-02-241-11/+11
| | | | | | | | | | | Add "0x" to the zone start, length and write pointer print to make it always clear that the values are Hexadecimal. Also update the zone condition string and associated comments to match more closely the wording in the standard document. The man page is also updated to match the new wording. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
* blkzone: Report all zones if length is not specifiedDamien Le Moal2017-02-241-54/+72
| | | | | | | | | Report all zones of the block device when length is not specified on the command line. To do this, introduce an inner loop in blkzone_report to repeatedly issue report zone ioctl to the device. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
* blkzone: Reset all zones when length is not specifiedDamien Le Moal2017-02-241-3/+5
| | | | | | | If length is 0, operate on all zones starting from offset. This also fix the maximum length calculation from offset. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
* blkzone: add new command (merge blkreport and blkreset)Karel Zak2017-02-231-0/+350
This new command is based on the original implementation of blkreport and blkreset command. Signed-off-by: Karel Zak <kzak@redhat.com>