1 /* $NetBSD: smbfs_node.h,v 1.9 2004/02/29 11:47:08 jdolecek Exp $ */
2
3 /*
4 * Copyright (c) 2000-2001, Boris Popov
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Boris Popov.
18 * 4. Neither the name of the author nor the names of any co-contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * FreeBSD: src/sys/fs/smbfs/smbfs_node.h,v 1.1 2001/04/10 07:59:05 bp Exp
35 */
36 #ifndef _FS_SMBFS_NODE_H_
37 #define _FS_SMBFS_NODE_H_
38
39 #include <sys/hash.h> /* for hash32_strn() */
40 #include <miscfs/genfs/genfs_node.h> /* for struct genfs_node */
41
42 #define SMBFS_ROOT_INO 2 /* just like in UFS */
43
44 /* Bits for smbnode.n_flag */
45 #define NFLUSHINPROG 0x0001
46 #define NFLUSHWANT 0x0002 /* they should gone ... */
47 #define NMODIFIED 0x0004 /* bogus, until async IO implemented */
48 /*efine NNEW 0x0008*//* smb/vnode has been allocated */
49 #define NREFPARENT 0x0010 /* node holds parent from recycling */
50 #define NOPEN 0x2000 /* file is open */
51
52 #define SMBFS_ATTRTIMO 5 /* Attribute cache timeout in sec */
53
54 struct smbfs_fctx;
55
56 struct smbnode {
57 struct genfs_node n_gnode;
58 int n_flag;
59 struct smbnode * n_parent;
60 struct vnode * n_vnode;
61 struct smbmount * n_mount;
62 time_t n_attrage; /* attributes cache time */
63 time_t n_ctime; /* Prev create time. */
64 time_t n_nctime; /* last neg cache entry (dir) */
65 struct timespec n_mtime; /* modify time */
66 struct timespec n_atime; /* last access time */
67 u_quad_t n_size;
68 long n_ino;
69 int n_dosattr;
70 u_int16_t n_fid; /* file handle */
71 int n_rwstate; /* granted access mode */
72 u_char n_nmlen;
73 u_char * n_name;
74 struct smbfs_fctx * n_dirseq; /* ff context */
75 long n_dirofs; /* last ff offset */
76 struct lockf * n_lockf; /* Locking records of file */
77 LIST_ENTRY(smbnode) n_hash;
78 };
79
80 #define VTOSMB(vp) ((struct smbnode *)(vp)->v_data)
81 #define SMBTOV(np) ((struct vnode *)(np)->n_vnode)
82
83 struct smbfattr;
84
85 int smbfs_inactive(void *);
86 int smbfs_reclaim(void *);
87 int smbfs_nget(struct mount *mp, struct vnode *dvp, const char *name, int nmlen,
88 struct smbfattr *fap, struct vnode **vpp);
89 #define smbfs_hash(x, y) hash32_strn((x), (y), HASH32_STR_INIT)
90
91 int smbfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred);
92 int smbfs_writevnode(struct vnode *vp, struct uio *uiop, struct ucred *cred, int ioflag);
93 void smbfs_attr_cacheenter(struct vnode *vp, struct smbfattr *fap);
94 int smbfs_attr_cachelookup(struct vnode *vp ,struct vattr *va);
95
96 #define smbfs_attr_cacheremove(vp) VTOSMB(vp)->n_attrage = 0
97
98 #endif /* _FS_SMBFS_NODE_H_ */
Cache object: b2ce254401c1b90eacdd19bfa52a3625
|