btrfs-progs: rename time-long format name to date-time

Make the timestamp format more descriptive what is actually printed. We
may need separate date or time in the future.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-08-18 01:39:32 +02:00
parent 386765be15
commit 70ae158ec8
3 changed files with 5 additions and 5 deletions

View File

@ -52,16 +52,16 @@ const struct rowspec btrfs_subvolume_rowspec[] = {
{ .key = "cgen", .fmt = "%llu", .out_json = "cgeneration" },
{ .key = "parent", .fmt = "%llu", .out_json = "parent" },
{ .key = "top level", .fmt = "%llu", .out_json = "top_level" },
{ .key = "otime", .fmt = "time-long", .out_json = "otime" },
{ .key = "otime", .fmt = "date-time", .out_json = "otime" },
{ .key = "parent_uuid", .fmt = "uuid", .out_json = "parent_uuid" },
{ .key = "received_uuid", .fmt = "uuid", .out_json = "received_uuid" },
{ .key = "uuid", .fmt = "uuid", .out_json = "uuid" },
{ .key = "path", .fmt = "%s", .out_json = "path" },
{ .key = "flag-list-item", .fmt = "%s" },
{ .key = "stransid", .fmt = "%llu", .out_json = "stransid" },
{ .key = "stime", .fmt = "time-long", .out_json = "stime" },
{ .key = "stime", .fmt = "date-time", .out_json = "stime" },
{ .key = "rtransid", .fmt = "%llu", .out_json = "rtransid" },
{ .key = "rtime", .fmt = "time-long", .out_json = "rtime" },
{ .key = "rtime", .fmt = "date-time", .out_json = "rtime" },
{ .key = "snapshot-list-item", .fmt = "%s" },
{ .key = "quota-qgroup", .fmt = "qgroupid", .out_json = "qgroupid" },
{ .key = "quota-ref", .fmt = "%llu", .out_json = "referenced" },

View File

@ -350,7 +350,7 @@ void fmt_print(struct format_ctx *fctx, const char* key, ...)
const u8 *uuid = va_arg(args, const u8*);
print_uuid(uuid);
} else if (strcmp(row->fmt, "time-long") == 0) {
} else if (strcmp(row->fmt, "date-time") == 0) {
const time_t ts = va_arg(args, time_t);
if (ts) {

View File

@ -33,7 +33,7 @@ struct rowspec {
* (values: const char *)
* - uuid: format UUID as text
* (value: u8 *uuid)
* - time-long: pretty print timestamp, including timezone
* - date-time: pretty print timestamp, date, time and timezone
* (values: time_t)
* - list: print list opening bracket [
* (values printed separately)