From 0ea05c64f8d08c20439dd2a06e949a2aa4115101 Mon Sep 17 00:00:00 2001 From: Alek P Date: Thu, 6 Jul 2017 22:16:13 -0700 Subject: Implemented zpool scrub pause/resume Currently, there is no way to pause a scrub. Pausing may be useful when the pool is busy with other I/O to preserve bandwidth. This patch adds the ability to pause and resume scrubbing. This is achieved by maintaining a persistent on-disk scrub state. While the state is 'paused' we do not scrub any more blocks. We do however perform regular scan housekeeping such as freeing async destroyed and deadlist blocks while paused. Reviewed by: Matthew Ahrens Reviewed by: Thomas Caputi Reviewed-by: Serapheim Dimitropoulos Reviewed-by: Brian Behlendorf Signed-off-by: Alek Pinchuk Closes #6167 --- include/sys/spa.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sys/spa.h') diff --git a/include/sys/spa.h b/include/sys/spa.h index 22a396689..556a51eea 100644 --- a/include/sys/spa.h +++ b/include/sys/spa.h @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. + * Copyright (c) 2017 Datto Inc. */ #ifndef _SYS_SPA_H @@ -657,6 +658,7 @@ extern void spa_l2cache_drop(spa_t *spa); /* scanning */ extern int spa_scan(spa_t *spa, pool_scan_func_t func); extern int spa_scan_stop(spa_t *spa); +extern int spa_scrub_pause_resume(spa_t *spa, pool_scrub_cmd_t flag); /* spa syncing */ extern void spa_sync(spa_t *spa, uint64_t txg); /* only for DMU use */ -- cgit v1.2.3