summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/geom/geom_io.c8
-rw-r--r--sys/geom/geom_stats.h9
2 files changed, 9 insertions, 8 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index 1912587..f334817 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -327,8 +327,8 @@ g_io_deliver(struct bio *bp, int error)
}
binuptime(&t1);
/* Raise the "inconsistent" flag for userland */
- atomic_set_acq_int(&cp->stat->updating, 1);
- atomic_set_acq_int(&pp->stat->updating, 1);
+ atomic_add_acq_int(&cp->stat->seq0, 1);
+ atomic_add_acq_int(&pp->stat->seq0, 1);
if (idx >= 0) {
/* Account the service time */
dt = t1;
@@ -360,8 +360,8 @@ g_io_deliver(struct bio *bp, int error)
bintime_add(&pp->stat->bt, &dt);
pp->stat->wentbusy = t1;
/* Mark the structures as consistent again */
- atomic_store_rel_int(&cp->stat->updating, 0);
- atomic_store_rel_int(&pp->stat->updating, 0);
+ atomic_add_acq_int(&cp->stat->seq1, 1);
+ atomic_add_acq_int(&pp->stat->seq1, 1);
}
cp->stat->nend++;
pp->stat->nend++;
diff --git a/sys/geom/geom_stats.h b/sys/geom/geom_stats.h
index 159cba1..1c13adf 100644
--- a/sys/geom/geom_stats.h
+++ b/sys/geom/geom_stats.h
@@ -38,11 +38,10 @@
* providers. See libgeom(3) for how to get hold of these.
*/
struct g_stat {
- int updating;
+ int seq0;
/*
- * If non-zero, the structure is being
- * updated by the kernel and the contents
- * should not be used.
+ * Sequence number, used with seq1 to determine
+ * if snapshot is consistent.
*/
void *id;
@@ -81,6 +80,8 @@ struct g_stat {
#define G_STAT_IDX_WRITE 1
#define G_STAT_IDX_DELETE 2
+ int seq1;
+ /* See seq0 */
};
#endif /* _GEOM_GEOM_STATS_H_ */
OpenPOWER on IntegriCloud