Add support for DISCARD to ZVOLs.
[zfs.git] / include / sys / zpl.h
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2011, Lawrence Livermore National Security, LLC.
23  */
24
25 #ifndef _SYS_ZPL_H
26 #define _SYS_ZPL_H
27
28 #include <sys/vfs.h>
29 #include <linux/vfs_compat.h>
30 #include <linux/xattr_compat.h>
31 #include <linux/exportfs.h>
32 #include <linux/writeback.h>
33 #include <linux/falloc.h>
34
35 /* zpl_inode.c */
36 extern const struct inode_operations zpl_inode_operations;
37 extern const struct inode_operations zpl_dir_inode_operations;
38 extern const struct inode_operations zpl_symlink_inode_operations;
39 extern const struct inode_operations zpl_special_inode_operations;
40
41 /* zpl_file.c */
42 extern ssize_t zpl_read_common(struct inode *ip, const char *buf,
43     size_t len, loff_t pos, uio_seg_t segment, int flags, cred_t *cr);
44 extern ssize_t zpl_write_common(struct inode *ip, const char *buf,
45     size_t len, loff_t pos, uio_seg_t segment, int flags, cred_t *cr);
46 extern long zpl_fallocate_common(struct inode *ip, int mode,
47     loff_t offset, loff_t len);
48
49 extern const struct address_space_operations zpl_address_space_operations;
50 extern const struct file_operations zpl_file_operations;
51 extern const struct file_operations zpl_dir_file_operations;
52
53 /* zpl_super.c */
54 extern void zpl_prune_sbs(int64_t bytes_to_scan, void *private);
55
56 typedef struct zpl_mount_data {
57         const char *z_osname;   /* Dataset name */
58         void *z_data;           /* Mount options string */
59 } zpl_mount_data_t;
60
61 extern const struct super_operations zpl_super_operations;
62 extern const struct export_operations zpl_export_operations;
63 extern struct file_system_type zpl_fs_type;
64
65 /* zpl_xattr.c */
66 extern ssize_t zpl_xattr_list(struct dentry *dentry, char *buf, size_t size);
67 extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip,
68     const struct qstr *qstr);
69
70 extern xattr_handler_t *zpl_xattr_handlers[];
71
72 #endif  /* _SYS_ZPL_H */