diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 10 | ||||
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.h | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 8ac31fbf040a..4215278c9c76 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c | |||
@@ -451,9 +451,13 @@ nfs4_ff_layout_calc_completion_time(struct rpc_task *task) | |||
451 | } | 451 | } |
452 | 452 | ||
453 | static void | 453 | static void |
454 | nfs4_ff_layoutstat_start_io(struct nfs4_ff_layoutstat *layoutstat) | 454 | nfs4_ff_layoutstat_start_io(struct nfs4_ff_layout_mirror *mirror, |
455 | struct nfs4_ff_layoutstat *layoutstat) | ||
455 | { | 456 | { |
457 | static const ktime_t notime = {0}; | ||
458 | |||
456 | nfs4_ff_start_busy_timer(&layoutstat->busy_timer); | 459 | nfs4_ff_start_busy_timer(&layoutstat->busy_timer); |
460 | cmpxchg(&mirror->start_time, notime, ktime_get()); | ||
457 | } | 461 | } |
458 | 462 | ||
459 | static void | 463 | static void |
@@ -491,7 +495,7 @@ nfs4_ff_layout_stat_io_start_read(struct nfs4_ff_layout_mirror *mirror, | |||
491 | __u64 requested) | 495 | __u64 requested) |
492 | { | 496 | { |
493 | spin_lock(&mirror->lock); | 497 | spin_lock(&mirror->lock); |
494 | nfs4_ff_layoutstat_start_io(&mirror->read_stat); | 498 | nfs4_ff_layoutstat_start_io(mirror, &mirror->read_stat); |
495 | nfs4_ff_layout_stat_io_update_requested(&mirror->read_stat, requested); | 499 | nfs4_ff_layout_stat_io_update_requested(&mirror->read_stat, requested); |
496 | spin_unlock(&mirror->lock); | 500 | spin_unlock(&mirror->lock); |
497 | } | 501 | } |
@@ -514,7 +518,7 @@ nfs4_ff_layout_stat_io_start_write(struct nfs4_ff_layout_mirror *mirror, | |||
514 | __u64 requested) | 518 | __u64 requested) |
515 | { | 519 | { |
516 | spin_lock(&mirror->lock); | 520 | spin_lock(&mirror->lock); |
517 | nfs4_ff_layoutstat_start_io(&mirror->write_stat); | 521 | nfs4_ff_layoutstat_start_io(mirror, &mirror->write_stat); |
518 | nfs4_ff_layout_stat_io_update_requested(&mirror->write_stat, requested); | 522 | nfs4_ff_layout_stat_io_update_requested(&mirror->write_stat, requested); |
519 | spin_unlock(&mirror->lock); | 523 | spin_unlock(&mirror->lock); |
520 | } | 524 | } |
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h index f7493f7cf13c..0e7366f44d11 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.h +++ b/fs/nfs/flexfilelayout/flexfilelayout.h | |||
@@ -74,6 +74,7 @@ struct nfs4_ff_layout_mirror { | |||
74 | spinlock_t lock; | 74 | spinlock_t lock; |
75 | struct nfs4_ff_layoutstat read_stat; | 75 | struct nfs4_ff_layoutstat read_stat; |
76 | struct nfs4_ff_layoutstat write_stat; | 76 | struct nfs4_ff_layoutstat write_stat; |
77 | ktime_t start_time; | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | struct nfs4_ff_layout_segment { | 80 | struct nfs4_ff_layout_segment { |