/*
- * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2011 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define COMPAT_ONLY
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
#define THREAD_SAFE_FS(VP) \
((VP)->v_unsafefs ? 0 : 1)
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
#define NATIVE_XATTR(VP) \
((VP)->v_mount ? (VP)->v_mount->mnt_kern_flag & MNTK_EXTENDED_ATTRS : 0)
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int
lock_fsnode(vnode_t vp, int *funnel_state)
{
if (funnel_state)
(void) thread_funnel_set(kernel_flock, *funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
VFS_MOUNT(mount_t mp, vnode_t devvp, user_addr_t data, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_mount == 0))
return(ENOTSUP);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
-
+#endif /* CONFIG_VFS_FUNNEL */
+
if (vfs_context_is64bit(ctx)) {
if (vfs_64bitready(mp)) {
error = (*mp->mnt_op->vfs_mount)(mp, devvp, data, ctx);
error = (*mp->mnt_op->vfs_mount)(mp, devvp, data, ctx);
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (error);
}
VFS_START(mount_t mp, int flags, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_start == 0))
return(ENOTSUP);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
-
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*mp->mnt_op->vfs_start)(mp, flags, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (error);
}
VFS_UNMOUNT(mount_t mp, int flags, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_unmount == 0))
return(ENOTSUP);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
-
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*mp->mnt_op->vfs_unmount)(mp, flags, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (error);
}
VFS_ROOT(mount_t mp, struct vnode ** vpp, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_root == 0))
return(ENOTSUP);
ctx = vfs_context_current();
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*mp->mnt_op->vfs_root)(mp, vpp, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (error);
}
VFS_QUOTACTL(mount_t mp, int cmd, uid_t uid, caddr_t datap, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_quotactl == 0))
return(ENOTSUP);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*mp->mnt_op->vfs_quotactl)(mp, cmd, uid, datap, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (error);
}
VFS_GETATTR(mount_t mp, struct vfs_attr *vfa, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_getattr == 0))
return(ENOTSUP);
ctx = vfs_context_current();
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*mp->mnt_op->vfs_getattr)(mp, vfa, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(error);
}
VFS_SETATTR(mount_t mp, struct vfs_attr *vfa, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_setattr == 0))
return(ENOTSUP);
ctx = vfs_context_current();
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*mp->mnt_op->vfs_setattr)(mp, vfa, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(error);
}
VFS_SYNC(mount_t mp, int flags, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_sync == 0))
return(ENOTSUP);
ctx = vfs_context_current();
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*mp->mnt_op->vfs_sync)(mp, flags, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(error);
}
VFS_VGET(mount_t mp, ino64_t ino, struct vnode **vpp, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_vget == 0))
return(ENOTSUP);
ctx = vfs_context_current();
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*mp->mnt_op->vfs_vget)(mp, ino, vpp, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(error);
}
VFS_FHTOVP(mount_t mp, int fhlen, unsigned char * fhp, vnode_t * vpp, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((mp == dead_mountp) || (mp->mnt_op->vfs_fhtovp == 0))
return(ENOTSUP);
ctx = vfs_context_current();
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*mp->mnt_op->vfs_fhtovp)(mp, fhlen, fhp, vpp, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(error);
}
VFS_VPTOFH(struct vnode * vp, int *fhlenp, unsigned char * fhp, vfs_context_t ctx)
{
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((vp->v_mount == dead_mountp) || (vp->v_mount->mnt_op->vfs_vptofh == 0))
return(ENOTSUP);
ctx = vfs_context_current();
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*vp->v_mount->mnt_op->vfs_vptofh)(vp, fhlenp, fhp, ctx);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(error);
}
|| (vfe->vfe_opvdescs == (struct vnodeopv_desc **)NULL))
return(EINVAL);
-#ifdef __LP64__
- /* Non-threadsafe filesystems are not supported for K64 */
+#if !CONFIG_VFS_FUNNEL
+ /* Non-threadsafe filesystems are not supported e.g. on K64 & iOS */
if ((vfe->vfe_flags & (VFS_TBLTHREADSAFE | VFS_TBLFSNODELOCK)) == 0) {
return (EINVAL);
}
-#endif /* __LP64__ */
+#endif /* !CONFIG_VFS_FUNNEL */
MALLOC(newvfstbl, void *, sizeof(struct vfstable), M_TEMP,
M_WAITOK);
newvfstbl->vfc_vfsflags |= VFC_VFSVNOP_PAGEINV2;
if (vfe->vfe_flags & VFS_TBLVNOP_PAGEOUTV2)
newvfstbl->vfc_vfsflags |= VFC_VFSVNOP_PAGEOUTV2;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (vfe->vfe_flags & VFS_TBLTHREADSAFE)
newvfstbl->vfc_vfsflags |= VFC_VFSTHREADSAFE;
if (vfe->vfe_flags & VFS_TBLFSNODELOCK)
newvfstbl->vfc_vfsflags |= VFC_VFSTHREADSAFE;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if ((vfe->vfe_flags & VFS_TBLLOCALVOL) == VFS_TBLLOCALVOL)
newvfstbl->vfc_flags |= MNT_LOCAL;
if ((vfe->vfe_flags & VFS_TBLLOCALVOL) && (vfe->vfe_flags & VFS_TBLGENERICMNTARGS) == 0)
int _err;
struct vnop_lookup_args a;
vnode_t vp;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_lookup_desc;
a.a_dvp = dvp;
a.a_cnp = cnp;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(dvp);
if (!thread_safe) {
if ( (_err = lock_fsnode(dvp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*dvp->v_op[vnop_lookup_desc.vdesc_offset])(&a);
vp = *vpp;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
if ( (cnp->cn_flags & ISLASTCN) ) {
if ( (cnp->cn_flags & LOCKPARENT) ) {
}
unlock_fsnode(dvp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_create_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_create_desc;
a.a_dvp = dvp;
a.a_vap = vap;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(dvp);
if (!thread_safe) {
if ( (_err = lock_fsnode(dvp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*dvp->v_op[vnop_create_desc.vdesc_offset])(&a);
if (_err == 0 && !NATIVE_XATTR(dvp)) {
xattrfile_remove(dvp, cnp->cn_nameptr, ctx, 0);
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(dvp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(dvp, _err, NOTE_WRITE);
{
int _err;
struct vnop_whiteout_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_whiteout_desc;
a.a_dvp = dvp;
a.a_flags = flags;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(dvp);
if (!thread_safe) {
if ( (_err = lock_fsnode(dvp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*dvp->v_op[vnop_whiteout_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(dvp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(dvp, _err, NOTE_WRITE);
int _err;
struct vnop_mknod_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_mknod_desc;
a.a_dvp = dvp;
a.a_vap = vap;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(dvp);
if (!thread_safe) {
if ( (_err = lock_fsnode(dvp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*dvp->v_op[vnop_mknod_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(dvp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(dvp, _err, NOTE_WRITE);
{
int _err;
struct vnop_open_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (ctx == NULL) {
ctx = vfs_context_current();
a.a_mode = mode;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_open_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
if (vp->v_type != VCHR && vp->v_type != VFIFO && vp->v_type != VSOCK) {
unlock_fsnode(vp, NULL);
}
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_close_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (ctx == NULL) {
ctx = vfs_context_current();
a.a_fflag = fflag;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_close_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
if (vp->v_type != VCHR && vp->v_type != VFIFO && vp->v_type != VSOCK) {
unlock_fsnode(vp, NULL);
}
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_access_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (ctx == NULL) {
ctx = vfs_context_current();
a.a_action = action;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_access_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_getattr_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_getattr_desc;
a.a_vp = vp;
a.a_vap = vap;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_getattr_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_setattr_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_setattr_desc;
a.a_vp = vp;
a.a_vap = vap;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_setattr_desc.vdesc_offset])(&a);
}
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
/*
* If we have changed any of the things about the file that are likely
{
int _err;
struct vnop_read_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (ctx == NULL) {
ctx = vfs_context_current();
a.a_ioflag = ioflag;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_read_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
if (vp->v_type != VCHR && vp->v_type != VFIFO && vp->v_type != VSOCK) {
unlock_fsnode(vp, NULL);
}
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
struct vnop_write_args a;
int _err;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (ctx == NULL) {
ctx = vfs_context_current();
a.a_ioflag = ioflag;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_write_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
if (vp->v_type != VCHR && vp->v_type != VFIFO && vp->v_type != VSOCK) {
unlock_fsnode(vp, NULL);
}
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(vp, _err, NOTE_WRITE);
{
int _err;
struct vnop_ioctl_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (ctx == NULL) {
ctx = vfs_context_current();
a.a_fflag = fflag;
a.a_context= ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_ioctl_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
if (vp->v_type != VCHR && vp->v_type != VFIFO && vp->v_type != VSOCK) {
unlock_fsnode(vp, NULL);
}
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_select_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (ctx == NULL) {
ctx = vfs_context_current();
a.a_context = ctx;
a.a_wql = wql;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_select_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
if (vp->v_type != VCHR && vp->v_type != VFIFO && vp->v_type != VSOCK) {
unlock_fsnode(vp, NULL);
}
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_exchange_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
vnode_t lock_first = NULL, lock_second = NULL;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_exchange_desc;
a.a_fvp = fvp;
a.a_options = options;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(fvp);
if (!thread_safe) {
/*
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*fvp->v_op[vnop_exchange_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(lock_second, NULL);
unlock_fsnode(lock_first, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
/* Don't post NOTE_WRITE because file descriptors follow the data ... */
post_event_if_success(fvp, _err, NOTE_ATTRIB);
{
struct vnop_revoke_args a;
int _err;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_revoke_desc;
a.a_vp = vp;
a.a_flags = flags;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_revoke_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_mmap_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_mmap_desc;
a.a_vp = vp;
a.a_fflags = fflags;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_mmap_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_mnomap_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_mnomap_desc;
a.a_vp = vp;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_mnomap_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
struct vnop_fsync_args a;
int _err;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_fsync_desc;
a.a_vp = vp;
a.a_waitfor = waitfor;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_fsync_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_remove_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_remove_desc;
a.a_dvp = dvp;
a.a_flags = flags;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(dvp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*dvp->v_op[vnop_remove_desc.vdesc_offset])(&a);
}
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(vp, _err, NOTE_DELETE | NOTE_LINK);
post_event_if_success(dvp, _err, NOTE_WRITE);
{
int _err;
struct vnop_link_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
/*
* For file systems with non-native extended attributes,
a.a_cnp = cnp;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*tdvp->v_op[vnop_link_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(vp, _err, NOTE_LINK);
post_event_if_success(tdvp, _err, NOTE_WRITE);
int _err;
vnode_t src_attr_vp = NULLVP;
vnode_t dst_attr_vp = NULLVP;
- struct nameidata fromnd;
- struct nameidata tond;
+ struct nameidata *fromnd = NULL;
+ struct nameidata *tond = NULL;
char smallname1[48];
char smallname2[48];
char *xfromname = NULL;
batched = vnode_compound_rename_available(fdvp);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
vnode_t fdvp_unsafe = (THREAD_SAFE_FS(fdvp) ? NULLVP : fdvp);
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (!batched) {
if (*fvpp == NULLVP)
* is only for AppleDouble files.
*/
if (xfromname != NULL) {
- NDINIT(&fromnd, RENAME, OP_RENAME, NOFOLLOW | USEDVP | CN_NBMOUNTLOOK,
+ MALLOC(fromnd, struct nameidata *, sizeof (struct nameidata), M_TEMP, M_WAITOK);
+ NDINIT(fromnd, RENAME, OP_RENAME, NOFOLLOW | USEDVP | CN_NBMOUNTLOOK,
UIO_SYSSPACE, CAST_USER_ADDR_T(xfromname), ctx);
- fromnd.ni_dvp = fdvp;
- error = namei(&fromnd);
+ fromnd->ni_dvp = fdvp;
+ error = namei(fromnd);
/*
* If there was an error looking up source attribute file,
*/
if (error == 0) {
- if (fromnd.ni_vp) {
+ if (fromnd->ni_vp) {
/* src_attr_vp indicates need to call vnode_put / nameidone later */
- src_attr_vp = fromnd.ni_vp;
-
- if (fromnd.ni_vp->v_type != VREG) {
+ src_attr_vp = fromnd->ni_vp;
+
+ if (fromnd->ni_vp->v_type != VREG) {
src_attr_vp = NULLVP;
- vnode_put(fromnd.ni_vp);
+ vnode_put(fromnd->ni_vp);
}
}
/*
* have a vnode here, so we drop our namei buffer for the source attribute file
*/
if (src_attr_vp == NULLVP) {
- nameidone(&fromnd);
+ nameidone(fromnd);
}
}
}
* Note that tdvp already has an iocount reference. Make sure to check that we
* get a valid vnode from namei.
*/
- NDINIT(&tond, RENAME, OP_RENAME,
+ MALLOC(tond, struct nameidata *, sizeof(struct nameidata), M_TEMP, M_WAITOK);
+ NDINIT(tond, RENAME, OP_RENAME,
NOCACHE | NOFOLLOW | USEDVP | CN_NBMOUNTLOOK, UIO_SYSSPACE,
CAST_USER_ADDR_T(xtoname), ctx);
- tond.ni_dvp = tdvp;
- error = namei(&tond);
+ tond->ni_dvp = tdvp;
+ error = namei(tond);
if (error)
goto out;
- if (tond.ni_vp) {
- dst_attr_vp = tond.ni_vp;
+ if (tond->ni_vp) {
+ dst_attr_vp = tond->ni_vp;
}
if (src_attr_vp) {
+ const char *old_name = src_attr_vp->v_name;
+ vnode_t old_parent = src_attr_vp->v_parent;
+
if (batched) {
- error = VNOP_COMPOUND_RENAME(fdvp, &src_attr_vp, &fromnd.ni_cnd, NULL,
- tdvp, &dst_attr_vp, &tond.ni_cnd, NULL,
+ error = VNOP_COMPOUND_RENAME(fdvp, &src_attr_vp, &fromnd->ni_cnd, NULL,
+ tdvp, &dst_attr_vp, &tond->ni_cnd, NULL,
0, ctx);
} else {
- error = VNOP_RENAME(fdvp, src_attr_vp, &fromnd.ni_cnd,
- tdvp, dst_attr_vp, &tond.ni_cnd, ctx);
+ error = VNOP_RENAME(fdvp, src_attr_vp, &fromnd->ni_cnd,
+ tdvp, dst_attr_vp, &tond->ni_cnd, ctx);
}
+ if (error == 0 && old_name == src_attr_vp->v_name &&
+ old_parent == src_attr_vp->v_parent) {
+ int update_flags = VNODE_UPDATE_NAME;
+
+ if (fdvp != tdvp)
+ update_flags |= VNODE_UPDATE_PARENT;
+
+ vnode_update_identity(src_attr_vp, tdvp,
+ tond->ni_cnd.cn_nameptr,
+ tond->ni_cnd.cn_namelen,
+ tond->ni_cnd.cn_hash,
+ update_flags);
+ }
+
/* kevent notifications for moving resource files
* _err is zero if we're here, so no need to notify directories, code
* below will do that. only need to post the rename on the source and
args.a_desc = &vnop_remove_desc;
args.a_dvp = tdvp;
args.a_vp = dst_attr_vp;
- args.a_cnp = &tond.ni_cnd;
+ args.a_cnp = &tond->ni_cnd;
args.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (fdvp_unsafe != NULLVP)
error = lock_fsnode(dst_attr_vp, NULL);
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (error == 0) {
error = (*tdvp->v_op[vnop_remove_desc.vdesc_offset])(&args);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (fdvp_unsafe != NULLVP)
unlock_fsnode(dst_attr_vp, NULL);
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (error == 0)
vnode_setneedinactive(dst_attr_vp);
out:
if (src_attr_vp) {
vnode_put(src_attr_vp);
- nameidone(&fromnd);
+ nameidone(fromnd);
}
if (dst_attr_vp) {
vnode_put(dst_attr_vp);
- nameidone(&tond);
+ nameidone(tond);
+ }
+ if (fromnd) {
+ FREE(fromnd, M_TEMP);
+ }
+ if (tond) {
+ FREE(tond, M_TEMP);
}
-
if (xfromname && xfromname != &smallname1[0]) {
FREE(xfromname, M_TEMP);
}
int _err = 0;
int events;
struct vnop_rename_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int funnel_state = 0;
vnode_t lock_first = NULL, lock_second = NULL;
vnode_t fdvp_unsafe = NULLVP;
vnode_t tdvp_unsafe = NULLVP;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_rename_desc;
a.a_fdvp = fdvp;
a.a_tcnp = tcnp;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!THREAD_SAFE_FS(fdvp))
fdvp_unsafe = fdvp;
if (!THREAD_SAFE_FS(tdvp))
goto out1;
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
/* do the rename of the main file. */
_err = (*fdvp->v_op[vnop_rename_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (fdvp_unsafe != NULLVP) {
if (lock_second != NULL)
unlock_fsnode(lock_second, NULL);
unlock_fsnode(lock_first, NULL);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (_err == 0) {
if (tvp && tvp != fvp)
vnode_setneedinactive(tvp);
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
out1:
if (fdvp_unsafe != NULLVP) {
if (tdvp_unsafe != NULLVP)
unlock_fsnode(tdvp_unsafe, NULL);
unlock_fsnode(fdvp_unsafe, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
/* Wrote at least one directory. If transplanted a dir, also changed link counts */
if (0 == _err) {
{
int _err;
struct vnop_mkdir_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_mkdir_desc;
a.a_dvp = dvp;
a.a_vap = vap;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(dvp);
if (!thread_safe) {
if ( (_err = lock_fsnode(dvp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*dvp->v_op[vnop_mkdir_desc.vdesc_offset])(&a);
if (_err == 0 && !NATIVE_XATTR(dvp)) {
xattrfile_remove(dvp, cnp->cn_nameptr, ctx, 0);
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(dvp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(dvp, _err, NOTE_LINK | NOTE_WRITE);
{
int _err;
struct vnop_rmdir_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_rmdir_desc;
a.a_dvp = dvp;
a.a_cnp = cnp;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(dvp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_rmdir_desc.vdesc_offset])(&a);
}
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
/* If you delete a dir, it loses its "." reference --> NOTE_LINK */
post_event_if_success(vp, _err, NOTE_DELETE | NOTE_LINK);
nameidone(&nd);
if (xvp->v_type == VREG) {
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe = THREAD_SAFE_FS(dvp);
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
struct vnop_setattr_args a;
a.a_desc = &vnop_setattr_desc;
a.a_vap = vap;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
if ( (lock_fsnode(xvp, NULL)) )
goto out1;
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
(void) (*xvp->v_op[vnop_setattr_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(xvp, NULL);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
out1:
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
vnode_put(xvp);
out2:
{
int _err;
struct vnop_symlink_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_symlink_desc;
a.a_dvp = dvp;
a.a_target = target;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(dvp);
if (!thread_safe) {
if ( (_err = lock_fsnode(dvp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*dvp->v_op[vnop_symlink_desc.vdesc_offset])(&a);
if (_err == 0 && !NATIVE_XATTR(dvp)) {
xattrfile_remove(dvp, cnp->cn_nameptr, ctx, 0);
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(dvp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(dvp, _err, NOTE_WRITE);
{
int _err;
struct vnop_readdir_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_readdir_desc;
a.a_vp = vp;
a.a_eofflag = eofflag;
a.a_numdirent = numdirent;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_readdir_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_readdirattr_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_readdirattr_desc;
a.a_vp = vp;
a.a_actualcount = actualcount;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_readdirattr_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_readlink_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_readlink_desc;
a.a_vp = vp;
a.a_uio = uio;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_readlink_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_inactive_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_inactive_desc;
a.a_vp = vp;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_inactive_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
#if NAMEDSTREAMS
/* For file systems that do not support namedstream natively, mark
{
int _err;
struct vnop_reclaim_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_reclaim_desc;
a.a_vp = vp;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_reclaim_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_pathconf_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_pathconf_desc;
a.a_vp = vp;
a.a_retval = retval;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_pathconf_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_advlock_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_advlock_desc;
a.a_vp = vp;
a.a_flags = flags;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
/* Disallow advisory locking on non-seekable vnodes */
if (vnode_isfifo(vp)) {
}
}
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_allocate_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_allocate_desc;
a.a_vp = vp;
a.a_offset = offset;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_allocate_desc.vdesc_offset])(&a);
#if CONFIG_FSE
}
#endif
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_pagein_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_pagein_desc;
a.a_vp = vp;
a.a_flags = flags;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_pagein_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_pageout_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_pageout_desc;
a.a_vp = vp;
a.a_flags = flags;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_pageout_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(vp, _err, NOTE_WRITE);
}
}
+#if CONFIG_SEARCHFS
#if 0
/*
{
int _err;
struct vnop_searchfs_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_searchfs_desc;
a.a_vp = vp;
a.a_searchstate = searchstate;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_searchfs_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
+#endif /* CONFIG_SEARCHFS */
#if 0
/*
{
struct vnop_getxattr_args a;
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_getxattr_desc;
a.a_vp = vp;
a.a_options = options;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (error = lock_fsnode(vp, &funnel_state)) ) {
return (error);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*vp->v_op[vnop_getxattr_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (error);
}
{
struct vnop_setxattr_args a;
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_setxattr_desc;
a.a_vp = vp;
a.a_options = options;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (error = lock_fsnode(vp, &funnel_state)) ) {
return (error);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*vp->v_op[vnop_setxattr_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (error == 0)
vnode_uncache_authorized_action(vp, KAUTH_INVALIDATE_CACHED_RIGHTS);
{
struct vnop_removexattr_args a;
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_removexattr_desc;
a.a_vp = vp;
a.a_options = options;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (error = lock_fsnode(vp, &funnel_state)) ) {
return (error);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*vp->v_op[vnop_removexattr_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
post_event_if_success(vp, error, NOTE_ATTRIB);
{
struct vnop_listxattr_args a;
int error;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_listxattr_desc;
a.a_vp = vp;
a.a_options = options;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (error = lock_fsnode(vp, &funnel_state)) ) {
return (error);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
error = (*vp->v_op[vnop_listxattr_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (error);
}
{
int _err;
struct vnop_blktooff_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_blktooff_desc;
a.a_vp = vp;
a.a_lblkno = lblkno;
a.a_offset = offset;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_blktooff_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_offtoblk_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_offtoblk_desc;
a.a_vp = vp;
a.a_offset = offset;
a.a_lblkno = lblkno;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_offtoblk_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return (_err);
}
{
int _err;
struct vnop_blockmap_args a;
-#ifndef __LP64__
+ size_t localrun = 0;
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
if (ctx == NULL) {
ctx = vfs_context_current();
a.a_foffset = foffset;
a.a_size = size;
a.a_bpn = bpn;
- a.a_run = run;
+ a.a_run = &localrun;
a.a_poff = poff;
a.a_flags = flags;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
funnel_state = thread_funnel_set(kernel_flock, TRUE);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_blockmap_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
(void) thread_funnel_set(kernel_flock, funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
+
+ /*
+ * We used a local variable to request information from the underlying
+ * filesystem about the length of the I/O run in question. If
+ * we get malformed output from the filesystem, we cap it to the length
+ * requested, at most. Update 'run' on the way out.
+ */
+ if (_err == 0) {
+ if (localrun > size) {
+ localrun = size;
+ }
+
+ if (run) {
+ *run = localrun;
+ }
+ }
return (_err);
}
{
int _err;
struct vnop_kqfilt_add_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = VDESC(vnop_kqfilt_add);
a.a_vp = vp;
a.a_kn = kn;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_kqfilt_add_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(_err);
}
{
int _err;
struct vnop_kqfilt_remove_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = VDESC(vnop_kqfilt_remove);
a.a_vp = vp;
a.a_ident = ident;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_kqfilt_remove_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(_err);
}
{
int _err;
struct vnop_monitor_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = VDESC(vnop_monitor);
a.a_vp = vp;
a.a_handle = handle;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_monitor_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(_err);
}
{
int _err;
struct vnop_setlabel_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
int thread_safe;
int funnel_state = 0;
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = VDESC(vnop_setlabel);
a.a_vp = vp;
a.a_vl = label;
a.a_context = ctx;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
thread_safe = THREAD_SAFE_FS(vp);
if (!thread_safe) {
if ( (_err = lock_fsnode(vp, &funnel_state)) ) {
return (_err);
}
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
_err = (*vp->v_op[vnop_setlabel_desc.vdesc_offset])(&a);
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!thread_safe) {
unlock_fsnode(vp, &funnel_state);
}
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
return(_err);
}
{
struct vnop_getnamedstream_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!THREAD_SAFE_FS(vp))
return (ENOTSUP);
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_getnamedstream_desc;
a.a_vp = vp;
{
struct vnop_makenamedstream_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!THREAD_SAFE_FS(vp))
return (ENOTSUP);
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_makenamedstream_desc;
a.a_vp = vp;
{
struct vnop_removenamedstream_args a;
-#ifndef __LP64__
+#if CONFIG_VFS_FUNNEL
if (!THREAD_SAFE_FS(vp))
return (ENOTSUP);
-#endif /* __LP64__ */
+#endif /* CONFIG_VFS_FUNNEL */
a.a_desc = &vnop_removenamedstream_desc;
a.a_vp = vp;