annotate usr/src/uts/common/fs/zfs/sys/zvol.h @ 13967:92bec6d87f59

3557 dumpvp_size is not updated correctly when a dump zvol's size is changed 3558 setting the volsize on a dump device does not return back ENOSPC 3559 setting a volsize larger than the space available sometimes succeeds 3560 dumpadm should be able to remove a dump device Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Christopher Siden <christopher.siden@delphix.com> Approved by: Albert Lee <trisk@nexenta.com>
author George Wilson <george.wilson@delphix.com>
date Wed, 20 Feb 2013 22:50:16 -0800
parents 0ed71edeac88
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
1 /*
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
2 * CDDL HEADER START
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
3 *
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
4 * The contents of this file are subject to the terms of the
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
5 * Common Development and Distribution License (the "License").
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
6 * You may not use this file except in compliance with the License.
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
7 *
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
9 * or http://www.opensolaris.org/os/licensing.
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
10 * See the License for the specific language governing permissions
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
11 * and limitations under the License.
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
12 *
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
13 * When distributing Covered Code, include this CDDL HEADER in each
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
15 * If applicable, add the following below this CDDL HEADER, with the
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
16 * fields enclosed by brackets "[]" replaced with your own identifying
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
17 * information: Portions Copyright [yyyy] [name of copyright owner]
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
18 *
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
19 * CDDL HEADER END
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
20 */
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
21
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
22 /*
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
23 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
24 */
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
25
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
26 #ifndef _SYS_ZVOL_H
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
27 #define _SYS_ZVOL_H
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
28
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
29 #include <sys/zfs_context.h>
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
30
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
31 #ifdef __cplusplus
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
32 extern "C" {
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
33 #endif
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
34
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents: 4787
diff changeset
35 #define ZVOL_OBJ 1ULL
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents: 4787
diff changeset
36 #define ZVOL_ZAP_OBJ 2ULL
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents: 4787
diff changeset
37
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
38 #ifdef _KERNEL
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
39 extern int zvol_check_volsize(uint64_t volsize, uint64_t blocksize);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
40 extern int zvol_check_volblocksize(uint64_t volblocksize);
2885
c0259887ebbc 6460059 zfs destroy <snapshot> leaves behind kruft
ahrens
parents: 2676
diff changeset
41 extern int zvol_get_stats(objset_t *os, nvlist_t *nv);
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 2885
diff changeset
42 extern void zvol_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx);
10588
dc03f981ea18 6438937 if 'zfs destroy' fails, it can leave a zvol device link missing
Eric Taylor <Eric.Taylor@Sun.COM>
parents: 6423
diff changeset
43 extern int zvol_create_minor(const char *);
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
44 extern int zvol_remove_minor(const char *);
10588
dc03f981ea18 6438937 if 'zfs destroy' fails, it can leave a zvol device link missing
Eric Taylor <Eric.Taylor@Sun.COM>
parents: 6423
diff changeset
45 extern void zvol_remove_minors(const char *);
13967
92bec6d87f59 3557 dumpvp_size is not updated correctly when a dump zvol's size is changed
George Wilson <george.wilson@delphix.com>
parents: 12314
diff changeset
46 extern int zvol_set_volsize(const char *, uint64_t);
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
47
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
48 extern int zvol_open(dev_t *devp, int flag, int otyp, cred_t *cr);
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents: 4787
diff changeset
49 extern int zvol_dump(dev_t dev, caddr_t addr, daddr_t offset, int nblocks);
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
50 extern int zvol_close(dev_t dev, int flag, int otyp, cred_t *cr);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
51 extern int zvol_strategy(buf_t *bp);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
52 extern int zvol_read(dev_t dev, uio_t *uiop, cred_t *cr);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
53 extern int zvol_write(dev_t dev, uio_t *uiop, cred_t *cr);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
54 extern int zvol_aread(dev_t dev, struct aio_req *aio, cred_t *cr);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
55 extern int zvol_awrite(dev_t dev, struct aio_req *aio, cred_t *cr);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
56 extern int zvol_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, cred_t *cr,
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
57 int *rvalp);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
58 extern int zvol_busy(void);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
59 extern void zvol_init(void);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
60 extern void zvol_fini(void);
12314
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
61
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
62 extern int zvol_get_volume_params(minor_t minor, uint64_t *blksize,
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
63 uint64_t *max_xfer_len, void **minor_hdl, void **objset_hdl, void **zil_hdl,
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
64 void **rl_hdl, void **bonus_hdl);
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
65 extern uint64_t zvol_get_volume_size(void *minor_hdl);
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
66 extern int zvol_get_volume_wce(void *minor_hdl);
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
67 extern void zvol_log_write_minor(void *minor_hdl, dmu_tx_t *tx, offset_t off,
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
68 ssize_t resid, boolean_t sync);
0ed71edeac88 6909809 COMSTAR should avoid extra data copy to zvol-based backing store
James Moore <James.Moore@Sun.COM>
parents: 10588
diff changeset
69
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
70 #endif
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
71
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
72 #ifdef __cplusplus
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
73 }
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
74 #endif
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
75
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents:
diff changeset
76 #endif /* _SYS_ZVOL_H */