16 * 4. Neither the name of the author nor the names of any co-contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $Id: smbfs_node.h,v 1.31.52.1 2005/05/27 02:35:28 lindak Exp $
33 */
34
35 /*
36 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
37 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
38 * Use is subject to license terms.
39 */
40
41 #ifndef _FS_SMBFS_NODE_H_
42 #define _FS_SMBFS_NODE_H_
43
44 /*
45 * Much code copied into here from Sun NFS.
46 * Compare with nfs_clnt.h
47 */
48
49 #include <sys/avl.h>
50 #include <sys/list.h>
51 #include <netsmb/smb_subr.h>
52
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56
57 /*
58 * Cache whole directories (not yet)
204 /*
205 * Linkage in smbfreelist, for reclaiming nodes.
206 * Lock for the free list is: smbfreelist_lock
207 */
208 struct smbnode *r_freef; /* free list forward pointer */
209 struct smbnode *r_freeb; /* free list back pointer */
210
211 smbfs_rwlock_t r_rwlock; /* serialize write/setattr requests */
212 smbfs_rwlock_t r_lkserlock; /* serialize lock with other ops */
213 kmutex_t r_statelock; /* protect (most) smbnode fields */
214
215 /*
216 * File handle, directory search handle,
217 * and reference counts for them, etc.
218 * Lock for these is: r_lkserlock
219 */
220 int n_dirrefs;
221 struct smbfs_fctx *n_dirseq; /* ff context */
222 int n_dirofs; /* last ff offset */
223 int n_fidrefs;
224 uint16_t n_fid; /* file handle */
225 enum vtype n_ovtype; /* vnode type opened */
226 uint32_t n_rights; /* granted rights */
227 int n_vcgenid; /* gereration no. (reconnect) */
228
229 /*
230 * Misc. bookkeeping
231 */
232 cred_t *r_cred; /* current credentials */
233 u_offset_t r_nextr; /* next read offset (read-ahead) */
234 long r_mapcnt; /* count of mmapped pages */
235 uint_t r_count; /* # of refs not reflect in v_count */
236 uint_t r_awcount; /* # of outstanding async write */
237 uint_t r_gcount; /* getattrs waiting to flush pages */
238 uint_t r_flags; /* flags, see below */
239 uint32_t n_flag; /* NXXX flags below */
240 uint_t r_error; /* async write error */
241 kcondvar_t r_cv; /* condvar for blocked threads */
242 avl_tree_t r_dir; /* cache of readdir responses */
243 rddir_cache *r_direof; /* pointer to the EOF entry */
244 kthread_t *r_serial; /* id of purging thread */
245 list_t r_indelmap; /* list of delmap callers */
246
247 /*
248 * Attributes: local, and as last seen on the server.
249 * See notes above re: r_size vs r_attr.fa_size, etc.
250 */
251 smbfattr_t r_attr; /* attributes from the server */
252 hrtime_t r_attrtime; /* time attributes become invalid */
253 hrtime_t r_mtime; /* client time file last modified */
254 len_t r_size; /* client's view of file size */
255
256 /*
257 * Security attributes.
258 */
259 vsecattr_t r_secattr;
260 hrtime_t r_sectime;
261
262 /*
263 * Other attributes, not carried in smbfattr_t
|
16 * 4. Neither the name of the author nor the names of any co-contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $Id: smbfs_node.h,v 1.31.52.1 2005/05/27 02:35:28 lindak Exp $
33 */
34
35 /*
36 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
37 * Use is subject to license terms.
38 *
39 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
40 */
41
42 #ifndef _FS_SMBFS_NODE_H_
43 #define _FS_SMBFS_NODE_H_
44
45 /*
46 * Much code copied into here from Sun NFS.
47 * Compare with nfs_clnt.h
48 */
49
50 #include <sys/avl.h>
51 #include <sys/list.h>
52 #include <netsmb/smb_subr.h>
53
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57
58 /*
59 * Cache whole directories (not yet)
205 /*
206 * Linkage in smbfreelist, for reclaiming nodes.
207 * Lock for the free list is: smbfreelist_lock
208 */
209 struct smbnode *r_freef; /* free list forward pointer */
210 struct smbnode *r_freeb; /* free list back pointer */
211
212 smbfs_rwlock_t r_rwlock; /* serialize write/setattr requests */
213 smbfs_rwlock_t r_lkserlock; /* serialize lock with other ops */
214 kmutex_t r_statelock; /* protect (most) smbnode fields */
215
216 /*
217 * File handle, directory search handle,
218 * and reference counts for them, etc.
219 * Lock for these is: r_lkserlock
220 */
221 int n_dirrefs;
222 struct smbfs_fctx *n_dirseq; /* ff context */
223 int n_dirofs; /* last ff offset */
224 int n_fidrefs;
225 smb_fh_t *n_fid; /* file handle */
226 enum vtype n_ovtype; /* vnode type opened */
227
228 /*
229 * Misc. bookkeeping
230 */
231 cred_t *r_cred; /* current credentials */
232 u_offset_t r_nextr; /* next read offset (read-ahead) */
233 long r_mapcnt; /* count of mmapped pages */
234 uint_t r_inmap; /* to serialize read/write and mmap */
235 uint_t r_count; /* # of refs not reflect in v_count */
236 uint_t r_awcount; /* # of outstanding async write */
237 uint_t r_gcount; /* getattrs waiting to flush pages */
238 uint_t r_flags; /* flags, see below */
239 uint32_t n_flag; /* N--- flags below */
240 uint_t r_error; /* async write error */
241 kcondvar_t r_cv; /* condvar for blocked threads */
242 avl_tree_t r_dir; /* cache of readdir responses */
243 rddir_cache *r_direof; /* pointer to the EOF entry */
244 u_offset_t r_modaddr; /* address for page in writenp */
245 kthread_t *r_serial; /* id of purging thread */
246 list_t r_indelmap; /* list of delmap callers */
247
248 /*
249 * Attributes: local, and as last seen on the server.
250 * See notes above re: r_size vs r_attr.fa_size, etc.
251 */
252 smbfattr_t r_attr; /* attributes from the server */
253 hrtime_t r_attrtime; /* time attributes become invalid */
254 hrtime_t r_mtime; /* client time file last modified */
255 len_t r_size; /* client's view of file size */
256
257 /*
258 * Security attributes.
259 */
260 vsecattr_t r_secattr;
261 hrtime_t r_sectime;
262
263 /*
264 * Other attributes, not carried in smbfattr_t
|