diff options
author | Brian Behlendorf <[email protected]> | 2011-01-26 12:03:58 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-02-10 09:27:21 -0800 |
commit | 1efb473f8919c5f195e127136b79c6d3b1eb1c81 (patch) | |
tree | 69937c80a49233c6ef948d3abf5bc19f52beeaee /include | |
parent | 633e8030b3582f3579a457a803c1382fc81f56e5 (diff) |
Add Hooks for Linux File Operations
The Linux specific file operations have all been located in the
file zpl_file.c. These functions primarily rely on the reworked
zfs_* functions to do their job. They are also responsible for
converting the possible Solaris style error codes to negative
Linux errors.
This first zpl_* commit also includes a common zpl.h header with
minimal entries to register the Linux specific hooks. In also
adds all the new zpl_* file to the Makefile.in. This is not a
standalone commit, you required the following zpl_* commits.
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/Makefile.am | 1 | ||||
-rw-r--r-- | include/sys/Makefile.in | 2 | ||||
-rw-r--r-- | include/sys/zpl.h | 63 |
3 files changed, 66 insertions, 0 deletions
diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am index 63dc24e5b..bde71b75e 100644 --- a/include/sys/Makefile.am +++ b/include/sys/Makefile.am @@ -75,6 +75,7 @@ KERNEL_H = \ $(top_srcdir)/include/sys/blkdev.h \ $(top_srcdir)/include/sys/zfs_ioctl.h \ $(top_srcdir)/include/sys/zfs_onexit.h \ + ${top_srcdir}/include/sys/zpl.h \ $(top_srcdir)/include/sys/zvol.h USER_H = diff --git a/include/sys/Makefile.in b/include/sys/Makefile.in index 9243f75ab..1525d1d07 100644 --- a/include/sys/Makefile.in +++ b/include/sys/Makefile.in @@ -163,6 +163,7 @@ am__kernel_HEADERS_DIST = $(top_srcdir)/include/sys/arc.h \ $(top_srcdir)/include/sys/blkdev.h \ $(top_srcdir)/include/sys/zfs_ioctl.h \ $(top_srcdir)/include/sys/zfs_onexit.h \ + ${top_srcdir}/include/sys/zpl.h \ $(top_srcdir)/include/sys/zvol.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -531,6 +532,7 @@ KERNEL_H = \ $(top_srcdir)/include/sys/blkdev.h \ $(top_srcdir)/include/sys/zfs_ioctl.h \ $(top_srcdir)/include/sys/zfs_onexit.h \ + ${top_srcdir}/include/sys/zpl.h \ $(top_srcdir)/include/sys/zvol.h USER_H = diff --git a/include/sys/zpl.h b/include/sys/zpl.h new file mode 100644 index 000000000..33f4f621f --- /dev/null +++ b/include/sys/zpl.h @@ -0,0 +1,63 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2011, Lawrence Livermore National Security, LLC. + */ + +#ifndef _SYS_ZPL_H +#define _SYS_ZPL_H + +#include <sys/vfs.h> + +/* zpl_inode.c */ +extern const struct inode_operations zpl_inode_operations; +extern const struct inode_operations zpl_dir_inode_operations; +extern const struct inode_operations zpl_symlink_inode_operations; +extern const struct inode_operations zpl_special_inode_operations; + +/* zpl_file.c */ +extern ssize_t zpl_read_common(struct inode *ip, const char *buf, + size_t len, loff_t pos, uio_seg_t segment, int flags, cred_t *cr); +extern ssize_t zpl_write_common(struct inode *ip, const char *buf, + size_t len, loff_t pos, uio_seg_t segment, int flags, cred_t *cr); + +extern const struct address_space_operations zpl_address_space_operations; +extern const struct file_operations zpl_file_operations; +extern const struct file_operations zpl_dir_file_operations; + +/* zpl_super.c */ +typedef struct zpl_mount_data { + const char *z_osname; /* Dataset name */ + void *z_data; /* Mount options string */ + struct vfsmount *z_vfs; /* VFS mount point */ +} zpl_mount_data_t; + +extern const struct super_operations zpl_super_operations; +/* extern const struct export_operations zpl_export_operations; */ +extern struct file_system_type zpl_fs_type; + +/* zpl_xattr.c */ +extern ssize_t zpl_xattr_list(struct dentry *dentry, char *buf, size_t size); +extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip); + +extern struct xattr_handler *zpl_xattr_handlers[]; + +#endif /* _SYS_ZPL_H */ |