[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180710140127.20739-5-jlayton@kernel.org>
Date: Tue, 10 Jul 2018 10:01:27 -0400
From: Jeff Layton <jlayton@...nel.org>
To: viro@...IV.linux.org.uk, dhowells@...hat.com
Cc: willy@...radead.org, andres@...razel.de, cmaiolino@...hat.com,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: [PATCH v2 4/4] samples: extend test-fsinfo to access error_state
From: Jeff Layton <jlayton@...hat.com>
Add support for error_state struct to test-fsinfo sample program.
Signed-off-by: Jeff Layton <jlayton@...hat.com>
---
samples/statx/test-fsinfo.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/samples/statx/test-fsinfo.c b/samples/statx/test-fsinfo.c
index 9e9fa62a3b9f..01dd8c6d3c86 100644
--- a/samples/statx/test-fsinfo.c
+++ b/samples/statx/test-fsinfo.c
@@ -60,6 +60,7 @@ static const __u8 fsinfo_buffer_sizes[fsinfo_attr__nr] = {
FSINFO_STRING (name_encoding),
FSINFO_STRING (name_codepage),
FSINFO_STRUCT (io_size),
+ FSINFO_STRUCT (error_state),
};
#define FSINFO_NAME(N) [fsinfo_attr_##N] = #N
@@ -84,6 +85,7 @@ static const char *fsinfo_attr_names[fsinfo_attr__nr] = {
FSINFO_NAME(name_encoding),
FSINFO_NAME(name_codepage),
FSINFO_NAME(io_size),
+ FSINFO_NAME(error_state),
};
union reply {
@@ -98,6 +100,7 @@ union reply {
struct fsinfo_volume_uuid uuid;
struct fsinfo_server_address srv_addr;
struct fsinfo_io_size io_size;
+ struct fsinfo_error_state error_state;
};
static void dump_hex(unsigned int *data, int from, int to)
@@ -304,6 +307,15 @@ static void dump_attr_io_size(union reply *r, int size)
printf("bs=%u\n", f->block_size);
}
+static void dump_attr_error_state(union reply *r, int size)
+{
+ struct fsinfo_error_state *f = &r->error_state;
+
+ printf("err_cookie=0x%x err_last=%u\n",
+ f->wb_error_cookie,
+ f->wb_error_last);
+}
+
/*
*
*/
@@ -321,6 +333,7 @@ static const dumper_t fsinfo_attr_dumper[fsinfo_attr__nr] = {
FSINFO_DUMPER(volume_uuid),
FSINFO_DUMPER(server_address),
FSINFO_DUMPER(io_size),
+ FSINFO_DUMPER(error_state),
};
static void dump_fsinfo(enum fsinfo_attribute attr, __u8 about,
--
2.17.1
Powered by blists - more mailing lists