xref: /onnv-gate/usr/src/uts/common/smbsrv/smb_fsops.h (revision 5772:237ac22142fe)
15331Samw /*
25331Samw  * CDDL HEADER START
35331Samw  *
45331Samw  * The contents of this file are subject to the terms of the
55331Samw  * Common Development and Distribution License (the "License").
65331Samw  * You may not use this file except in compliance with the License.
75331Samw  *
85331Samw  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
95331Samw  * or http://www.opensolaris.org/os/licensing.
105331Samw  * See the License for the specific language governing permissions
115331Samw  * and limitations under the License.
125331Samw  *
135331Samw  * When distributing Covered Code, include this CDDL HEADER in each
145331Samw  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
155331Samw  * If applicable, add the following below this CDDL HEADER, with the
165331Samw  * fields enclosed by brackets "[]" replaced with your own identifying
175331Samw  * information: Portions Copyright [yyyy] [name of copyright owner]
185331Samw  *
195331Samw  * CDDL HEADER END
205331Samw  */
215331Samw /*
22*5772Sas200622  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
235331Samw  * Use is subject to license terms.
245331Samw  */
255331Samw 
265331Samw #ifndef _SMBSRV_SMB_FSOPS_H
275331Samw #define	_SMBSRV_SMB_FSOPS_H
285331Samw 
295331Samw #pragma ident	"%Z%%M%	%I%	%E% SMI"
305331Samw 
315331Samw /*
325331Samw  * This header file contains all the functions for the interface between
335331Samw  * the smb layer and the fs layer.
345331Samw  */
355331Samw #include <smbsrv/smb_i18n.h>
365331Samw #include <smbsrv/smbinfo.h>
375331Samw #include <smbsrv/smb_vops.h>
385521Sas200622 #include <smbsrv/smbvar.h>
39*5772Sas200622 #include <sys/callb.h>
40*5772Sas200622 #include <sys/flock.h>
415331Samw 
425331Samw #ifdef	__cplusplus
435331Samw extern "C" {
445331Samw #endif
455331Samw 
46*5772Sas200622 extern caller_context_t smb_ct;
47*5772Sas200622 
485331Samw int smb_fsop_open(smb_ofile_t *of);
495331Samw 
505331Samw int smb_fsop_close(smb_ofile_t *of);
515331Samw 
525331Samw int smb_fsop_create(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
535331Samw     char *name, smb_attr_t *attr, smb_node_t **ret_snode, smb_attr_t *ret_attr);
545331Samw 
555331Samw int smb_fsop_mkdir(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
565331Samw     char *name, smb_attr_t *attr, smb_node_t **ret_snode, smb_attr_t *ret_attr);
575331Samw 
585331Samw int smb_fsop_remove(struct smb_request *sr, cred_t *cr, smb_node_t *dir_snode,
595331Samw     char *name, int od);
605331Samw 
615331Samw int smb_fsop_rmdir(struct smb_request *sr, cred_t *cr, smb_node_t *dir_snode,
625331Samw     char *name, int od);
635331Samw 
645331Samw int smb_fsop_getattr(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
655331Samw     smb_attr_t *attr);
665331Samw 
675331Samw int smb_fsop_readdir(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
685331Samw     uint32_t *cookie, char *name, int *namelen, ino64_t *fileid,
695331Samw     struct fs_stream_info *stream_info, smb_node_t **ret_snode,
705331Samw     smb_attr_t *ret_attr);
715331Samw 
725331Samw int smb_fsop_getdents(struct smb_request *sr, cred_t *cr,
735331Samw     struct smb_node *dir_snode, uint32_t *cookie, uint64_t *verifierp,
745331Samw     int32_t *maxcnt, char *args, char *pattern);
755331Samw 
765331Samw int smb_maybe_mangled_name(char *name);
775331Samw 
785331Samw int smb_fsop_rename(struct smb_request *sr, cred_t *cr,
795331Samw     smb_node_t *from_snode, char *from_name, smb_node_t *to_snode,
805331Samw     char *to_name);
815331Samw 
825331Samw int smb_fsop_setattr(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
835331Samw     smb_attr_t *set_attr, smb_attr_t *ret_attr);
845331Samw 
855331Samw int smb_fsop_read(struct smb_request *sr, cred_t *cr,
865331Samw     smb_node_t *snode, uio_t *uio, smb_attr_t *ret_attr);
875331Samw 
885331Samw int smb_fsop_write(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
895331Samw     uio_t *uio, uint32_t *lcount, smb_attr_t *ret_attr,
905331Samw     uint32_t *stability);
915331Samw 
925331Samw int smb_fsop_statfs(cred_t *cr, struct smb_node *snode,
935331Samw     struct statvfs64 *statp);
945331Samw 
955331Samw int smb_fsop_remove_streams(struct smb_request *sr, cred_t *cr,
965331Samw     smb_node_t *fnode);
975331Samw 
985331Samw int smb_fsop_access(smb_request_t *sr, cred_t *cr, smb_node_t *snode,
995331Samw     uint32_t faccess);
1005331Samw 
1015331Samw void smb_fsop_eaccess(smb_request_t *sr, cred_t *cr, smb_node_t *snode,
1025331Samw     uint32_t *faccess);
1035331Samw 
1045331Samw int smb_fsop_lookup_name(struct smb_request *sr, cred_t *cr, int flags,
1055331Samw     smb_node_t *root_node, smb_node_t *dir_snode, char *name,
1065331Samw     smb_node_t **ret_snode, smb_attr_t *ret_attr);
1075331Samw 
1085331Samw int smb_fsop_lookup(struct smb_request *sr, cred_t *cr, int flags,
1095331Samw     smb_node_t *root_node, smb_node_t *dir_snode, char *name,
1105331Samw     smb_node_t **ret_snode, smb_attr_t *ret_attr, char *ret_shortname,
1115331Samw     char *ret_name83);
1125331Samw 
1135331Samw int smb_fsop_commit(smb_request_t *sr, cred_t *cr, struct smb_node *snode);
1145331Samw 
1155331Samw int smb_fsop_stream_readdir(struct smb_request *sr, cred_t *cr,
1165331Samw     smb_node_t *fnode, uint32_t *cookiep, struct fs_stream_info *stream_info,
1175331Samw     smb_node_t **ret_snode, smb_attr_t *ret_attr);
1185331Samw 
1195521Sas200622 int smb_fsop_aclread(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *);
1205521Sas200622 int smb_fsop_aclwrite(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *);
1215521Sas200622 acl_type_t smb_fsop_acltype(smb_node_t *);
1225521Sas200622 int smb_fsop_sdread(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *);
1235521Sas200622 int smb_fsop_sdwrite(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *,
1245521Sas200622     int);
1255331Samw 
126*5772Sas200622 uint32_t smb_fsop_shrlock(cred_t *cr, smb_node_t *node, uint32_t uniq_fid,
127*5772Sas200622     uint32_t desired_access, uint32_t share_access);
128*5772Sas200622 
129*5772Sas200622 void smb_fsop_unshrlock(cred_t *cr, smb_node_t *node, uint32_t uniq_fid);
130*5772Sas200622 
131*5772Sas200622 int smb_fsop_frlock(smb_request_t *sr, smb_node_t *node, smb_lock_t *lock,
132*5772Sas200622     boolean_t unlock);
1335331Samw 
1345331Samw /*
1355331Samw  * Lookup-related flags
1365331Samw  *
1375331Samw  * SMB_FOLLOW_LINKS	Follow symbolic links.
1385331Samw  * SMB_IGNORE_CASE	Perform case-insensitive lookup.
1395331Samw  *
1405331Samw  * Misc flags
1415331Samw  *
1425331Samw  * SMB_STREAM_RDDIR	use eflags=0 for streams readdirs this
1435331Samw  *			is currently a workaround because the
1445331Samw  *			vfs isn't filling in this flag
1455331Samw  */
1465331Samw 
1475331Samw #define	SMB_FOLLOW_LINKS	0x00000001
1485331Samw #define	SMB_IGNORE_CASE		0x00000002
1495331Samw #define	SMB_STREAM_RDDIR	0x00000004
1505331Samw 
1515331Samw #ifdef	__cplusplus
1525331Samw }
1535331Samw #endif
1545331Samw 
1555331Samw #endif /* _SMBSRV_SMB_FSOPS_H */
156