aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayout.c5
-rw-r--r--fs/nfs/pnfs.c4
-rw-r--r--fs/nfs/pnfs.h3
3 files changed, 11 insertions, 1 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 0fbf37de2a41..9f6fb8876b3f 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -533,14 +533,17 @@ nfs4_ff_layoutstat_start_io(struct nfs4_ff_layout_mirror *mirror,
533 ktime_t now) 533 ktime_t now)
534{ 534{
535 static const ktime_t notime = {0}; 535 static const ktime_t notime = {0};
536 s64 report_interval = FF_LAYOUTSTATS_REPORT_INTERVAL;
536 537
537 nfs4_ff_start_busy_timer(&layoutstat->busy_timer, now); 538 nfs4_ff_start_busy_timer(&layoutstat->busy_timer, now);
538 if (ktime_equal(mirror->start_time, notime)) 539 if (ktime_equal(mirror->start_time, notime))
539 mirror->start_time = now; 540 mirror->start_time = now;
540 if (ktime_equal(mirror->last_report_time, notime)) 541 if (ktime_equal(mirror->last_report_time, notime))
541 mirror->last_report_time = now; 542 mirror->last_report_time = now;
543 if (layoutstats_timer != 0)
544 report_interval = (s64)layoutstats_timer * 1000LL;
542 if (ktime_to_ms(ktime_sub(now, mirror->last_report_time)) >= 545 if (ktime_to_ms(ktime_sub(now, mirror->last_report_time)) >=
543 FF_LAYOUTSTATS_REPORT_INTERVAL) { 546 report_interval) {
544 mirror->last_report_time = now; 547 mirror->last_report_time = now;
545 return true; 548 return true;
546 } 549 }
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 247c5a5d2d6b..3530bb703214 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2285,3 +2285,7 @@ out_put:
2285} 2285}
2286EXPORT_SYMBOL_GPL(pnfs_report_layoutstat); 2286EXPORT_SYMBOL_GPL(pnfs_report_layoutstat);
2287#endif 2287#endif
2288
2289unsigned int layoutstats_timer;
2290module_param(layoutstats_timer, uint, 0644);
2291EXPORT_SYMBOL_GPL(layoutstats_timer);
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 02c27f93caf1..d3979dd1037a 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -528,12 +528,15 @@ pnfs_use_threshold(struct nfs4_threshold **dst, struct nfs4_threshold *src,
528 nfss->pnfs_curr_ld->id == src->l_type); 528 nfss->pnfs_curr_ld->id == src->l_type);
529} 529}
530 530
531extern unsigned int layoutstats_timer;
532
531#ifdef NFS_DEBUG 533#ifdef NFS_DEBUG
532void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id); 534void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id);
533#else 535#else
534static inline void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id) 536static inline void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id)
535{ 537{
536} 538}
539
537#endif /* NFS_DEBUG */ 540#endif /* NFS_DEBUG */
538#else /* CONFIG_NFS_V4_1 */ 541#else /* CONFIG_NFS_V4_1 */
539 542