summaryrefslogtreecommitdiffstats
path: root/sys-utils/losetup.c
diff options
context:
space:
mode:
authorMing Lei2015-11-17 15:32:48 +0100
committerKarel Zak2015-11-19 11:27:36 +0100
commitfaeef4d2e9d5e38bed57846ba903009990f24422 (patch)
treeedeabbde252963bc44bc4e1e18eeccd76159fc6a /sys-utils/losetup.c
parentlosetup: support ioctl cmd of LOOP_SET_DIRECT_IO (diff)
downloadkernel-qcow2-util-linux-faeef4d2e9d5e38bed57846ba903009990f24422.tar.gz
kernel-qcow2-util-linux-faeef4d2e9d5e38bed57846ba903009990f24422.tar.xz
kernel-qcow2-util-linux-faeef4d2e9d5e38bed57846ba903009990f24422.zip
losetup: support list direct io
So that user can see if DIO is set for current loop device. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Diffstat (limited to 'sys-utils/losetup.c')
-rw-r--r--sys-utils/losetup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index 68f777798..918c34da6 100644
--- a/sys-utils/losetup.c
+++ b/sys-utils/losetup.c
@@ -49,6 +49,7 @@ enum {
COL_PARTSCAN,
COL_RO,
COL_SIZELIMIT,
+ COL_DIO,
};
/* basic output flags */
@@ -74,6 +75,7 @@ static struct colinfo infos[] = {
[COL_RO] = { "RO", 1, SCOLS_FL_RIGHT, N_("read-only device")},
[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")},
};
static int columns[ARRAY_SIZE(infos) * 2] = {-1};
@@ -271,6 +273,9 @@ static int set_scols_data(struct loopdev_cxt *lc, struct libscols_line *ln)
case COL_RO:
p = loopcxt_is_readonly(lc) ? "1" : "0";
break;
+ case COL_DIO:
+ p = loopcxt_is_dio(lc) ? "1" : "0";
+ break;
case COL_PARTSCAN:
p = loopcxt_is_partscan(lc) ? "1" : "0";
break;
@@ -599,6 +604,7 @@ int main(int argc, char **argv)
columns[ncolumns++] = COL_AUTOCLR;
columns[ncolumns++] = COL_RO;
columns[ncolumns++] = COL_BACK_FILE;
+ columns[ncolumns++] = COL_DIO;
}
if (act == A_FIND_FREE && optind < argc) {