xref: /onnv-gate/usr/src/uts/common/smbsrv/smb_fsops.h (revision 6432:98715880dd9e)
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 /*
225772Sas200622  * 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>
37*6432Sas200622 #include <smbsrv/smb_ktypes.h>
385331Samw #include <smbsrv/smb_vops.h>
395772Sas200622 #include <sys/callb.h>
405772Sas200622 #include <sys/flock.h>
415331Samw 
425331Samw #ifdef	__cplusplus
435331Samw extern "C" {
445331Samw #endif
455331Samw 
465331Samw int smb_fsop_open(smb_ofile_t *of);
475331Samw 
485331Samw int smb_fsop_close(smb_ofile_t *of);
495331Samw 
506139Sjb150015 int smb_fsop_create(smb_request_t *, cred_t *, smb_node_t *,
515331Samw     char *name, smb_attr_t *attr, smb_node_t **ret_snode, smb_attr_t *ret_attr);
525331Samw 
535331Samw int smb_fsop_mkdir(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
545331Samw     char *name, smb_attr_t *attr, smb_node_t **ret_snode, smb_attr_t *ret_attr);
555331Samw 
565331Samw int smb_fsop_remove(struct smb_request *sr, cred_t *cr, smb_node_t *dir_snode,
575331Samw     char *name, int od);
585331Samw 
595331Samw int smb_fsop_rmdir(struct smb_request *sr, cred_t *cr, smb_node_t *dir_snode,
605331Samw     char *name, int od);
615331Samw 
625331Samw int smb_fsop_getattr(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
635331Samw     smb_attr_t *attr);
645331Samw 
655331Samw int smb_fsop_readdir(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
665331Samw     uint32_t *cookie, char *name, int *namelen, ino64_t *fileid,
675331Samw     struct fs_stream_info *stream_info, smb_node_t **ret_snode,
685331Samw     smb_attr_t *ret_attr);
695331Samw 
705331Samw int smb_fsop_getdents(struct smb_request *sr, cred_t *cr,
715331Samw     struct smb_node *dir_snode, uint32_t *cookie, uint64_t *verifierp,
725331Samw     int32_t *maxcnt, char *args, char *pattern);
735331Samw 
745331Samw int smb_maybe_mangled_name(char *name);
755331Samw 
765331Samw int smb_fsop_rename(struct smb_request *sr, cred_t *cr,
775331Samw     smb_node_t *from_snode, char *from_name, smb_node_t *to_snode,
785331Samw     char *to_name);
795331Samw 
805331Samw int smb_fsop_setattr(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
815331Samw     smb_attr_t *set_attr, smb_attr_t *ret_attr);
825331Samw 
835331Samw int smb_fsop_read(struct smb_request *sr, cred_t *cr,
845331Samw     smb_node_t *snode, uio_t *uio, smb_attr_t *ret_attr);
855331Samw 
865331Samw int smb_fsop_write(struct smb_request *sr, cred_t *cr, smb_node_t *snode,
875331Samw     uio_t *uio, uint32_t *lcount, smb_attr_t *ret_attr,
885331Samw     uint32_t *stability);
895331Samw 
905331Samw int smb_fsop_statfs(cred_t *cr, struct smb_node *snode,
915331Samw     struct statvfs64 *statp);
925331Samw 
935331Samw int smb_fsop_remove_streams(struct smb_request *sr, cred_t *cr,
945331Samw     smb_node_t *fnode);
955331Samw 
965331Samw int smb_fsop_access(smb_request_t *sr, cred_t *cr, smb_node_t *snode,
975331Samw     uint32_t faccess);
985331Samw 
995331Samw void smb_fsop_eaccess(smb_request_t *sr, cred_t *cr, smb_node_t *snode,
1005331Samw     uint32_t *faccess);
1015331Samw 
1025331Samw int smb_fsop_lookup_name(struct smb_request *sr, cred_t *cr, int flags,
1035331Samw     smb_node_t *root_node, smb_node_t *dir_snode, char *name,
1045331Samw     smb_node_t **ret_snode, smb_attr_t *ret_attr);
1055331Samw 
1065331Samw int smb_fsop_lookup(struct smb_request *sr, cred_t *cr, int flags,
1075331Samw     smb_node_t *root_node, smb_node_t *dir_snode, char *name,
1085331Samw     smb_node_t **ret_snode, smb_attr_t *ret_attr, char *ret_shortname,
1095331Samw     char *ret_name83);
1105331Samw 
1115331Samw int smb_fsop_commit(smb_request_t *sr, cred_t *cr, struct smb_node *snode);
1125331Samw 
1135331Samw int smb_fsop_stream_readdir(struct smb_request *sr, cred_t *cr,
1145331Samw     smb_node_t *fnode, uint32_t *cookiep, struct fs_stream_info *stream_info,
1155331Samw     smb_node_t **ret_snode, smb_attr_t *ret_attr);
1165331Samw 
1175521Sas200622 int smb_fsop_aclread(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *);
1185521Sas200622 int smb_fsop_aclwrite(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *);
1195521Sas200622 acl_type_t smb_fsop_acltype(smb_node_t *);
1205521Sas200622 int smb_fsop_sdread(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *);
1215521Sas200622 int smb_fsop_sdwrite(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *,
1225521Sas200622     int);
1235331Samw 
1246139Sjb150015 uint32_t smb_fsop_shrlock(cred_t *, smb_node_t *, uint32_t, uint32_t, uint32_t);
1255772Sas200622 void smb_fsop_unshrlock(cred_t *cr, smb_node_t *node, uint32_t uniq_fid);
1265331Samw 
1275331Samw /*
1285331Samw  * Lookup-related flags
1295331Samw  *
1305331Samw  * SMB_FOLLOW_LINKS	Follow symbolic links.
1315331Samw  * SMB_IGNORE_CASE	Perform case-insensitive lookup.
1325331Samw  *
1335331Samw  * Misc flags
1345331Samw  *
1355331Samw  * SMB_STREAM_RDDIR	use eflags=0 for streams readdirs this
1365331Samw  *			is currently a workaround because the
1375331Samw  *			vfs isn't filling in this flag
1385331Samw  */
1395331Samw 
1405331Samw #define	SMB_FOLLOW_LINKS	0x00000001
1415331Samw #define	SMB_IGNORE_CASE		0x00000002
1425331Samw #define	SMB_STREAM_RDDIR	0x00000004
1435331Samw 
1445331Samw #ifdef	__cplusplus
1455331Samw }
1465331Samw #endif
1475331Samw 
1485331Samw #endif /* _SMBSRV_SMB_FSOPS_H */
149