smbfs_subr.h revision bd7c6f51f14365fc31d408903b38c02177384d3d
/*
* Copyright (c) 2000-2001, Boris Popov
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Boris Popov.
* 4. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: smbfs_subr.h,v 1.25 2005/03/17 01:23:40 lindak Exp $
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FS_SMBFS_SMBFS_SUBR_H_
#define _FS_SMBFS_SMBFS_SUBR_H_
#define SMB_VNODE_DEBUG 1
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (1)
#endif
/*
* Let's use C99 standard variadic macros!
* Also the C99 __func__ (function name) feature.
*/
#define SMBFSERR(...) \
#define SMBVDEBUG(...) \
/*
* Possible lock commands
*/
#define SMB_LOCK_EXCL 0
#define SMB_LOCK_SHARED 1
#define SMB_LOCK_RELEASE 2
struct smb_cred;
struct smb_vc;
struct statvfs;
struct timespec;
/*
* Types of find_first, find_next context objects
*/
typedef enum {
ft_LM1 = 1,
/*
*/
#define SMBFS_RDD_FINDFIRST 0x01
#define SMBFS_RDD_EOF 0x02
#define SMBFS_RDD_FINDSINGLE 0x04
/* note SMBFS_RDD_USESEARCH 0x08 replaced by smbfs_fctx_type */
#define SMBFS_RDD_NOCLOSE 0x10
/*
* Search context supplied by server
*/
struct smbfs_fctx {
/*
* Setable values
*/
int f_flags; /* SMBFS_RDD_ */
/*
* Return values
*/
char *f_name; /* current file name */
int f_nmlen; /* name len */
int f_namesz; /* memory allocated */
/*
* Internal variables
*/
int f_wclen;
const char *f_wildcard;
union {
} f_urq;
int f_left; /* entries left */
int f_ecnt; /* entries left in current response */
int f_eofs; /* entry offset in data block */
int f_rnamelen;
char *f_rname; /* resume name */
int f_rnameofs;
int f_otws; /* # over-the-wire ops so far */
char *f_firstnm; /* first filename we got back */
int f_firstnmlen;
int f_rkey; /* resume key */
};
typedef struct smbfs_fctx smbfs_fctx_t;
/*
* smb level (smbfs_smb.c)
*/
/*
* VFS-level init, fini stuff
*/
int smbfs_vfsinit(void);
void smbfs_vfsfini(void);
int smbfs_subrinit(void);
void smbfs_subrfini(void);
int smbfs_clntinit(void);
void smbfs_clntfini(void);
/*
* Function definitions - those having to do with
* smbfs nodes, vnodes, etc
*/
#ifndef DEBUG
#endif
void smbfs_rmhash(struct smbnode *);
/* See avl_create in smbfs_vfsops.c */
void smbfs_init_hash_avl(avl_tree_t *);
extern struct smbfattr smbfs_fattr0;
/* smbfs ACL support */
/* smbfs_xattr.c */
/* For Solaris, interruptible rwlock */
void smbfs_rw_exit(smbfs_rwlock_t *l);
void smbfs_rw_destroy(smbfs_rwlock_t *l);
#endif /* !_FS_SMBFS_SMBFS_SUBR_H_ */