From: Karel Zak Date: Mon, 2 Oct 2017 09:59:57 +0000 (+0200) Subject: losetup: rename to --sector-size and LOG-SEC X-Git-Tag: v2.31-rc2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76493ceba6600d3a98ad00deaf12edcf305f5ad4;p=thirdparty%2Futil-linux.git losetup: rename to --sector-size and LOG-SEC Signed-off-by: Karel Zak --- diff --git a/sys-utils/losetup.8 b/sys-utils/losetup.8 index 570704d725..cdb9ed0527 100644 --- a/sys-utils/losetup.8 +++ b/sys-utils/losetup.8 @@ -7,7 +7,7 @@ Get info: .sp .in +5 .B losetup -.I loopdev +[\fIloopdev\fP] .sp .B losetup -l .RB [ \-a ] @@ -31,12 +31,6 @@ Detach all associated loop devices: .B "losetup \-D" .sp .in -5 -Print the name of the first unused loop device: -.sp -.in +5 -.B "losetup \-f" -.sp -.in -5 Set up a loop device: .sp .in +5 @@ -45,6 +39,8 @@ Set up a loop device: .IR offset ] .RB [ \-\-sizelimit .IR size ] +.RB [ \-\-sector\-size +.IR size ] .in +8 .RB [ \-Pr ] .RB [ \-\-show ] " \-f" | \fIloopdev\fP @@ -116,8 +112,10 @@ The data start is moved \fIoffset\fP bytes into the specified file or device. .IP "\fB\-\-sizelimit \fIsize\fP" The data end is set to no more than \fIsize\fP bytes after the data start. .TP -.BR \-b , " \-\-logical-blocksize " \fIsize -Set the logical block size of the loop device in bytes (since Linux 4.14). +.BR \-b , " \-\-sector-size " \fIsize +Set the logical sector size of the loop device in bytes (since Linux 4.14). The +option may be used when create a new loop device as well as stand-alone command +to modify sector size of the already existing loop device. .TP .BR \-c , " \-\-set\-capacity " \fIloopdev Force the loop driver to reread the size of the file associated with the diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index 368a0b90a7..da0fbc9057 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -51,7 +51,7 @@ enum { COL_RO, COL_SIZELIMIT, COL_DIO, - COL_BLOCKSIZE, + COL_LOGSEC, }; /* basic output flags */ @@ -78,7 +78,7 @@ static struct colinfo infos[] = { [COL_SIZELIMIT] = { "SIZELIMIT", 5, SCOLS_FL_RIGHT, N_("size limit of the file in bytes")}, [COL_MAJMIN] = { "MAJ:MIN", 3, 0, N_("loop device major:minor number")}, [COL_DIO] = { "DIO", 1, SCOLS_FL_RIGHT, N_("access backing file with direct-io")}, - [COL_BLOCKSIZE] = { "BLOCKSIZE", 4, SCOLS_FL_RIGHT, N_("logical block size in bytes")}, + [COL_LOGSEC] = { "LOG-SEC", 4, SCOLS_FL_RIGHT, N_("logical sector size in bytes")}, }; static int columns[ARRAY_SIZE(infos) * 2] = {-1}; @@ -283,7 +283,7 @@ static int set_scols_data(struct loopdev_cxt *lc, struct libscols_line *ln) case COL_PARTSCAN: p = loopcxt_is_partscan(lc) ? "1" : "0"; break; - case COL_BLOCKSIZE: + case COL_LOGSEC: if (loopcxt_get_blocksize(lc, &x) == 0) xasprintf(&np, "%jd", x); break; @@ -411,7 +411,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(USAGE_SEPARATOR, out); fputs(_(" -o, --offset start at offset into file\n"), out); fputs(_(" --sizelimit device is limited to bytes of the file\n"), out); - fputs(_(" -b --logical-blocksize set the logical block size to \n"), out); + fputs(_(" -b --sector-size set the logical sector size to \n"), out); fputs(_(" -P, --partscan create a partitioned loop device\n"), out); fputs(_(" -r, --read-only set up a read-only loop device\n"), out); fputs(_(" --direct-io[=] open backing file with O_DIRECT\n"), out); @@ -597,7 +597,7 @@ int main(int argc, char **argv) { "associated", required_argument, NULL, 'j' }, { "json", no_argument, NULL, 'J' }, { "list", no_argument, NULL, 'l' }, - { "logical-blocksize", required_argument, NULL, 'b' }, + { "sector-size", required_argument, NULL, 'b' }, { "noheadings", no_argument, NULL, 'n' }, { "offset", required_argument, NULL, 'o' }, { "output", required_argument, NULL, 'O' }, @@ -740,7 +740,7 @@ int main(int argc, char **argv) columns[ncolumns++] = COL_RO; columns[ncolumns++] = COL_BACK_FILE; columns[ncolumns++] = COL_DIO; - columns[ncolumns++] = COL_BLOCKSIZE; + columns[ncolumns++] = COL_LOGSEC; } if (act == A_FIND_FREE && optind < argc) {