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> 376432Sas200622 #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 46*6600Sas200622 int smb_fsop_amask_to_omode(uint32_t); 47*6600Sas200622 48*6600Sas200622 int smb_fsop_open(smb_node_t *, int, cred_t *); 495331Samw 50*6600Sas200622 int smb_fsop_close(smb_node_t *, int, cred_t *); 51*6600Sas200622 52*6600Sas200622 int smb_fsop_oplock_install(smb_node_t *, int); 53*6600Sas200622 54*6600Sas200622 void smb_fsop_oplock_uninstall(smb_node_t *); 555331Samw 566139Sjb150015 int smb_fsop_create(smb_request_t *, cred_t *, smb_node_t *, 575331Samw char *name, smb_attr_t *attr, smb_node_t **ret_snode, smb_attr_t *ret_attr); 585331Samw 595331Samw int smb_fsop_mkdir(struct smb_request *sr, cred_t *cr, smb_node_t *snode, 605331Samw char *name, smb_attr_t *attr, smb_node_t **ret_snode, smb_attr_t *ret_attr); 615331Samw 625331Samw int smb_fsop_remove(struct smb_request *sr, cred_t *cr, smb_node_t *dir_snode, 635331Samw char *name, int od); 645331Samw 655331Samw int smb_fsop_rmdir(struct smb_request *sr, cred_t *cr, smb_node_t *dir_snode, 665331Samw char *name, int od); 675331Samw 685331Samw int smb_fsop_getattr(struct smb_request *sr, cred_t *cr, smb_node_t *snode, 695331Samw smb_attr_t *attr); 705331Samw 715331Samw int smb_fsop_readdir(struct smb_request *sr, cred_t *cr, smb_node_t *snode, 725331Samw uint32_t *cookie, char *name, int *namelen, ino64_t *fileid, 735331Samw struct fs_stream_info *stream_info, smb_node_t **ret_snode, 745331Samw smb_attr_t *ret_attr); 755331Samw 765331Samw int smb_fsop_getdents(struct smb_request *sr, cred_t *cr, 775331Samw struct smb_node *dir_snode, uint32_t *cookie, uint64_t *verifierp, 785331Samw int32_t *maxcnt, char *args, char *pattern); 795331Samw 805331Samw int smb_maybe_mangled_name(char *name); 815331Samw 825331Samw int smb_fsop_rename(struct smb_request *sr, cred_t *cr, 835331Samw smb_node_t *from_snode, char *from_name, smb_node_t *to_snode, 845331Samw char *to_name); 855331Samw 865331Samw int smb_fsop_setattr(struct smb_request *sr, cred_t *cr, smb_node_t *snode, 875331Samw smb_attr_t *set_attr, smb_attr_t *ret_attr); 885331Samw 895331Samw int smb_fsop_read(struct smb_request *sr, cred_t *cr, 905331Samw smb_node_t *snode, uio_t *uio, smb_attr_t *ret_attr); 915331Samw 925331Samw int smb_fsop_write(struct smb_request *sr, cred_t *cr, smb_node_t *snode, 935331Samw uio_t *uio, uint32_t *lcount, smb_attr_t *ret_attr, 945331Samw uint32_t *stability); 955331Samw 965331Samw int smb_fsop_statfs(cred_t *cr, struct smb_node *snode, 975331Samw struct statvfs64 *statp); 985331Samw 995331Samw int smb_fsop_remove_streams(struct smb_request *sr, cred_t *cr, 1005331Samw smb_node_t *fnode); 1015331Samw 1025331Samw int smb_fsop_access(smb_request_t *sr, cred_t *cr, smb_node_t *snode, 1035331Samw uint32_t faccess); 1045331Samw 1055331Samw void smb_fsop_eaccess(smb_request_t *sr, cred_t *cr, smb_node_t *snode, 1065331Samw uint32_t *faccess); 1075331Samw 1085331Samw int smb_fsop_lookup_name(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); 1115331Samw 1125331Samw int smb_fsop_lookup(struct smb_request *sr, cred_t *cr, int flags, 1135331Samw smb_node_t *root_node, smb_node_t *dir_snode, char *name, 1145331Samw smb_node_t **ret_snode, smb_attr_t *ret_attr, char *ret_shortname, 1155331Samw char *ret_name83); 1165331Samw 1175331Samw int smb_fsop_commit(smb_request_t *sr, cred_t *cr, struct smb_node *snode); 1185331Samw 1195331Samw int smb_fsop_stream_readdir(struct smb_request *sr, cred_t *cr, 1205331Samw smb_node_t *fnode, uint32_t *cookiep, struct fs_stream_info *stream_info, 1215331Samw smb_node_t **ret_snode, smb_attr_t *ret_attr); 1225331Samw 1235521Sas200622 int smb_fsop_aclread(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *); 1245521Sas200622 int smb_fsop_aclwrite(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *); 1255521Sas200622 acl_type_t smb_fsop_acltype(smb_node_t *); 1265521Sas200622 int smb_fsop_sdread(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *); 1275521Sas200622 int smb_fsop_sdwrite(smb_request_t *, cred_t *, smb_node_t *, smb_fssd_t *, 1285521Sas200622 int); 1295331Samw 1306139Sjb150015 uint32_t smb_fsop_shrlock(cred_t *, smb_node_t *, uint32_t, uint32_t, uint32_t); 1315772Sas200622 void smb_fsop_unshrlock(cred_t *cr, smb_node_t *node, uint32_t uniq_fid); 1325331Samw 133*6600Sas200622 int smb_fsop_frlock(smb_node_t *, smb_lock_t *, boolean_t, cred_t *); 134*6600Sas200622 1355331Samw /* 1365331Samw * Lookup-related flags 1375331Samw * 1385331Samw * SMB_FOLLOW_LINKS Follow symbolic links. 1395331Samw * SMB_IGNORE_CASE Perform case-insensitive lookup. 1405331Samw * 1415331Samw * Misc flags 1425331Samw * 1435331Samw * SMB_STREAM_RDDIR use eflags=0 for streams readdirs this 1445331Samw * is currently a workaround because the 1455331Samw * vfs isn't filling in this flag 1465331Samw */ 1475331Samw 1485331Samw #define SMB_FOLLOW_LINKS 0x00000001 1495331Samw #define SMB_IGNORE_CASE 0x00000002 1505331Samw #define SMB_STREAM_RDDIR 0x00000004 1515331Samw 1525331Samw #ifdef __cplusplus 1535331Samw } 1545331Samw #endif 1555331Samw 1565331Samw #endif /* _SMBSRV_SMB_FSOPS_H */ 157