summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bash-completion/blockdev7
-rw-r--r--disk-utils/blockdev.82
-rw-r--r--disk-utils/blockdev.c7
3 files changed, 15 insertions, 1 deletions
diff --git a/bash-completion/blockdev b/bash-completion/blockdev
index 588995562..ce986cb45 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 6ab43249f..2b3d64c88 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 dc02d48c0..4543818bd 100644
--- a/disk-utils/blockdev.c
+++ b/disk-utils/blockdev.c
@@ -122,6 +122,13 @@ static const struct bdc bdcms[] =
.argval = -1,
.help = N_("get blocksize")
},{
+ IOCTL_ENTRY(BLKBSZSET),
+ .name = "--setbsz",
+ .argname = "<bytes>",
+ .argtype = ARG_INT,
+ .flags = FL_NORESULT,
+ .help = N_("set blocksize")
+ },{
IOCTL_ENTRY(BLKGETSIZE),
.name = "--getsize",
.argtype = ARG_ULONG,