Print this page
NEX-5553 ZFS auto-trim, manual-trim and scrub can race and deadlock
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
NEX-5064 On-demand trim should store operation start and stop time
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
NEX-3558 KRRP Integration
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/fs/zfs/sys/dsl_synctask.h
+++ new/usr/src/uts/common/fs/zfs/sys/dsl_synctask.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
|
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
24 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
24 25 */
25 26
26 27 #ifndef _SYS_DSL_SYNCTASK_H
27 28 #define _SYS_DSL_SYNCTASK_H
28 29
29 30 #include <sys/txg.h>
30 31 #include <sys/zfs_context.h>
31 32
32 33 #ifdef __cplusplus
33 34 extern "C" {
34 35 #endif
35 36
36 37 struct dsl_pool;
37 38
38 39 typedef int (dsl_checkfunc_t)(void *, dmu_tx_t *);
39 40 typedef void (dsl_syncfunc_t)(void *, dmu_tx_t *);
40 41
41 42 typedef enum zfs_space_check {
42 43 /*
43 44 * Normal space check: if there is less than 3.2% free space,
44 45 * the operation will fail. Operations which are logically
45 46 * creating things should use this (e.g. "zfs create", "zfs snapshot").
46 47 * User writes (via the ZPL / ZVOL) also fail at this point.
47 48 */
48 49 ZFS_SPACE_CHECK_NORMAL,
49 50
50 51 /*
51 52 * Space check allows use of half the slop space. If there
52 53 * is less than 1.6% free space, the operation will fail. Most
53 54 * operations should use this (e.g. "zfs set", "zfs rename"),
54 55 * because we want them to succeed even after user writes are failing,
55 56 * so that they can be used as part of the space recovery process.
56 57 */
57 58 ZFS_SPACE_CHECK_RESERVED,
58 59
59 60 /*
60 61 * No space check is performed. Only operations which we expect to
61 62 * result in a net reduction in space should use this
62 63 * (e.g. "zfs destroy". Setting quotas & reservations also uses
63 64 * this because it needs to circumvent the quota/reservation checks).
64 65 *
65 66 * See also the comments above spa_slop_shift.
66 67 */
67 68 ZFS_SPACE_CHECK_NONE,
68 69 } zfs_space_check_t;
69 70
70 71 typedef struct dsl_sync_task {
71 72 txg_node_t dst_node;
72 73 struct dsl_pool *dst_pool;
73 74 uint64_t dst_txg;
74 75 int dst_space;
75 76 zfs_space_check_t dst_space_check;
76 77 dsl_checkfunc_t *dst_checkfunc;
77 78 dsl_syncfunc_t *dst_syncfunc;
|
↓ open down ↓ |
44 lines elided |
↑ open up ↑ |
78 79 void *dst_arg;
79 80 int dst_error;
80 81 boolean_t dst_nowaiter;
81 82 } dsl_sync_task_t;
82 83
83 84 void dsl_sync_task_sync(dsl_sync_task_t *, dmu_tx_t *);
84 85 int dsl_sync_task(const char *, dsl_checkfunc_t *,
85 86 dsl_syncfunc_t *, void *, int, zfs_space_check_t);
86 87 void dsl_sync_task_nowait(struct dsl_pool *, dsl_syncfunc_t *,
87 88 void *, int, zfs_space_check_t, dmu_tx_t *);
89 +#define DST_AVG_BLKSHIFT 14
88 90
89 91 #ifdef __cplusplus
90 92 }
91 93 #endif
92 94
93 95 #endif /* _SYS_DSL_SYNCTASK_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX