xref: /onnv-gate/usr/src/uts/common/smbsrv/smb_fsops.h (revision 9231:152b6e0d9b1a)
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 /*
228670SJose.Borrego@Sun.COM  * Copyright 2009 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 /*
305331Samw  * This header file contains all the functions for the interface between
315331Samw  * the smb layer and the fs layer.
325331Samw  */
335331Samw #include <smbsrv/smb_i18n.h>
345331Samw #include <smbsrv/smbinfo.h>
356432Sas200622 #include <smbsrv/smb_ktypes.h>
365331Samw #include <smbsrv/smb_vops.h>
375772Sas200622 #include <sys/callb.h>
385772Sas200622 #include <sys/flock.h>
395331Samw 
405331Samw #ifdef	__cplusplus
415331Samw extern "C" {
425331Samw #endif
435331Samw 
446600Sas200622 int smb_fsop_amask_to_omode(uint32_t);
456600Sas200622 
466600Sas200622 int smb_fsop_open(smb_node_t *, int, cred_t *);
475331Samw 
487348SJose.Borrego@Sun.COM void smb_fsop_close(smb_node_t *, int, cred_t *);
496600Sas200622 
506600Sas200622 int smb_fsop_oplock_install(smb_node_t *, int);
516600Sas200622 
526600Sas200622 void smb_fsop_oplock_uninstall(smb_node_t *);
535331Samw 
546139Sjb150015 int smb_fsop_create(smb_request_t *, cred_t *, smb_node_t *,
555331Samw     char *name, smb_attr_t *attr, smb_node_t **ret_snode, smb_attr_t *ret_attr);
565331Samw 
575331Samw int smb_fsop_mkdir(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
585331Samw     char *name, smb_attr_t *attr, smb_node_t **ret_snode, smb_attr_t *ret_attr);
595331Samw 
605331Samw int smb_fsop_remove(struct smb_request *sr, cred_t *cr, smb_node_t *dir_snode,
61*9231SAfshin.Ardakani@Sun.COM     char *name, uint32_t flags);
625331Samw 
635331Samw int smb_fsop_rmdir(struct smb_request *sr, cred_t *cr, smb_node_t *dir_snode,
64*9231SAfshin.Ardakani@Sun.COM     char *name, uint32_t flags);
655331Samw 
665331Samw int smb_fsop_getattr(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
675331Samw     smb_attr_t *attr);
685331Samw 
695331Samw int smb_maybe_mangled_name(char *name);
705331Samw 
715331Samw int smb_fsop_rename(struct smb_request *sr, cred_t *cr,
725331Samw     smb_node_t *from_snode, char *from_name, smb_node_t *to_snode,
735331Samw     char *to_name);
745331Samw 
755331Samw int smb_fsop_setattr(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
765331Samw     smb_attr_t *set_attr, smb_attr_t *ret_attr);
775331Samw 
785331Samw int smb_fsop_read(struct smb_request *sr, cred_t *cr,
795331Samw     smb_node_t *snode, uio_t *uio, smb_attr_t *ret_attr);
805331Samw 
817052Samw int smb_fsop_write(smb_request_t *, cred_t *, smb_node_t *, uio_t *,
827052Samw     uint32_t *, smb_attr_t *, int);
835331Samw 
845331Samw int smb_fsop_statfs(cred_t *cr, struct smb_node *snode,
855331Samw     struct statvfs64 *statp);
865331Samw 
875331Samw int smb_fsop_remove_streams(struct smb_request *sr, cred_t *cr,
885331Samw     smb_node_t *fnode);
895331Samw 
905331Samw int smb_fsop_access(smb_request_t *sr, cred_t *cr, smb_node_t *snode,
915331Samw     uint32_t faccess);
925331Samw 
935331Samw void smb_fsop_eaccess(smb_request_t *sr, cred_t *cr, smb_node_t *snode,
945331Samw     uint32_t *faccess);
955331Samw 
965331Samw int smb_fsop_lookup_name(struct smb_request *sr, cred_t *cr, int flags,
975331Samw     smb_node_t *root_node, smb_node_t *dir_snode, char *name,
985331Samw     smb_node_t **ret_snode, smb_attr_t *ret_attr);
995331Samw 
1005331Samw int smb_fsop_lookup(struct smb_request *sr, cred_t *cr, int flags,
1015331Samw     smb_node_t *root_node, smb_node_t *dir_snode, char *name,
102*9231SAfshin.Ardakani@Sun.COM     smb_node_t **ret_snode, smb_attr_t *ret_attr);
1035331Samw 
1045331Samw int smb_fsop_commit(smb_request_t *sr, cred_t *cr, struct smb_node *snode);
1055331Samw 
1065521Sas200622 int smb_fsop_aclread(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *);
1075521Sas200622 int smb_fsop_aclwrite(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *);
1085521Sas200622 acl_type_t smb_fsop_acltype(smb_node_t *);
1095521Sas200622 int smb_fsop_sdread(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *);
1105521Sas200622 int smb_fsop_sdwrite(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *,
1115521Sas200622     int);
1125331Samw 
1136139Sjb150015 uint32_t smb_fsop_shrlock(cred_t *, smb_node_t *, uint32_t, uint32_t, uint32_t);
1145772Sas200622 void smb_fsop_unshrlock(cred_t *cr, smb_node_t *node, uint32_t uniq_fid);
1155331Samw 
1166600Sas200622 int smb_fsop_frlock(smb_node_t *, smb_lock_t *, boolean_t, cred_t *);
1176600Sas200622 
1185331Samw /*
1195331Samw  * Lookup-related flags
1205331Samw  *
1215331Samw  * SMB_FOLLOW_LINKS	Follow symbolic links.
1225331Samw  * SMB_IGNORE_CASE	Perform case-insensitive lookup.
123*9231SAfshin.Ardakani@Sun.COM  * SMB_CATIA		Perform CATIA character substitution
1245331Samw  */
1255331Samw 
1265331Samw #define	SMB_FOLLOW_LINKS	0x00000001
1275331Samw #define	SMB_IGNORE_CASE		0x00000002
128*9231SAfshin.Ardakani@Sun.COM #define	SMB_CATIA		0x00000004
1295331Samw 
1305331Samw #ifdef	__cplusplus
1315331Samw }
1325331Samw #endif
1335331Samw 
1345331Samw #endif /* _SMBSRV_SMB_FSOPS_H */
135