]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
losetup: rename to --sector-size and LOG-SEC
authorKarel Zak <kzak@redhat.com>
Mon, 2 Oct 2017 09:59:57 +0000 (11:59 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Oct 2017 09:59:57 +0000 (11:59 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/losetup.8
sys-utils/losetup.c

index 570704d725fb6bdf91123ac6e858a2a2661acb2f..cdb9ed05273fa98d1bcb259b7d43d31277dba1f3 100644 (file)
@@ -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
index 368a0b90a7e87ce7f03dea8800facf02ec2c1db0..da0fbc90572e0adc66cf051824a07ca5fb4d104f 100644 (file)
@@ -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 <num>            start at offset <num> into file\n"), out);
        fputs(_("     --sizelimit <num>         device is limited to <num> bytes of the file\n"), out);
-       fputs(_(" -b  --logical-blocksize <num> set the logical block size to <num>\n"), out);
+       fputs(_(" -b  --sector-size <num>       set the logical sector size to <num>\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[=<on|off>]    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) {