FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 04-21-2008, 12:59 PM
 
Default device-mapper ./WHATS_NEW dmsetup/dmsetup.c

CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: agk@sourceware.org 2008-04-21 11:59:22

Modified files:
. : WHATS_NEW
dmsetup : dmsetup.c

Log message:
Add --prefixes to dmsetup

E.g. dmsetup info -c --prefixes

Again, might change the name of this option.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.229&r2=1.230
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmsetup/dmsetup.c.diff?cvsroot=dm&r1=1.104&r2=1.105

--- device-mapper/WHATS_NEW 2008/04/20 00:11:07 1.229
+++ device-mapper/WHATS_NEW 2008/04/21 11:59:22 1.230
@@ -1,5 +1,6 @@
Version 1.02.26 -
=================================
+ Add --prefixes to dmsetup.
Add field name prefix option to reporting functions.
Calculate string size within dm_pool_grow_object.

--- device-mapper/dmsetup/dmsetup.c 2008/04/19 15:50:17 1.104
+++ device-mapper/dmsetup/dmsetup.c 2008/04/21 11:59:22 1.105
@@ -120,6 +120,7 @@
NOOPENCOUNT_ARG,
NOTABLE_ARG,
OPTIONS_ARG,
+ PREFIXES_ARG,
READAHEAD_ARG,
SEPARATOR_ARG,
SHOWKEYS_ARG,
@@ -1914,7 +1915,7 @@
char *options = (char *) default_report_options;
const char *keys = "";
const char *separator = " ";
- int aligned = 1, headings = 1, buffered = 1;
+ int aligned = 1, headings = 1, buffered = 1, field_prefixes = 0;
uint32_t flags = 0;
size_t len = 0;
int r = 0;
@@ -1929,6 +1930,11 @@
if (_switches[UNBUFFERED_ARG])
buffered = 0;

+ if (_switches[PREFIXES_ARG]) {
+ aligned = 0;
+ field_prefixes = 1;
+ }
+
if (_switches[OPTIONS_ARG] && _string_args[OPTIONS_ARG]) {
if (*_string_args[OPTIONS_ARG] != '+')
options = _string_args[OPTIONS_ARG];
@@ -1971,6 +1977,9 @@
if (headings)
flags |= DM_REPORT_OUTPUT_HEADINGS;

+ if (field_prefixes)
+ flags |= DM_REPORT_OUTPUT_FIELD_NAME_PREFIX;
+
if (!(_report = dm_report_init(&_report_type,
_report_types, _report_fields,
options, separator, flags, keys, NULL)))
@@ -1981,6 +1990,9 @@
goto out;
}

+ if (field_prefixes)
+ dm_report_set_output_field_name_prefix(_report, "dm_");
+
r = 1;

out:
@@ -2047,7 +2059,7 @@
" [-r|--readonly] [--noopencount] [--nolockfs]
"
" [--readahead [+]<sectors>|auto|none]
"
" [-c|-C|--columns] [-o <fields>] [-O|--sort <sort_fields>]
"
- " [--noheadings] [--separator <separator>]

");
+ " [--noheadings] [--prefixes] [--separator <separator>]

");
for (i = 0; _commands[i].name; i++)
fprintf(out, " %s %s
", _commands[i].name, _commands[i].help);
fprintf(out, "
<device> may be device name or -u <uuid> or "
@@ -2409,6 +2421,7 @@
{"noopencount", 0, &ind, NOOPENCOUNT_ARG},
{"notable", 0, &ind, NOTABLE_ARG},
{"options", 1, &ind, OPTIONS_ARG},
+ {"prefixes", 0, &ind, PREFIXES_ARG},
{"readahead", 1, &ind, READAHEAD_ARG},
{"separator", 1, &ind, SEPARATOR_ARG},
{"showkeys", 0, &ind, SHOWKEYS_ARG},
@@ -2543,6 +2556,8 @@
_switches[NOLOCKFS_ARG]++;
if ((ind == NOOPENCOUNT_ARG))
_switches[NOOPENCOUNT_ARG]++;
+ if ((ind == PREFIXES_ARG))
+ _switches[PREFIXES_ARG]++;
if ((ind == READAHEAD_ARG)) {
_switches[READAHEAD_ARG]++;
if (!strcasecmp(optarg, "auto"))

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 04-21-2008, 02:16 PM
 
Default device-mapper ./WHATS_NEW dmsetup/dmsetup.c

CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: agk@sourceware.org 2008-04-21 13:16:31

Modified files:
. : WHATS_NEW
dmsetup : dmsetup.c

Log message:
Add 3 new reporting colums: tables_loaded, readonly, suspended.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.230&r2=1.231
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmsetup/dmsetup.c.diff?cvsroot=dm&r1=1.105&r2=1.106

--- device-mapper/WHATS_NEW 2008/04/21 11:59:22 1.230
+++ device-mapper/WHATS_NEW 2008/04/21 13:16:30 1.231
@@ -1,5 +1,6 @@
Version 1.02.26 -
=================================
+ Add tables_loaded, readonly and suspended columns to reports.
Add --prefixes to dmsetup.
Add field name prefix option to reporting functions.
Calculate string size within dm_pool_grow_object.
--- device-mapper/dmsetup/dmsetup.c 2008/04/21 11:59:22 1.105
+++ device-mapper/dmsetup/dmsetup.c 2008/04/21 13:16:30 1.106
@@ -1643,6 +1643,63 @@
return dm_report_field_string(rh, field, &s);
}

+static int _dm_info_table_loaded_disp(struct dm_report *rh,
+ struct dm_pool *mem __attribute((unused)),
+ struct dm_report_field *field,
+ const void *data,
+ void *private __attribute((unused)))
+{
+ const struct dm_info *info = data;
+
+ if (info->live_table) {
+ if (info->inactive_table)
+ dm_report_field_set_value(field, "Both", NULL);
+ else
+ dm_report_field_set_value(field, "Live", NULL);
+ return 1;
+ }
+
+ if (info->inactive_table)
+ dm_report_field_set_value(field, "Inactive", NULL);
+ else
+ dm_report_field_set_value(field, "None", NULL);
+
+ return 1;
+}
+
+static int _dm_info_suspended_disp(struct dm_report *rh,
+ struct dm_pool *mem __attribute((unused)),
+ struct dm_report_field *field,
+ const void *data,
+ void *private __attribute((unused)))
+{
+ const struct dm_info *info = data;
+
+ if (info->suspended)
+ dm_report_field_set_value(field, "Suspended", NULL);
+ else
+ dm_report_field_set_value(field, "", NULL);
+
+ return 1;
+}
+
+static int _dm_info_read_only_disp(struct dm_report *rh,
+ struct dm_pool *mem __attribute((unused)),
+ struct dm_report_field *field,
+ const void *data,
+ void *private __attribute((unused)))
+{
+ const struct dm_info *info = data;
+
+ if (info->read_only)
+ dm_report_field_set_value(field, "Read-only", NULL);
+ else
+ dm_report_field_set_value(field, "Writeable", NULL);
+
+ return 1;
+}
+
+
static int _dm_info_devno_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field, const void *data,
void *private)
@@ -1885,6 +1942,9 @@
FIELD_F(TASK, NUM, "RAhead", 6, dm_read_ahead, "read_ahead", "Read ahead in sectors.")

FIELD_F(INFO, STR, "Stat", 4, dm_info_status, "attr", "(L)ive, (I)nactive, (s)uspended, (r)ead-only, read-(w)rite.")
+FIELD_F(INFO, STR, "Tables", 6, dm_info_table_loaded, "tables_loaded", "Which of the live and inactive table slots are filled.")
+FIELD_F(INFO, STR, "Suspended", 9, dm_info_suspended, "suspended", "Whether the device is suspended.")
+FIELD_F(INFO, STR, "Read-only", 9, dm_info_read_only, "readonly", "Whether the device is read-only or writeable.")
FIELD_F(INFO, STR, "DevNo", 5, dm_info_devno, "devno", "Device major and minor numbers")
FIELD_O(INFO, dm_info, NUM, "Maj", major, 3, int32, "major", "Block device major number.")
FIELD_O(INFO, dm_info, NUM, "Min", minor, 3, int32, "minor", "Block device minor number.")

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 06-06-2008, 07:53 PM
 
Default device-mapper ./WHATS_NEW dmsetup/dmsetup.c

CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: agk@sourceware.org 2008-06-06 18:53:08

Modified files:
. : WHATS_NEW
dmsetup : dmsetup.c

Log message:
change --prefixes to --nameprefixes

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.233&r2=1.234
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmsetup/dmsetup.c.diff?cvsroot=dm&r1=1.107&r2=1.108

--- device-mapper/WHATS_NEW 2008/06/05 19:10:35 1.233
+++ device-mapper/WHATS_NEW 2008/06/06 18:53:08 1.234
@@ -5,7 +5,7 @@
Make dm_hash_iter safe against deletion.
Accept a NULL pointer to dm_free silently.
Add tables_loaded, readonly and suspended columns to reports.
- Add --prefixes to dmsetup.
+ Add --fieldprefixes to dmsetup.
Add field name prefix option to reporting functions.
Calculate string size within dm_pool_grow_object.

--- device-mapper/dmsetup/dmsetup.c 2008/04/21 16:57:11 1.107
+++ device-mapper/dmsetup/dmsetup.c 2008/06/06 18:53:08 1.108
@@ -114,13 +114,13 @@
MAJOR_ARG,
MINOR_ARG,
MODE_ARG,
+ NAMEPREFIXES_ARG,
NOFLUSH_ARG,
NOHEADINGS_ARG,
NOLOCKFS_ARG,
NOOPENCOUNT_ARG,
NOTABLE_ARG,
OPTIONS_ARG,
- PREFIXES_ARG,
READAHEAD_ARG,
SEPARATOR_ARG,
SHOWKEYS_ARG,
@@ -1990,7 +1990,7 @@
if (_switches[UNBUFFERED_ARG])
buffered = 0;

- if (_switches[PREFIXES_ARG]) {
+ if (_switches[NAMEPREFIXES_ARG]) {
aligned = 0;
field_prefixes = 1;
}
@@ -2119,7 +2119,7 @@
" [-r|--readonly] [--noopencount] [--nolockfs]
"
" [--readahead [+]<sectors>|auto|none]
"
" [-c|-C|--columns] [-o <fields>] [-O|--sort <sort_fields>]
"
- " [--noheadings] [--prefixes] [--separator <separator>]

");
+ " [--nameprefixes] [--noheadings] [--separator <separator>]

");
for (i = 0; _commands[i].name; i++)
fprintf(out, " %s %s
", _commands[i].name, _commands[i].help);
fprintf(out, "
<device> may be device name or -u <uuid> or "
@@ -2475,13 +2475,13 @@
{"major", 1, &ind, MAJOR_ARG},
{"minor", 1, &ind, MINOR_ARG},
{"mode", 1, &ind, MODE_ARG},
+ {"nameprefixes", 0, &ind, NAMEPREFIXES_ARG},
{"noflush", 0, &ind, NOFLUSH_ARG},
{"noheadings", 0, &ind, NOHEADINGS_ARG},
{"nolockfs", 0, &ind, NOLOCKFS_ARG},
{"noopencount", 0, &ind, NOOPENCOUNT_ARG},
{"notable", 0, &ind, NOTABLE_ARG},
{"options", 1, &ind, OPTIONS_ARG},
- {"prefixes", 0, &ind, PREFIXES_ARG},
{"readahead", 1, &ind, READAHEAD_ARG},
{"separator", 1, &ind, SEPARATOR_ARG},
{"showkeys", 0, &ind, SHOWKEYS_ARG},
@@ -2608,6 +2608,8 @@
_switches[TARGET_ARG]++;
_target = optarg;
}
+ if ((ind == NAMEPREFIXES_ARG))
+ _switches[NAMEPREFIXES_ARG]++;
if ((ind == NOFLUSH_ARG))
_switches[NOFLUSH_ARG]++;
if ((ind == NOHEADINGS_ARG))
@@ -2616,8 +2618,6 @@
_switches[NOLOCKFS_ARG]++;
if ((ind == NOOPENCOUNT_ARG))
_switches[NOOPENCOUNT_ARG]++;
- if ((ind == PREFIXES_ARG))
- _switches[PREFIXES_ARG]++;
if ((ind == READAHEAD_ARG)) {
_switches[READAHEAD_ARG]++;
if (!strcasecmp(optarg, "auto"))

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 06-18-2008, 11:19 AM
 
Default device-mapper ./WHATS_NEW dmsetup/dmsetup.c

CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: meyering@sourceware.org 2008-06-18 10:19:25

Modified files:
. : WHATS_NEW
dmsetup : dmsetup.c

Log message:
avoid compiler warning about cast in OFFSET_OF macro

* dmsetup/dmsetup.c (OFFSET_OF): Use an equivalent definition
that does not cast a pointer value to a narrower type.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.241&r2=1.242
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmsetup/dmsetup.c.diff?cvsroot=dm&r1=1.108&r2=1.109

--- device-mapper/WHATS_NEW 2008/06/10 11:19:18 1.241
+++ device-mapper/WHATS_NEW 2008/06/18 10:19:25 1.242
@@ -1,5 +1,6 @@
Version 1.02.27 -
===============================
+ Avoid compiler warning about cast in dmsetup.c's OFFSET_OF macro.
Fix inverted no_flush debug message.
Remove --enable-jobs from configure. (Set at runtime instead.)
Bring configure.in and list.h into line with the lvm2 versions.
--- device-mapper/dmsetup/dmsetup.c 2008/06/06 18:53:08 1.108
+++ device-mapper/dmsetup/dmsetup.c 2008/06/18 10:19:25 1.109
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
* Copyright (C) 2005-2007 NEC Corporation
*
* This file is part of the device-mapper userspace tools.
@@ -1927,7 +1927,7 @@
};

/* Column definitions */
-#define OFFSET_OF(strct, field) ((unsigned int) &((struct strct *)NULL)->field)
+#define OFFSET_OF(strct, field) (((char*)&((struct strct*)0)->field) - (char*)0)
#define STR (DM_REPORT_FIELD_TYPE_STRING)
#define NUM (DM_REPORT_FIELD_TYPE_NUMBER)
#define FIELD_O(type, strct, sorttype, head, field, width, func, id, desc) {DR_ ## type, sorttype, OFFSET_OF(strct, field), width, id, head, &_ ## func ## _disp, desc},

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 02:15 AM.

VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org