Skip to content
Snippets Groups Projects
Commit 1cf30084 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

zfs: enable the solaris compat <sys/vnode.h>

This allows to remove various #if 0'ed code using vnode_t or znode_t to be
compiled, both in the current headers and future ported code.
parent 5799fb60
No related branches found
No related tags found
No related merge requests found
......@@ -29,15 +29,13 @@
#ifndef _OPENSOLARIS_SYS_FILE_H_
#define _OPENSOLARIS_SYS_FILE_H_
#include_next <sys/file.h>
#include <osv/file.h>
#define FKIOCTL 0x80000000 /* ioctl addresses are from kernel */
#ifdef _KERNEL
typedef struct file file_t;
#include <sys/capability.h>
static __inline file_t *
getf(int fd)
{
......@@ -47,7 +45,7 @@ getf(int fd)
* We wouldn't need all of these rights on every invocation
* if we had more information about intent.
*/
if (fget(curthread, fd, CAP_READ | CAP_WRITE | CAP_SEEK, &fp) == 0)
if (fget(fd, &fp) == 0)
return (fp);
return (NULL);
}
......@@ -58,9 +56,9 @@ releasef(int fd)
struct file *fp;
/* No CAP_ rights required, as we're only releasing. */
if (fget(curthread, fd, 0, &fp) == 0) {
fdrop(fp, curthread);
fdrop(fp, curthread);
if (fget(fd, &fp) == 0) {
fdrop(fp);
fdrop(fp);
}
}
#endif /* _KERNEL */
......
......@@ -36,12 +36,11 @@
#include <sys/mount.h>
#include <sys/vnode.h>
#define rootdir rootvnode
typedef struct mount vfs_t;
#define vfs_flag mnt_flag
#define vfs_data mnt_data
#define vfs_flag m_flags
#define vfs_data m_data
#if 0
#define vfs_count mnt_ref
#define vfs_fsid mnt_stat.f_fsid
#define vfs_bsize mnt_stat.f_bsize
......@@ -130,6 +129,7 @@ typedef uint64_t vfs_feature_t;
#define vfs_set_feature(vfsp, feature) do { } while (0)
#define vfs_clear_feature(vfsp, feature) do { } while (0)
#define vfs_has_feature(vfsp, feature) (0)
#endif
#endif /* _KERNEL */
......
......@@ -38,18 +38,17 @@ typedef struct vnode vnode_t;
typedef struct vattr vattr_t;
typedef enum vtype vtype_t;
#include <sys/namei.h>
enum symfollow { NO_FOLLOW = NOFOLLOW };
//enum symfollow { NO_FOLLOW = NOFOLLOW };
#include <sys/proc.h>
#include_next <sys/vnode.h>
#include <fcntl.h>
#include <sys/proc.h>
#include <sys/mount.h>
#include <sys/cred.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/syscallsubr.h>
#if 0
typedef struct vop_vector vnodeops_t;
#define VOP_FID VOP_VPTOFH
#define vop_fid vop_vptofh
......@@ -300,6 +299,7 @@ vn_remove(char *fnamep, enum uio_seg seg, enum rm dirflag)
return (kern_unlink(curthread, fnamep, seg));
}
#endif
#endif /* _KERNEL */
......
......@@ -201,7 +201,7 @@ typedef struct zfs_acl_ids {
struct znode;
struct zfsvfs;
#if 0 // def _KERNEL
#ifdef _KERNEL
int zfs_acl_ids_create(struct znode *, int, vattr_t *,
cred_t *, vsecattr_t *, zfs_acl_ids_t *);
void zfs_acl_ids_free(zfs_acl_ids_t *);
......
......@@ -78,6 +78,7 @@ extern "C" {
#include <sys/sunddi.h>
#include <sys/priority.h>
#include <sys/sig.h>
#include <sys/vnode.h>
#define CPU_SEQID get_cpuid()
......
......@@ -27,7 +27,7 @@
#define _SYS_FS_ZFS_FUID_H
#include <sys/types.h>
#if 0 // def _KERNEL
#ifdef _KERNEL
#include <sys/kidmap.h>
#include <sys/dmu.h>
#include <sys/zfs_vfsops.h>
......@@ -98,7 +98,7 @@ typedef struct zfs_fuid_info {
size_t z_domain_str_sz; /* len of domain strings z_domain list */
} zfs_fuid_info_t;
#if 0 //def _KERNEL
#ifdef _KERNEL
struct znode;
extern uid_t zfs_fuid_map_id(zfsvfs_t *, uint64_t, cred_t *, zfs_fuid_type_t);
extern void zfs_fuid_node_add(zfs_fuid_info_t **, const char *, uint32_t,
......
......@@ -124,7 +124,7 @@ typedef struct znode_phys {
*/
} znode_phys_t;
#if 0 //def _KERNEL
#ifdef _KERNEL
int zfs_sa_readlink(struct znode *, uio_t *);
void zfs_sa_symlink(struct znode *, char *link, int len, dmu_tx_t *);
void zfs_sa_upgrade(struct sa_handle *, dmu_tx_t *);
......
......@@ -25,7 +25,7 @@
#ifndef _SYS_FS_ZFS_ZNODE_H
#define _SYS_FS_ZFS_ZNODE_H
#if 0 // def _KERNEL
#ifdef _KERNEL
#include <sys/list.h>
#include <sys/dmu.h>
#include <sys/sa.h>
......@@ -165,7 +165,7 @@ extern "C" {
* They are used to protect creates, deletes, and renames.
* Each directory znode has a mutex and a list of locked names.
*/
#if 0 //def _KERNEL
#ifdef _KERNEL
typedef struct zfs_dirlock {
char *dl_name; /* directory entry being locked */
uint32_t dl_sharecnt; /* 0 if exclusive, > 0 if shared */
......
......@@ -39,7 +39,7 @@
#ifndef _SYS_VNODE_H
#define _SYS_VNODE_H
#include_next <sys/vnode.h>
#include <osv/vnode.h>
#define IS_DEVVP(vp) \
((vp)->v_type == VCHR || (vp)->v_type == VBLK || (vp)->v_type == VFIFO)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment