Lines Matching refs:node

148 	smb_node_t	*node;  in smb_node_init()  local
173 node = smb_node_alloc("/", rootdir, node_hdr, hashkey); in smb_node_init()
175 smb_llist_insert_head(node_hdr, node); in smb_node_init()
177 smb_root_node = node; /* smb_node_release in smb_node_fini */ in smb_node_init()
201 smb_node_t *node; in smb_node_fini() local
212 node = smb_llist_head(bucket); in smb_node_fini()
213 while (node != NULL) { in smb_node_fini()
216 (void *)node, node->od_name); in smb_node_fini()
220 smb_llist_remove(bucket, node); in smb_node_fini()
221 node = smb_llist_head(bucket); in smb_node_fini()
265 smb_node_t *node; in smb_node_lookup() local
311 node = list_head(&node_hdr->ll_list); in smb_node_lookup()
312 while (node) { in smb_node_lookup()
313 ASSERT(node->n_magic == SMB_NODE_MAGIC); in smb_node_lookup()
314 ASSERT(node->n_hash_bucket == node_hdr); in smb_node_lookup()
315 if ((node->n_hashkey == hashkey) && (node->vp == vp)) { in smb_node_lookup()
316 mutex_enter(&node->n_mutex); in smb_node_lookup()
318 smb_node_t *, node); in smb_node_lookup()
319 switch (node->n_state) { in smb_node_lookup()
322 node->n_refcnt++; in smb_node_lookup()
323 if ((node->n_dnode == NULL) && in smb_node_lookup()
325 (node != dnode) && in smb_node_lookup()
328 VALIDATE_DIR_NODE(dnode, node); in smb_node_lookup()
329 node->n_dnode = dnode; in smb_node_lookup()
333 smb_node_audit(node); in smb_node_lookup()
334 mutex_exit(&node->n_mutex); in smb_node_lookup()
336 return (node); in smb_node_lookup()
344 mutex_exit(&node->n_mutex); in smb_node_lookup()
353 mutex_exit(&node->n_mutex); in smb_node_lookup()
357 node = smb_llist_next(node_hdr, node); in smb_node_lookup()
365 node = smb_node_alloc(od_name, vp, node_hdr, hashkey); in smb_node_lookup()
366 smb_node_init_reparse(node, &attr); in smb_node_lookup()
369 node->flags |= smb_is_executable(op->fqi.fq_last_comp); in smb_node_lookup()
373 node->n_dnode = dnode; in smb_node_lookup()
374 ASSERT(dnode->n_dnode != node); in smb_node_lookup()
381 node->n_unode = unode; in smb_node_lookup()
384 smb_node_init_system(node); in smb_node_lookup()
386 DTRACE_PROBE1(smb_node_lookup_miss, smb_node_t *, node); in smb_node_lookup()
387 smb_node_audit(node); in smb_node_lookup()
388 smb_llist_insert_head(node_hdr, node); in smb_node_lookup()
390 return (node); in smb_node_lookup()
436 smb_node_ref(smb_node_t *node) in smb_node_ref() argument
438 SMB_NODE_VALID(node); in smb_node_ref()
440 mutex_enter(&node->n_mutex); in smb_node_ref()
441 switch (node->n_state) { in smb_node_ref()
443 node->n_refcnt++; in smb_node_ref()
444 ASSERT(node->n_refcnt); in smb_node_ref()
445 DTRACE_PROBE1(smb_node_ref_exit, smb_node_t *, node); in smb_node_ref()
446 smb_node_audit(node); in smb_node_ref()
451 mutex_exit(&node->n_mutex); in smb_node_ref()
476 smb_node_release(smb_node_t *node) in smb_node_release() argument
478 SMB_NODE_VALID(node); in smb_node_release()
480 mutex_enter(&node->n_mutex); in smb_node_release()
481 ASSERT(node->n_refcnt); in smb_node_release()
482 DTRACE_PROBE1(smb_node_release, smb_node_t *, node); in smb_node_release()
483 if (--node->n_refcnt == 0) { in smb_node_release()
484 switch (node->n_state) { in smb_node_release()
487 node->n_state = SMB_NODE_STATE_DESTROYING; in smb_node_release()
493 if (node->n_fcn_count > 0) { in smb_node_release()
495 smb_node_t *, node); in smb_node_release()
496 node->n_fcn_count = 0; in smb_node_release()
497 (void) smb_fem_fcn_uninstall(node); in smb_node_release()
500 mutex_exit(&node->n_mutex); in smb_node_release()
506 mutex_enter(&node->n_oplock.ol_mutex); in smb_node_release()
507 ASSERT(node->n_oplock.ol_fem == B_FALSE); in smb_node_release()
508 if (node->n_oplock.ol_fem == B_TRUE) { in smb_node_release()
509 smb_fem_oplock_uninstall(node); in smb_node_release()
510 node->n_oplock.ol_fem = B_FALSE; in smb_node_release()
512 mutex_exit(&node->n_oplock.ol_mutex); in smb_node_release()
514 smb_llist_enter(node->n_hash_bucket, RW_WRITER); in smb_node_release()
515 smb_llist_remove(node->n_hash_bucket, node); in smb_node_release()
516 smb_llist_exit(node->n_hash_bucket); in smb_node_release()
521 if (node->flags & NODE_FLAGS_DELETE_ON_CLOSE) { in smb_node_release()
522 smb_node_delete_on_close(node); in smb_node_release()
525 if (node->n_dnode) { in smb_node_release()
526 ASSERT(node->n_dnode->n_magic == in smb_node_release()
528 smb_node_release(node->n_dnode); in smb_node_release()
531 if (node->n_unode) { in smb_node_release()
532 ASSERT(node->n_unode->n_magic == in smb_node_release()
534 smb_node_release(node->n_unode); in smb_node_release()
537 smb_node_free(node); in smb_node_release()
544 smb_node_audit(node); in smb_node_release()
545 mutex_exit(&node->n_mutex); in smb_node_release()
549 smb_node_delete_on_close(smb_node_t *node) in smb_node_delete_on_close() argument
555 d_snode = node->n_dnode; in smb_node_delete_on_close()
557 ASSERT((node->flags & NODE_FLAGS_DELETE_ON_CLOSE) != 0); in smb_node_delete_on_close()
559 node->flags &= ~NODE_FLAGS_DELETE_ON_CLOSE; in smb_node_delete_on_close()
560 node->flags |= NODE_FLAGS_DELETE_COMMITTED; in smb_node_delete_on_close()
561 flags = node->n_delete_on_close_flags; in smb_node_delete_on_close()
562 ASSERT(node->od_name != NULL); in smb_node_delete_on_close()
564 if (smb_node_is_dir(node)) in smb_node_delete_on_close()
565 rc = smb_fsop_rmdir(0, node->delete_on_close_cred, in smb_node_delete_on_close()
566 d_snode, node->od_name, flags); in smb_node_delete_on_close()
568 rc = smb_fsop_remove(0, node->delete_on_close_cred, in smb_node_delete_on_close()
569 d_snode, node->od_name, flags); in smb_node_delete_on_close()
570 crfree(node->delete_on_close_cred); in smb_node_delete_on_close()
571 node->delete_on_close_cred = NULL; in smb_node_delete_on_close()
575 node->od_name, rc); in smb_node_delete_on_close()
576 DTRACE_PROBE2(smb_node_delete_on_close, int, rc, smb_node_t *, node); in smb_node_delete_on_close()
703 smb_node_set_delete_on_close(smb_node_t *node, cred_t *cr, uint32_t flags) in smb_node_set_delete_on_close() argument
712 if (smb_node_is_dir(node)) { in smb_node_set_delete_on_close()
713 status = smb_rmdir_possible(node); in smb_node_set_delete_on_close()
720 if ((node->flags & NODE_FLAGS_VFSROOT) != 0) { in smb_node_set_delete_on_close()
724 mutex_enter(&node->n_mutex); in smb_node_set_delete_on_close()
725 if (node->flags & NODE_FLAGS_DELETE_ON_CLOSE) { in smb_node_set_delete_on_close()
727 mutex_exit(&node->n_mutex); in smb_node_set_delete_on_close()
732 node->delete_on_close_cred = cr; in smb_node_set_delete_on_close()
733 node->n_delete_on_close_flags = flags; in smb_node_set_delete_on_close()
734 node->flags |= NODE_FLAGS_DELETE_ON_CLOSE; in smb_node_set_delete_on_close()
735 mutex_exit(&node->n_mutex); in smb_node_set_delete_on_close()
742 smb_node_notify_change(node, FILE_ACTION_DELETE_PENDING, NULL); in smb_node_set_delete_on_close()
748 smb_node_reset_delete_on_close(smb_node_t *node) in smb_node_reset_delete_on_close() argument
750 mutex_enter(&node->n_mutex); in smb_node_reset_delete_on_close()
751 if (node->flags & NODE_FLAGS_DELETE_ON_CLOSE) { in smb_node_reset_delete_on_close()
752 node->flags &= ~NODE_FLAGS_DELETE_ON_CLOSE; in smb_node_reset_delete_on_close()
753 crfree(node->delete_on_close_cred); in smb_node_reset_delete_on_close()
754 node->delete_on_close_cred = NULL; in smb_node_reset_delete_on_close()
755 node->n_delete_on_close_flags = 0; in smb_node_reset_delete_on_close()
757 mutex_exit(&node->n_mutex); in smb_node_reset_delete_on_close()
770 smb_node_open_check(smb_node_t *node, uint32_t desired_access, in smb_node_open_check() argument
776 SMB_NODE_VALID(node); in smb_node_open_check()
778 smb_llist_enter(&node->n_ofile_list, RW_READER); in smb_node_open_check()
779 of = smb_llist_head(&node->n_ofile_list); in smb_node_open_check()
786 of = smb_llist_next(&node->n_ofile_list, of); in smb_node_open_check()
794 smb_llist_exit(&node->n_ofile_list); in smb_node_open_check()
799 smb_llist_exit(&node->n_ofile_list); in smb_node_open_check()
804 smb_node_rename_check(smb_node_t *node) in smb_node_rename_check() argument
809 SMB_NODE_VALID(node); in smb_node_rename_check()
814 smb_llist_enter(&node->n_ofile_list, RW_READER); in smb_node_rename_check()
815 of = smb_llist_head(&node->n_ofile_list); in smb_node_rename_check()
822 of = smb_llist_next(&node->n_ofile_list, of); in smb_node_rename_check()
827 smb_llist_exit(&node->n_ofile_list); in smb_node_rename_check()
831 smb_llist_exit(&node->n_ofile_list); in smb_node_rename_check()
836 smb_node_delete_check(smb_node_t *node) in smb_node_delete_check() argument
841 SMB_NODE_VALID(node); in smb_node_delete_check()
843 if (smb_node_is_dir(node)) in smb_node_delete_check()
846 if (smb_node_is_reparse(node)) in smb_node_delete_check()
852 smb_llist_enter(&node->n_ofile_list, RW_READER); in smb_node_delete_check()
853 of = smb_llist_head(&node->n_ofile_list); in smb_node_delete_check()
860 of = smb_llist_next(&node->n_ofile_list, of); in smb_node_delete_check()
865 smb_llist_exit(&node->n_ofile_list); in smb_node_delete_check()
869 smb_llist_exit(&node->n_ofile_list); in smb_node_delete_check()
880 smb_node_share_check(smb_node_t *node) in smb_node_share_check() argument
885 SMB_NODE_VALID(node); in smb_node_share_check()
887 smb_llist_enter(&node->n_ofile_list, RW_READER); in smb_node_share_check()
888 of = smb_llist_head(&node->n_ofile_list); in smb_node_share_check()
891 smb_llist_exit(&node->n_ofile_list); in smb_node_share_check()
901 smb_node_fcn_subscribe(smb_node_t *node) in smb_node_fcn_subscribe() argument
904 mutex_enter(&node->n_mutex); in smb_node_fcn_subscribe()
905 if (node->n_fcn_count == 0) in smb_node_fcn_subscribe()
906 (void) smb_fem_fcn_install(node); in smb_node_fcn_subscribe()
907 node->n_fcn_count++; in smb_node_fcn_subscribe()
908 mutex_exit(&node->n_mutex); in smb_node_fcn_subscribe()
912 smb_node_fcn_unsubscribe(smb_node_t *node) in smb_node_fcn_unsubscribe() argument
915 mutex_enter(&node->n_mutex); in smb_node_fcn_unsubscribe()
916 node->n_fcn_count--; in smb_node_fcn_unsubscribe()
917 if (node->n_fcn_count == 0) { in smb_node_fcn_unsubscribe()
918 VERIFY0(smb_fem_fcn_uninstall(node)); in smb_node_fcn_unsubscribe()
920 mutex_exit(&node->n_mutex); in smb_node_fcn_unsubscribe()
924 smb_node_notify_change(smb_node_t *node, uint_t action, const char *name) in smb_node_notify_change() argument
928 SMB_NODE_VALID(node); in smb_node_notify_change()
930 smb_llist_enter(&node->n_ofile_list, RW_READER); in smb_node_notify_change()
931 of = smb_llist_head(&node->n_ofile_list); in smb_node_notify_change()
944 of = smb_llist_next(&node->n_ofile_list, of); in smb_node_notify_change()
946 smb_llist_exit(&node->n_ofile_list); in smb_node_notify_change()
963 if (node->n_dnode != NULL) { in smb_node_notify_change()
964 smb_node_notify_change(node->n_dnode, in smb_node_notify_change()
965 FILE_ACTION_MODIFIED, node->od_name); in smb_node_notify_change()
990 smb_node_notify_modified(smb_node_t *node) in smb_node_notify_modified() argument
994 u_node = SMB_IS_STREAM(node); in smb_node_notify_modified()
1003 if (node->n_dnode != NULL) { in smb_node_notify_modified()
1004 smb_node_notify_change(node->n_dnode, in smb_node_notify_modified()
1005 FILE_ACTION_MODIFIED, node->od_name); in smb_node_notify_modified()
1017 smb_node_start_crit(smb_node_t *node, krw_t mode) in smb_node_start_crit() argument
1019 rw_enter(&node->n_lock, mode); in smb_node_start_crit()
1020 nbl_start_crit(node->vp, mode); in smb_node_start_crit()
1029 smb_node_end_crit(smb_node_t *node) in smb_node_end_crit() argument
1031 nbl_end_crit(node->vp); in smb_node_end_crit()
1032 rw_exit(&node->n_lock); in smb_node_end_crit()
1036 smb_node_in_crit(smb_node_t *node) in smb_node_in_crit() argument
1038 return (nbl_in_crit(node->vp) && RW_LOCK_HELD(&node->n_lock)); in smb_node_in_crit()
1042 smb_node_rdlock(smb_node_t *node) in smb_node_rdlock() argument
1044 rw_enter(&node->n_lock, RW_READER); in smb_node_rdlock()
1048 smb_node_wrlock(smb_node_t *node) in smb_node_wrlock() argument
1050 rw_enter(&node->n_lock, RW_WRITER); in smb_node_wrlock()
1054 smb_node_unlock(smb_node_t *node) in smb_node_unlock() argument
1056 rw_exit(&node->n_lock); in smb_node_unlock()
1060 smb_node_add_ofile(smb_node_t *node, smb_ofile_t *of) in smb_node_add_ofile() argument
1062 SMB_NODE_VALID(node); in smb_node_add_ofile()
1064 smb_llist_enter(&node->n_ofile_list, RW_WRITER); in smb_node_add_ofile()
1065 smb_llist_insert_tail(&node->n_ofile_list, of); in smb_node_add_ofile()
1066 smb_llist_exit(&node->n_ofile_list); in smb_node_add_ofile()
1070 smb_node_rem_ofile(smb_node_t *node, smb_ofile_t *of) in smb_node_rem_ofile() argument
1072 SMB_NODE_VALID(node); in smb_node_rem_ofile()
1074 smb_llist_enter(&node->n_ofile_list, RW_WRITER); in smb_node_rem_ofile()
1075 smb_llist_remove(&node->n_ofile_list, of); in smb_node_rem_ofile()
1076 smb_llist_exit(&node->n_ofile_list); in smb_node_rem_ofile()
1083 smb_node_inc_open_ofiles(smb_node_t *node) in smb_node_inc_open_ofiles() argument
1085 SMB_NODE_VALID(node); in smb_node_inc_open_ofiles()
1086 atomic_inc_32(&node->n_open_count); in smb_node_inc_open_ofiles()
1094 smb_node_dec_open_ofiles(smb_node_t *node) in smb_node_dec_open_ofiles() argument
1096 SMB_NODE_VALID(node); in smb_node_dec_open_ofiles()
1097 return (atomic_dec_32_nv(&node->n_open_count)); in smb_node_dec_open_ofiles()
1104 smb_node_inc_opening_count(smb_node_t *node) in smb_node_inc_opening_count() argument
1106 SMB_NODE_VALID(node); in smb_node_inc_opening_count()
1107 atomic_inc_32(&node->n_opening_count); in smb_node_inc_opening_count()
1114 smb_node_dec_opening_count(smb_node_t *node) in smb_node_dec_opening_count() argument
1116 SMB_NODE_VALID(node); in smb_node_dec_opening_count()
1117 atomic_dec_32(&node->n_opening_count); in smb_node_dec_opening_count()
1124 smb_node_getmntpath(smb_node_t *node, char *buf, uint32_t buflen) in smb_node_getmntpath() argument
1130 ASSERT(node); in smb_node_getmntpath()
1131 ASSERT(node->vp); in smb_node_getmntpath()
1132 ASSERT(node->vp->v_vfsp); in smb_node_getmntpath()
1134 vp = node->vp; in smb_node_getmntpath()
1158 smb_node_getshrpath(smb_node_t *node, smb_tree_t *tree, in smb_node_getshrpath() argument
1163 ASSERT(node); in smb_node_getshrpath()
1167 rc = smb_node_getpath(node, tree->t_snode->vp, buf, buflen); in smb_node_getshrpath()
1187 smb_node_getpath(smb_node_t *node, vnode_t *rootvp, char *buf, uint32_t buflen) in smb_node_getpath() argument
1194 unode = (SMB_IS_STREAM(node)) ? node->n_unode : node; in smb_node_getpath()
1220 if (SMB_IS_STREAM(node)) in smb_node_getpath()
1221 (void) strlcat(buf, node->od_name, buflen); in smb_node_getpath()
1236 smb_node_t *node; in smb_node_alloc() local
1238 node = kmem_cache_alloc(smb_node_cache, KM_SLEEP); in smb_node_alloc()
1240 if (node->n_audit_buf != NULL) in smb_node_alloc()
1241 node->n_audit_buf->anb_index = 0; in smb_node_alloc()
1243 node->flags = 0; in smb_node_alloc()
1245 node->vp = vp; in smb_node_alloc()
1246 node->n_refcnt = 1; in smb_node_alloc()
1247 node->n_hash_bucket = bucket; in smb_node_alloc()
1248 node->n_hashkey = hashkey; in smb_node_alloc()
1249 node->n_open_count = 0; in smb_node_alloc()
1250 node->n_allocsz = 0; in smb_node_alloc()
1251 node->n_dnode = NULL; in smb_node_alloc()
1252 node->n_unode = NULL; in smb_node_alloc()
1253 node->delete_on_close_cred = NULL; in smb_node_alloc()
1254 node->n_delete_on_close_flags = 0; in smb_node_alloc()
1255 node->n_oplock.ol_fem = B_FALSE; in smb_node_alloc()
1257 (void) strlcpy(node->od_name, od_name, sizeof (node->od_name)); in smb_node_alloc()
1259 node->flags |= NODE_XATTR_DIR; in smb_node_alloc()
1262 node->flags |= NODE_FLAGS_VFSROOT; in smb_node_alloc()
1264 node->n_state = SMB_NODE_STATE_AVAILABLE; in smb_node_alloc()
1265 node->n_magic = SMB_NODE_MAGIC; in smb_node_alloc()
1267 return (node); in smb_node_alloc()
1274 smb_node_free(smb_node_t *node) in smb_node_free() argument
1276 SMB_NODE_VALID(node); in smb_node_free()
1278 node->n_magic = 0; in smb_node_free()
1279 VERIFY(!list_link_active(&node->n_lnd)); in smb_node_free()
1280 VERIFY(node->n_lock_list.ll_count == 0); in smb_node_free()
1281 VERIFY(node->n_wlock_list.ll_count == 0); in smb_node_free()
1282 VERIFY(node->n_ofile_list.ll_count == 0); in smb_node_free()
1283 VERIFY(node->n_oplock.ol_fem == B_FALSE); in smb_node_free()
1284 VERIFY(MUTEX_NOT_HELD(&node->n_mutex)); in smb_node_free()
1285 VERIFY(!RW_LOCK_HELD(&node->n_lock)); in smb_node_free()
1286 VN_RELE(node->vp); in smb_node_free()
1287 kmem_cache_free(smb_node_cache, node); in smb_node_free()
1298 smb_node_t *node = (smb_node_t *)buf; in smb_node_constructor()
1300 bzero(node, sizeof (smb_node_t)); in smb_node_constructor()
1302 smb_llist_constructor(&node->n_ofile_list, sizeof (smb_ofile_t), in smb_node_constructor()
1304 smb_llist_constructor(&node->n_lock_list, sizeof (smb_lock_t), in smb_node_constructor()
1306 smb_llist_constructor(&node->n_wlock_list, sizeof (smb_lock_t), in smb_node_constructor()
1308 mutex_init(&node->n_oplock.ol_mutex, NULL, MUTEX_DEFAULT, NULL); in smb_node_constructor()
1309 cv_init(&node->n_oplock.WaitingOpenCV, NULL, CV_DEFAULT, NULL); in smb_node_constructor()
1310 rw_init(&node->n_lock, NULL, RW_DEFAULT, NULL); in smb_node_constructor()
1311 mutex_init(&node->n_mutex, NULL, MUTEX_DEFAULT, NULL); in smb_node_constructor()
1312 smb_node_create_audit_buf(node, kmflags); in smb_node_constructor()
1324 smb_node_t *node = (smb_node_t *)buf; in smb_node_destructor()
1326 smb_node_destroy_audit_buf(node); in smb_node_destructor()
1327 mutex_destroy(&node->n_mutex); in smb_node_destructor()
1328 rw_destroy(&node->n_lock); in smb_node_destructor()
1329 cv_destroy(&node->n_oplock.WaitingOpenCV); in smb_node_destructor()
1330 mutex_destroy(&node->n_oplock.ol_mutex); in smb_node_destructor()
1331 smb_llist_destructor(&node->n_lock_list); in smb_node_destructor()
1332 smb_llist_destructor(&node->n_wlock_list); in smb_node_destructor()
1333 smb_llist_destructor(&node->n_ofile_list); in smb_node_destructor()
1340 smb_node_create_audit_buf(smb_node_t *node, int kmflags) in smb_node_create_audit_buf() argument
1347 node->n_audit_buf = abn; in smb_node_create_audit_buf()
1355 smb_node_destroy_audit_buf(smb_node_t *node) in smb_node_destroy_audit_buf() argument
1357 if (node->n_audit_buf != NULL) { in smb_node_destroy_audit_buf()
1358 kmem_free(node->n_audit_buf, sizeof (smb_audit_buf_node_t)); in smb_node_destroy_audit_buf()
1359 node->n_audit_buf = NULL; in smb_node_destroy_audit_buf()
1370 smb_node_audit(smb_node_t *node) in smb_node_audit() argument
1376 if (node->n_audit_buf) { in smb_node_audit()
1377 abn = node->n_audit_buf; in smb_node_audit()
1382 anr->anr_refcnt = node->n_refcnt; in smb_node_audit()
1387 _NOTE(ARGUNUSED(node)) in smb_node_audit()
1403 smb_node_is_file(smb_node_t *node) in smb_node_is_file() argument
1405 SMB_NODE_VALID(node); in smb_node_is_file()
1406 return (node->vp->v_type == VREG); in smb_node_is_file()
1410 smb_node_is_dir(smb_node_t *node) in smb_node_is_dir() argument
1412 SMB_NODE_VALID(node); in smb_node_is_dir()
1413 return ((node->vp->v_type == VDIR) || in smb_node_is_dir()
1414 (node->flags & NODE_FLAGS_DFSLINK)); in smb_node_is_dir()
1418 smb_node_is_symlink(smb_node_t *node) in smb_node_is_symlink() argument
1420 SMB_NODE_VALID(node); in smb_node_is_symlink()
1421 return ((node->vp->v_type == VLNK) && in smb_node_is_symlink()
1422 ((node->flags & NODE_FLAGS_REPARSE) == 0)); in smb_node_is_symlink()
1426 smb_node_is_dfslink(smb_node_t *node) in smb_node_is_dfslink() argument
1428 SMB_NODE_VALID(node); in smb_node_is_dfslink()
1429 return ((node->vp->v_type == VLNK) && in smb_node_is_dfslink()
1430 (node->flags & NODE_FLAGS_DFSLINK)); in smb_node_is_dfslink()
1434 smb_node_is_reparse(smb_node_t *node) in smb_node_is_reparse() argument
1436 SMB_NODE_VALID(node); in smb_node_is_reparse()
1437 return ((node->vp->v_type == VLNK) && in smb_node_is_reparse()
1438 (node->flags & NODE_FLAGS_REPARSE)); in smb_node_is_reparse()
1442 smb_node_is_vfsroot(smb_node_t *node) in smb_node_is_vfsroot() argument
1444 SMB_NODE_VALID(node); in smb_node_is_vfsroot()
1445 return ((node->flags & NODE_FLAGS_VFSROOT) == NODE_FLAGS_VFSROOT); in smb_node_is_vfsroot()
1449 smb_node_is_system(smb_node_t *node) in smb_node_is_system() argument
1451 SMB_NODE_VALID(node); in smb_node_is_system()
1452 return ((node->flags & NODE_FLAGS_SYSTEM) == NODE_FLAGS_SYSTEM); in smb_node_is_system()
1464 smb_node_file_is_readonly(smb_node_t *node) in smb_node_file_is_readonly() argument
1468 if (node == NULL) in smb_node_file_is_readonly()
1473 (void) smb_fsop_getattr(NULL, zone_kcred(), node, &attr); in smb_node_file_is_readonly()
1529 smb_node_setattr(smb_request_t *sr, smb_node_t *node, in smb_node_setattr() argument
1537 SMB_NODE_VALID(node); in smb_node_setattr()
1562 rc = smb_fsop_getattr(NULL, zone_kcred(), node, &cur_attr); in smb_node_setattr()
1579 if (node->n_allocsz < attr->sa_vattr.va_size) { in smb_node_setattr()
1611 rc = smb_fsop_getattr(NULL, zone_kcred(), node, &cur_attr); in smb_node_setattr()
1687 mutex_enter(&node->n_mutex); in smb_node_setattr()
1692 if (node->n_open_count != 0) in smb_node_setattr()
1693 node->n_allocsz = attr->sa_allocsz; in smb_node_setattr()
1694 mutex_exit(&node->n_mutex); in smb_node_setattr()
1697 rc = smb_fsop_setattr(sr, cr, node, attr); in smb_node_setattr()
1704 smb_node_notify_modified(node); in smb_node_setattr()
1718 smb_node_getattr(smb_request_t *sr, smb_node_t *node, cred_t *cr, in smb_node_getattr() argument
1725 SMB_NODE_VALID(node); in smb_node_getattr()
1727 rc = smb_fsop_getattr(sr, cr, node, attr); in smb_node_getattr()
1731 isdir = smb_node_is_dir(node); in smb_node_getattr()
1733 mutex_enter(&node->n_mutex); in smb_node_getattr()
1747 node->n_open_count > 0 && !isdir && in smb_node_getattr()
1748 attr->sa_allocsz < node->n_allocsz) { in smb_node_getattr()
1749 attr->sa_allocsz = node->n_allocsz; in smb_node_getattr()
1752 mutex_exit(&node->n_mutex); in smb_node_getattr()
1799 smb_node_init_reparse(smb_node_t *node, smb_attr_t *attr) in smb_node_init_reparse() argument
1811 if (reparse_vnode_parse(node->vp, nvl) != 0) { in smb_node_init_reparse()
1816 node->flags |= NODE_FLAGS_REPARSE; in smb_node_init_reparse()
1823 node->flags |= NODE_FLAGS_DFSLINK; in smb_node_init_reparse()
1843 smb_node_init_system(smb_node_t *node) in smb_node_init_system() argument
1845 smb_node_t *dnode = node->n_dnode; in smb_node_init_system()
1846 smb_node_t *unode = node->n_unode; in smb_node_init_system()
1849 node->flags |= NODE_FLAGS_SYSTEM; in smb_node_init_system()
1854 node->flags |= NODE_FLAGS_SYSTEM; in smb_node_init_system()
1858 if ((dnode) && (smb_node_is_vfsroot(node->n_dnode) && in smb_node_init_system()
1859 (strcasecmp(node->od_name, ".$EXTEND") == 0))) { in smb_node_init_system()
1860 node->flags |= NODE_FLAGS_SYSTEM; in smb_node_init_system()