1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Rename "stat" to "status" in dmeventd_snapshot.c.

Otherwise "warning: declaration of ‘stat’ shadows a global declaration"
will appear because it shadows "stat" from stat.h.
This commit is contained in:
Peter Rajnoha 2010-02-15 12:55:20 +00:00
parent 5ffe56d800
commit acbb93a383

View File

@ -38,7 +38,7 @@ struct snap_status {
/* FIXME possibly reconcile this with target_percent when we gain /* FIXME possibly reconcile this with target_percent when we gain
access to regular LVM library here. */ access to regular LVM library here. */
static void _parse_snapshot_params(char *params, struct snap_status *stat) static void _parse_snapshot_params(char *params, struct snap_status *status)
{ {
char *p; char *p;
/* /*
@ -46,10 +46,10 @@ static void _parse_snapshot_params(char *params, struct snap_status *stat)
* Invalid -- snapshot invalidated * Invalid -- snapshot invalidated
* Unknown -- status unknown * Unknown -- status unknown
*/ */
stat->used = stat->max = 0; status->used = status->max = 0;
if (!strncmp(params, "Invalid", 7)) { if (!strncmp(params, "Invalid", 7)) {
stat->invalid = 1; status->invalid = 1;
return; return;
} }
@ -66,8 +66,8 @@ static void _parse_snapshot_params(char *params, struct snap_status *stat)
*p = '\0'; *p = '\0';
p++; p++;
stat->used = atoi(params); status->used = atoi(params);
stat->max = atoi(p); status->max = atoi(p);
} }
void process_event(struct dm_task *dmt, void process_event(struct dm_task *dmt,
@ -78,7 +78,7 @@ void process_event(struct dm_task *dmt,
uint64_t start, length; uint64_t start, length;
char *target_type = NULL; char *target_type = NULL;
char *params; char *params;
struct snap_status stat = { 0 }; struct snap_status status = { 0 };
const char *device = dm_task_get_name(dmt); const char *device = dm_task_get_name(dmt);
int percent, *percent_warning = (int*)private; int percent, *percent_warning = (int*)private;
@ -92,18 +92,18 @@ void process_event(struct dm_task *dmt,
if (!target_type) if (!target_type)
goto out; goto out;
_parse_snapshot_params(params, &stat); _parse_snapshot_params(params, &status);
/* /*
* If the snapshot has been invalidated or we failed to parse * If the snapshot has been invalidated or we failed to parse
* the status string. Report the full status string to syslog. * the status string. Report the full status string to syslog.
*/ */
if (stat.invalid || !stat.max) { if (status.invalid || !status.max) {
syslog(LOG_ERR, "Snapshot %s changed state to: %s\n", device, params); syslog(LOG_ERR, "Snapshot %s changed state to: %s\n", device, params);
*percent_warning = 0; *percent_warning = 0;
goto out; goto out;
} }
percent = 100 * stat.used / stat.max; percent = 100 * status.used / status.max;
if (percent >= *percent_warning) { if (percent >= *percent_warning) {
syslog(LOG_WARNING, "Snapshot %s is now %i%% full.\n", device, percent); syslog(LOG_WARNING, "Snapshot %s is now %i%% full.\n", device, percent);
/* Print warning on the next multiple of WARNING_STEP. */ /* Print warning on the next multiple of WARNING_STEP. */