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