1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 1994-1997,2002-2003 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate * 26*7c478bd9Sstevel@tonic-gate * cfsd_kmod.h 27*7c478bd9Sstevel@tonic-gate * 28*7c478bd9Sstevel@tonic-gate * Include file for the cfsd_kmod class. 29*7c478bd9Sstevel@tonic-gate * 30*7c478bd9Sstevel@tonic-gate */ 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #ifndef _CFSD_KMOD 33*7c478bd9Sstevel@tonic-gate #define _CFSD_KMOD 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 36*7c478bd9Sstevel@tonic-gate 37*7c478bd9Sstevel@tonic-gate typedef struct cfsd_kmod_object { 38*7c478bd9Sstevel@tonic-gate char i_path[MAXPATHLEN]; /* path to root of file system */ 39*7c478bd9Sstevel@tonic-gate int i_fd; /* file descriptor of i_path */ 40*7c478bd9Sstevel@tonic-gate #ifndef DBUG_OFF 41*7c478bd9Sstevel@tonic-gate char i_fidbuf[1024]; /* for formatted fid */ 42*7c478bd9Sstevel@tonic-gate #endif 43*7c478bd9Sstevel@tonic-gate }cfsd_kmod_object_t; 44*7c478bd9Sstevel@tonic-gate 45*7c478bd9Sstevel@tonic-gate cfsd_kmod_object_t *cfsd_kmod_create(void); 46*7c478bd9Sstevel@tonic-gate void cfsd_kmod_destroy(cfsd_kmod_object_t *kmod_object_p); 47*7c478bd9Sstevel@tonic-gate int kmod_setup(cfsd_kmod_object_t *kmod_object_p, const char *path); 48*7c478bd9Sstevel@tonic-gate void kmod_shutdown(cfsd_kmod_object_t *kmod_object_p); 49*7c478bd9Sstevel@tonic-gate int kmod_xwait(cfsd_kmod_object_t *kmod_object_p); 50*7c478bd9Sstevel@tonic-gate int kmod_stateget(cfsd_kmod_object_t *kmod_object_p); 51*7c478bd9Sstevel@tonic-gate int kmod_stateset(cfsd_kmod_object_t *kmod_object_p, int state); 52*7c478bd9Sstevel@tonic-gate int kmod_exists(cfsd_kmod_object_t *kmod_object_p, cfs_cid_t *cidp); 53*7c478bd9Sstevel@tonic-gate int kmod_lostfound(cfsd_kmod_object_t *kmod_object_p, cfs_cid_t *cidp, 54*7c478bd9Sstevel@tonic-gate const char *namep, char *newnamep); 55*7c478bd9Sstevel@tonic-gate int kmod_lostfoundall(cfsd_kmod_object_t *kmod_object_p); 56*7c478bd9Sstevel@tonic-gate int kmod_rofs(cfsd_kmod_object_t *kmod_object_p); 57*7c478bd9Sstevel@tonic-gate int kmod_rootfid(cfsd_kmod_object_t *kmod_object_p, cfs_fid_t *fidp); 58*7c478bd9Sstevel@tonic-gate int kmod_getstats(cfsd_kmod_object_t *kmod_object_p, cachefsio_getstats_t *gsp); 59*7c478bd9Sstevel@tonic-gate int kmod_getinfo(cfsd_kmod_object_t *kmod_object_p, cfs_cid_t *filep, 60*7c478bd9Sstevel@tonic-gate cachefsio_getinfo_t *infop); 61*7c478bd9Sstevel@tonic-gate int kmod_cidtofid(cfsd_kmod_object_t *kmod_object_p, 62*7c478bd9Sstevel@tonic-gate cfs_cid_t *cidp, cfs_fid_t *fidp); 63*7c478bd9Sstevel@tonic-gate int kmod_getattrfid(cfsd_kmod_object_t *kmod_object_p, cfs_fid_t *fidp, 64*7c478bd9Sstevel@tonic-gate dl_cred_t *credp, cfs_vattr_t *vattrp); 65*7c478bd9Sstevel@tonic-gate int kmod_getattrname(cfsd_kmod_object_t *kmod_object_p, cfs_fid_t *dirp, 66*7c478bd9Sstevel@tonic-gate const char *name, dl_cred_t *credp, cfs_vattr_t *vattrp, cfs_fid_t *filep); 67*7c478bd9Sstevel@tonic-gate int kmod_create(cfsd_kmod_object_t *kmod_object_p, cfs_fid_t *dirp, 68*7c478bd9Sstevel@tonic-gate const char *namep, const cfs_cid_t *cidp, cfs_vattr_t *vattrp, 69*7c478bd9Sstevel@tonic-gate int exclusive, int mode, dl_cred_t *credp, cfs_fid_t *newfidp, 70*7c478bd9Sstevel@tonic-gate timestruc_t *ctimep, timestruc_t *mtimep); 71*7c478bd9Sstevel@tonic-gate int kmod_pushback(cfsd_kmod_object_t *kmod_object_p, cfs_cid_t *filep, 72*7c478bd9Sstevel@tonic-gate cfs_fid_t *fidp, dl_cred_t *credp, timestruc_t *ctimep, timestruc_t *mtimep, 73*7c478bd9Sstevel@tonic-gate int update); 74*7c478bd9Sstevel@tonic-gate int kmod_rename(cfsd_kmod_object_t *kmod_object_p, cfs_fid_t *olddir, 75*7c478bd9Sstevel@tonic-gate const char *oldname, cfs_fid_t *newdir, const char *newname, 76*7c478bd9Sstevel@tonic-gate const cfs_cid_t *cidp, dl_cred_t *credp, timestruc_t *ctimep, 77*7c478bd9Sstevel@tonic-gate timestruc_t *delctimep, const cfs_cid_t *delcidp); 78*7c478bd9Sstevel@tonic-gate int kmod_setattr(cfsd_kmod_object_t *kmod_object_p, cfs_fid_t *fidp, 79*7c478bd9Sstevel@tonic-gate const cfs_cid_t *cidp, cfs_vattr_t *vattrp, int flags, dl_cred_t *credp, 80*7c478bd9Sstevel@tonic-gate timestruc_t *ctimep, timestruc_t *mtimep); 81*7c478bd9Sstevel@tonic-gate int kmod_setsecattr(cfsd_kmod_object_t *kmod_object_p, cfs_fid_t *fidp, 82*7c478bd9Sstevel@tonic-gate const cfs_cid_t *cidp, ulong_t mask, int aclcnt, int dfaclcnt, 83*7c478bd9Sstevel@tonic-gate const aclent_t *acl, dl_cred_t *credp, timestruc_t *ctimep, 84*7c478bd9Sstevel@tonic-gate timestruc_t *mtimep); 85*7c478bd9Sstevel@tonic-gate int kmod_remove(cfsd_kmod_object_t *kmod_object_p, const cfs_fid_t *fidp, 86*7c478bd9Sstevel@tonic-gate const cfs_cid_t *cidp, const char *namep, const dl_cred_t *credp, 87*7c478bd9Sstevel@tonic-gate timestruc_t *ctimep); 88*7c478bd9Sstevel@tonic-gate int kmod_link(cfsd_kmod_object_t *kmod_object_p, const cfs_fid_t *dirfidp, 89*7c478bd9Sstevel@tonic-gate const char *namep, const cfs_fid_t *filefidp, const cfs_cid_t *cidp, 90*7c478bd9Sstevel@tonic-gate const dl_cred_t *credp, timestruc_t *ctimep); 91*7c478bd9Sstevel@tonic-gate int kmod_mkdir(cfsd_kmod_object_t *kmod_object_p, const cfs_fid_t *dirfidp, 92*7c478bd9Sstevel@tonic-gate const char *namep, const cfs_cid_t *cidp, const cfs_vattr_t *vattrp, 93*7c478bd9Sstevel@tonic-gate const dl_cred_t *credp, cfs_fid_t *newfidp); 94*7c478bd9Sstevel@tonic-gate int kmod_rmdir(cfsd_kmod_object_t *kmod_object_p, const cfs_fid_t *dirfidp, 95*7c478bd9Sstevel@tonic-gate const char *namep, const dl_cred_t *credp); 96*7c478bd9Sstevel@tonic-gate int kmod_symlink(cfsd_kmod_object_t *kmod_object_p, const cfs_fid_t *dirfidp, 97*7c478bd9Sstevel@tonic-gate const char *namep, const cfs_cid_t *cidp, const char *linkvalp, 98*7c478bd9Sstevel@tonic-gate const cfs_vattr_t *vattrp, const dl_cred_t *credp, cfs_fid_t *newfidp, 99*7c478bd9Sstevel@tonic-gate timestruc_t *ctimep, timestruc_t *mtimep); 100*7c478bd9Sstevel@tonic-gate #ifndef DBUG_OFF 101*7c478bd9Sstevel@tonic-gate void kmod_format_fid(cfsd_kmod_object_t *kmod_object_p, const cfs_fid_t *fidp); 102*7c478bd9Sstevel@tonic-gate void kmod_print_cred(const dl_cred_t *credp); 103*7c478bd9Sstevel@tonic-gate void kmod_print_attr(const vattr_t *vp); 104*7c478bd9Sstevel@tonic-gate #else 105*7c478bd9Sstevel@tonic-gate #define kmod_format_fid(A, B) 0 106*7c478bd9Sstevel@tonic-gate #define kmod_print_cred(A) 0 107*7c478bd9Sstevel@tonic-gate #define kmod_print_attr(A) 0 108*7c478bd9Sstevel@tonic-gate #endif /* DBUG_OFF */ 109*7c478bd9Sstevel@tonic-gate int kmod_doioctl(cfsd_kmod_object_t *kmod_object_p, enum cfsdcmd_cmds cmd, 110*7c478bd9Sstevel@tonic-gate void *sdata, int slen, void *rdata, int rlen); 111*7c478bd9Sstevel@tonic-gate 112*7c478bd9Sstevel@tonic-gate #endif /* _CFSD_KMOD */ 113