17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5dd29fa4aSprabahar * Common Development and Distribution License (the "License"). 6dd29fa4aSprabahar * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 22b4203d75SMarcel Telka /* All Rights Reserved */ 237c478bd9Sstevel@tonic-gate 247c478bd9Sstevel@tonic-gate /* 25df2381bfSpraks * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 267c478bd9Sstevel@tonic-gate * Use is subject to license terms. 27*87bfe94cSPatrick Mooney * Copyright 2017 Joyent, Inc. 287c478bd9Sstevel@tonic-gate */ 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #ifndef _SYS_FS_SUBR_H 317c478bd9Sstevel@tonic-gate #define _SYS_FS_SUBR_H 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #include <sys/types.h> 347c478bd9Sstevel@tonic-gate #include <sys/cred.h> 357c478bd9Sstevel@tonic-gate #include <sys/fcntl.h> 367c478bd9Sstevel@tonic-gate #include <sys/poll.h> 377c478bd9Sstevel@tonic-gate #include <sys/vfs.h> 387c478bd9Sstevel@tonic-gate #include <sys/vnode.h> 397c478bd9Sstevel@tonic-gate #include <vm/page.h> 407c478bd9Sstevel@tonic-gate #include <sys/acl.h> 417c478bd9Sstevel@tonic-gate #include <sys/share.h> 427c478bd9Sstevel@tonic-gate #include <sys/flock.h> 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate #ifdef __cplusplus 457c478bd9Sstevel@tonic-gate extern "C" { 467c478bd9Sstevel@tonic-gate #endif 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate /* 497c478bd9Sstevel@tonic-gate * Utilities shared among file system implementations. 507c478bd9Sstevel@tonic-gate */ 517c478bd9Sstevel@tonic-gate 528329232eSGordon Ross #if defined(_KERNEL) || defined(_FAKE_KERNEL) 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate extern int fs_nosys(); 557c478bd9Sstevel@tonic-gate extern int fs_inval(); 567c478bd9Sstevel@tonic-gate extern int fs_notdir(); 577c478bd9Sstevel@tonic-gate extern int fs_nosys_map(struct vnode *, offset_t, struct as *, caddr_t *, 58da6c28aaSamw size_t, uchar_t, uchar_t, uint_t, struct cred *, 59da6c28aaSamw caller_context_t *); 607c478bd9Sstevel@tonic-gate extern int fs_nosys_addmap(struct vnode *, offset_t, struct as *, caddr_t, 61da6c28aaSamw size_t, uchar_t, uchar_t, uint_t, struct cred *, 62da6c28aaSamw caller_context_t *); 637c478bd9Sstevel@tonic-gate extern int fs_nosys_poll(struct vnode *, short, int, short *, 64da6c28aaSamw struct pollhead **, caller_context_t *); 65da6c28aaSamw extern int fs_ioctl(vnode_t *, int, intptr_t, int, cred_t *, int *); 66da6c28aaSamw extern int fs_putpage(vnode_t *, offset_t, size_t, int, cred_t *, 67da6c28aaSamw caller_context_t *); 68da6c28aaSamw extern int fs_fsync(vnode_t *, int, cred_t *, caller_context_t *); 697c478bd9Sstevel@tonic-gate extern int fs_sync(struct vfs *, short, cred_t *); 707c478bd9Sstevel@tonic-gate extern int fs_rwlock(vnode_t *, int, caller_context_t *); 717c478bd9Sstevel@tonic-gate extern void fs_rwunlock(vnode_t *, int, caller_context_t *); 72da6c28aaSamw extern int fs_cmp(vnode_t *, vnode_t *, caller_context_t *); 73da6c28aaSamw extern int fs_seek(vnode_t *, offset_t, offset_t *, caller_context_t *); 747c478bd9Sstevel@tonic-gate extern int fs_frlock(vnode_t *, int, struct flock64 *, int, offset_t, 75da6c28aaSamw struct flk_callback *, cred_t *, caller_context_t *); 76da6c28aaSamw extern int fs_setfl(vnode_t *, int, int, cred_t *, caller_context_t *); 77da6c28aaSamw extern int fs_poll(vnode_t *, short, int, short *, struct pollhead **, 78da6c28aaSamw caller_context_t *); 79da6c28aaSamw extern int fs_pathconf(struct vnode *, int, ulong_t *, struct cred *, 80da6c28aaSamw caller_context_t *); 817c478bd9Sstevel@tonic-gate extern void clkset(time_t); 82da6c28aaSamw extern void fs_dispose(struct vnode *, page_t *, int, int, struct cred *, 83da6c28aaSamw caller_context_t *); 84da6c28aaSamw extern void fs_nodispose(struct vnode *, page_t *, int, int, struct cred *, 85da6c28aaSamw caller_context_t *); 86da6c28aaSamw extern int fs_fab_acl(struct vnode *, vsecattr_t *, int flag, cred_t *, 87da6c28aaSamw caller_context_t *); 887c478bd9Sstevel@tonic-gate extern int fs_shrlock(struct vnode *, int, struct shrlock *, int, 89da6c28aaSamw cred_t *, caller_context_t *); 90da6c28aaSamw extern int fs_vnevent_nosupport(vnode_t *, vnevent_t, vnode_t *dvp, 91da6c28aaSamw char *fnm, caller_context_t *); 92da6c28aaSamw extern int fs_vnevent_support(vnode_t *, vnevent_t, vnode_t *dvp, 93da6c28aaSamw char *fnm, caller_context_t *); 94fa9e4066Sahrens extern int fs_acl_nontrivial(struct vnode *vp, struct cred *cr); 95dd29fa4aSprabahar extern int fs_need_estale_retry(int); 96da6c28aaSamw extern void fs_vscan_register(int (*av_scan)(vnode_t *, cred_t *, int)); 97da6c28aaSamw extern int fs_vscan(vnode_t *, cred_t *, int); 987c478bd9Sstevel@tonic-gate 99*87bfe94cSPatrick Mooney /* Helper function to detect when epoll checks VOP_POLL handlers */ 100*87bfe94cSPatrick Mooney extern boolean_t fs_reject_epoll(); 101*87bfe94cSPatrick Mooney 1027c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1057c478bd9Sstevel@tonic-gate } 1067c478bd9Sstevel@tonic-gate #endif 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate #endif /* _SYS_FS_SUBR_H */ 109