From: Karel Zak Date: Fri, 11 Oct 2013 09:05:45 +0000 (+0200) Subject: Revert "blockdev: Remove the --setbsz (set blocksize) option which has never worked." X-Git-Tag: v2.24-rc2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39d2e7067d7c61e579079a72bbd80e3bce31cfc3;p=thirdparty%2Futil-linux.git Revert "blockdev: Remove the --setbsz (set blocksize) option which has never worked." This reverts commit b1555acc2f709ac4f3b1e6c686a11cadb7b04f72. It seems that the option is used by kernel guys to test kernel, so let's keep the option in the blockdev(8) although it's almost useless in userspace. All we need is to improve docs to make things more obvious to end users. Signed-off-by: Karel Zak --- diff --git a/bash-completion/blockdev b/bash-completion/blockdev index 5889955626..ce986cb45f 100644 --- a/bash-completion/blockdev +++ b/bash-completion/blockdev @@ -19,6 +19,7 @@ _blockdev_module() --getalignoff --getmaxsect --getbsz + --setbsz --getsize64 --setra --getra @@ -28,7 +29,11 @@ _blockdev_module() --rereadpt $DEVS" case $prev in - '--setfra') + '--setbsz') + COMPREPLY=( $(compgen -W "bytes" -- $cur) ) + return 0 + ;; + '--setbsz'|'--setfra') COMPREPLY=( $(compgen -W "sectors" -- $cur) ) return 0 ;; diff --git a/disk-utils/blockdev.8 b/disk-utils/blockdev.8 index 6ab43249f1..2b3d64c88f 100644 --- a/disk-utils/blockdev.8 +++ b/disk-utils/blockdev.8 @@ -67,6 +67,8 @@ Print sectorsize in bytes - usually 512. Get size in 512-byte sectors. .IP "\fB\-\-rereadpt\fP" Reread partition table +.IP "\fB\-\-setbsz\fP \fIbytes\fP" +Set blocksize. .IP "\fB\-\-setfra\fP \fIsectors\fP" Set filesystem readahead (same like --setra on 2.6 kernels). .IP "\fB\-\-setra\fP \fIsectors\fP" diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c index dc02d48c0f..4543818bd4 100644 --- a/disk-utils/blockdev.c +++ b/disk-utils/blockdev.c @@ -121,6 +121,13 @@ static const struct bdc bdcms[] = .argtype = ARG_INT, .argval = -1, .help = N_("get blocksize") + },{ + IOCTL_ENTRY(BLKBSZSET), + .name = "--setbsz", + .argname = "", + .argtype = ARG_INT, + .flags = FL_NORESULT, + .help = N_("set blocksize") },{ IOCTL_ENTRY(BLKGETSIZE), .name = "--getsize",