summaryrefslogtreecommitdiffstats
path: root/disk-utils/blockdev.c
Commit message (Collapse)AuthorAgeFilesLines
* fix buffer overrun in some calls to sscanfKarel Zak2012-07-091-1/+1
| | | | | Reported-by: Sergei Antonov <saproj@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* disk-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* blockdev: make the code more readable for static analysersKarel Zak2012-02-021-7/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: remove non-ANSI function declaration [smatch scan]Karel Zak2012-01-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: make functions staticWanlong Gao2012-01-051-8/+8
| | | | | | make the functions in blockdev to statics. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* blockdev: indent usage()Karel Zak2011-08-161-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: coding style fixSami Kerola2011-06-301-29/+31
| | | | | | Sync with README.devel Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* blockdev: type mismatch fixSami Kerola2011-06-301-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* blockdev: broken compiler warning circumvention removedSami Kerola2011-06-301-4/+0Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* blockdev: use pathnames.h to find partitionsSami Kerola2011-06-301-4/+3Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* blockdev: use libc error facilitiesSami Kerola2011-06-301-11/+9Star
| | | | | | | Favour symbolic return values and use {err,warn}{,x} where ever applies. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* blockdev: add --help optionSami Kerola2011-06-301-24/+23Star
| | | | | | | | The option is also accepted in format `-h'. As a side effect usage function is now able to return success, and since it had to be touched the printing is cleaned up. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* blockdev: remove prognameSami Kerola2011-06-291-24/+10Star
| | | | | | Use errx, warnx or program_invocation_short_name instead. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* blockdev: set options read onlySami Kerola2011-06-291-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* blockdev: sync man page with codeKarel Zak2010-08-241-5/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: add BLKDISCARDZEROESKarel Zak2010-08-241-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* messages: gettextize a few skipped or forgotten onesBenno Schulenberg2010-06-141-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* blockdev: reduce usage text widthFrancesco Cosoleto2010-03-311-4/+4
| | | | | | | | | | Use spaces in usage text instead of tabs and reduce the distance between option names and descriptions. This helps to minimize problems due to limited number of columns and translated texts which take up more space than English. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* blockdev: use c.hKarel Zak2009-10-161-4/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: fix topology ioctlsKarel Zak2009-10-151-1/+1
| | | | | | | | | | | | | | kernel 2.6.32-rc4 (kvm): # blockdev -v --getss --getpbsz --getiomin --getioopt --getmaxsect --getalignoff /dev/sda get logical block (sector) size: 512 get physical block (sector) size: 512 get minimum I/O size: 512 get optimal I/O size: 0 get max sectors per request: 1024 get alignment offset: 0 Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: add topology ioctls supportKarel Zak2009-10-151-1/+31
| | | | | | | | | | | | new options: --getpbsz get physical block (sector) size --getiomin get minimum I/O size --getioopt get optimal I/O size --getalignoff get alignment offset --getmaxsect get max sectors per request Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: add support for uint and ushort ioctlsKarel Zak2009-10-151-0/+18
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: refactoring (better commands definition)Karel Zak2009-10-141-92/+162
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: fix possible buffer overflowKarel Zak2009-04-291-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: use lib/blkdev.c, fix --reportKarel Zak2007-11-071-83/+9Star
| | | | | | | | | | This patch replaces duplicate code with blkdev_ functions from lib/blkdev.c. The patch also fix the output from "blockdev --report". The Size field was in 512-byte sectors instead in real size in bytes. Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: fix: opened file leaving unclosedlizf2007-10-261-0/+4
| | | | Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
* po: gettextizing some overlooked messages.Benno Schulenberg2007-08-141-2/+2
| | | | | | | | Gettextize three new strings, make two strings indentical to two others, and gettextize three strings that are already gettextized elsewhere. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: use LU and LLU for BLKGETSIZE and BLKGETSIZE64Karel Zak2007-08-011-2/+28
| | | | | | | | | | | The "blkockdev --getsize" returns negative numbers on i386 for 1Tb devices. The BLKGETSIZE and BLKGETSIZE64 have to use unsigned long and unsigned long long. $ blockdev --getsize /dev/mapper/huge -2147483648 Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: fix "blockdev --getsz" for large devicesKarel Zak2007-08-011-2/+5
| | | | | | | The "blockdev --getsz" command doesn't try to use BLKGETSIZE64 when previous BLKGETSIZE failed with EFBIG. This patch fixes this problem. Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: cleanup usage() and update man pageKarel Zak2007-06-291-6/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: add BLKFRAGET/BLKFRASET ioctlsKarel Zak2007-06-291-0/+8
| | | | | | | | | | | | | | In Linux 2.6 the BLKRASET ioctl has the desired effect for mounted file-systems. In Linux 2.4 it appears to set the number of blocks to read-ahead on the *device* as opposed to within a *file*, and the maximum value of this number is 255. As a result the invocation of blockdev will fail on Linux 2.4 for any usefully large value of READAHEAD, and will not in any case have the desired affect for fragmented files. (Based on the blockdev-getfra-setfra.patch Debian patch.) Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.13-pre2 tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.13-pre1 tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.12b tarball.Karel Zak2006-12-071-9/+55
|
* Imported from util-linux-2.11o tarball.Karel Zak2006-12-071-1/+0Star
|
* Imported from util-linux-2.11n tarball.Karel Zak2006-12-071-3/+97
|
* Imported from util-linux-2.11m tarball.Karel Zak2006-12-071-4/+24
|
* Imported from util-linux-2.10m tarball.Karel Zak2006-12-071-2/+15
|
* Imported from util-linux-2.10f tarball.Karel Zak2006-12-071-0/+220