Lines Matching refs:vp

71 #define	ISROFILE(vp)	\  argument
72 ((vp)->v_type != VCHR && (vp)->v_type != VBLK && \
73 (vp)->v_type != VFIFO && vn_is_readonly(vp))
159 #define VOPSTATS_UPDATE(vp, counter) { \ argument
160 vfs_t *vfsp = (vp)->v_vfsp; \
162 (vfsp->vfs_flag & VFS_STATS) && (vp)->v_type != VBAD) { \
167 __dtrace_probe___fsinfo_##counter(vp, 0, stataddr); \
175 #define VOPSTATS_UPDATE_IO(vp, counter, bytecounter, bytesval) { \ argument
176 vfs_t *vfsp = (vp)->v_vfsp; \
178 (vfsp->vfs_flag & VFS_STATS) && (vp)->v_type != VBAD) { \
183 __dtrace_probe___fsinfo_##counter(vp, bytesval, stataddr); \
197 #define VOPXID_MAP_CR(vp, cr) { \ argument
198 vfs_t *vfsp = (vp)->v_vfsp; \
743 struct vnode *vp, in vn_rdwr() argument
758 if (rw == UIO_WRITE && ISROFILE(vp)) in vn_rdwr()
764 VOPXID_MAP_CR(vp, cr); in vn_rdwr()
779 if (nbl_need_check(vp)) { in vn_rdwr()
782 nbl_start_crit(vp, RW_READER); in vn_rdwr()
784 error = nbl_svmand(vp, cr, &svmand); in vn_rdwr()
787 if (nbl_conflict(vp, rw == UIO_WRITE ? NBL_WRITE : NBL_READ, in vn_rdwr()
794 (void) VOP_RWLOCK(vp, in vn_rdwr()
799 error = VOP_WRITE(vp, &uio, ioflag, cr, NULL); in vn_rdwr()
803 error = VOP_READ(vp, &uio, ioflag, cr, NULL); in vn_rdwr()
805 VOP_RWUNLOCK(vp, in vn_rdwr()
814 nbl_end_crit(vp); in vn_rdwr()
830 vn_rele(vnode_t *vp) in vn_rele() argument
832 VERIFY(vp->v_count > 0); in vn_rele()
833 mutex_enter(&vp->v_lock); in vn_rele()
834 if (vp->v_count == 1) { in vn_rele()
835 mutex_exit(&vp->v_lock); in vn_rele()
836 VOP_INACTIVE(vp, CRED(), NULL); in vn_rele()
839 vp->v_count--; in vn_rele()
840 mutex_exit(&vp->v_lock); in vn_rele()
850 vn_rele_dnlc(vnode_t *vp) in vn_rele_dnlc() argument
852 VERIFY((vp->v_count > 0) && (vp->v_count_dnlc > 0)); in vn_rele_dnlc()
853 mutex_enter(&vp->v_lock); in vn_rele_dnlc()
854 if (--vp->v_count_dnlc == 0) { in vn_rele_dnlc()
855 if (vp->v_count == 1) { in vn_rele_dnlc()
856 mutex_exit(&vp->v_lock); in vn_rele_dnlc()
857 VOP_INACTIVE(vp, CRED(), NULL); in vn_rele_dnlc()
860 vp->v_count--; in vn_rele_dnlc()
862 mutex_exit(&vp->v_lock); in vn_rele_dnlc()
873 vn_rele_stream(vnode_t *vp) in vn_rele_stream() argument
875 VERIFY(vp->v_count > 0); in vn_rele_stream()
876 mutex_enter(&vp->v_lock); in vn_rele_stream()
877 vp->v_stream = NULL; in vn_rele_stream()
878 if (vp->v_count == 1) { in vn_rele_stream()
879 mutex_exit(&vp->v_lock); in vn_rele_stream()
880 VOP_INACTIVE(vp, CRED(), NULL); in vn_rele_stream()
883 vp->v_count--; in vn_rele_stream()
884 mutex_exit(&vp->v_lock); in vn_rele_stream()
888 vn_rele_inactive(vnode_t *vp) in vn_rele_inactive() argument
890 VOP_INACTIVE(vp, CRED(), NULL); in vn_rele_inactive()
904 vn_rele_async(vnode_t *vp, taskq_t *taskq) in vn_rele_async() argument
906 VERIFY(vp->v_count > 0); in vn_rele_async()
907 mutex_enter(&vp->v_lock); in vn_rele_async()
908 if (vp->v_count == 1) { in vn_rele_async()
909 mutex_exit(&vp->v_lock); in vn_rele_async()
911 vp, TQ_SLEEP) != NULL); in vn_rele_async()
914 vp->v_count--; in vn_rele_async()
915 mutex_exit(&vp->v_lock); in vn_rele_async()
951 struct vnode *vp; in vn_openat() local
1002 vn_createat(pnamep, seg, &vattr, excl, mode, &vp, crwhy, in vn_openat()
1010 NULLVPP, &vp, startvp)) { in vn_openat()
1023 if (!(filemode & FOFFMAX) && (vp->v_type == VREG)) { in vn_openat()
1025 if ((error = VOP_GETATTR(vp, &vattr, 0, in vn_openat()
1047 if (vp->v_type == VDIR && !(vp->v_flag & VDIROPEN)) { in vn_openat()
1051 if (ISROFILE(vp)) { in vn_openat()
1062 if (VOP_REALVP(vp, &rvp, NULL) != 0) in vn_openat()
1063 rvp = vp; in vn_openat()
1066 if ((error = VOP_GETATTR(vp, in vn_openat()
1068 MANDLOCK(vp, vattr.va_mode)) in vn_openat()
1078 if (error = VOP_ACCESS(vp, mode, accessflags, CRED(), NULL)) in vn_openat()
1084 if ((filemode & FSEARCH) && vp->v_type != VDIR) { in vn_openat()
1088 if ((filemode & FEXEC) && vp->v_type != VREG) { in vn_openat()
1097 if ((filemode & FNOFOLLOW) && vp->v_type == VLNK) { in vn_openat()
1103 if ((error = VOP_GETATTR(vp, &vattr, 0, CRED(), NULL))) { in vn_openat()
1124 if (vp->v_type == VSOCK) { in vn_openat()
1127 error = VOP_REALVP(vp, &nvp, NULL); in vn_openat()
1128 if (error != 0 || nvp == NULL || nvp == vp || in vn_openat()
1135 if ((vp->v_type == VREG) && nbl_need_check(vp)) { in vn_openat()
1149 error = VOP_SHRLOCK(vp, F_SHARE_NBMAND, &shr, filemode, CRED(), in vn_openat()
1157 nbl_start_crit(vp, RW_READER); in vn_openat()
1161 if (error = VOP_GETATTR(vp, &vattr, 0, CRED(), NULL)) in vn_openat()
1163 if (nbl_conflict(vp, NBL_WRITE, 0, vattr.va_size, 0, in vn_openat()
1174 error = VOP_OPEN(&vp, filemode, CRED(), NULL); in vn_openat()
1185 if ((error = VOP_SETATTR(vp, &vattr, 0, CRED(), NULL)) != 0) in vn_openat()
1189 ASSERT(vp->v_count > 0); in vn_openat()
1192 nbl_end_crit(vp); in vn_openat()
1197 (void) VOP_CLOSE(vp, filemode, 1, (offset_t)0, CRED(), in vn_openat()
1203 (void) VOP_SHRLOCK(vp, F_UNSHARE, &shr, 0, CRED(), in vn_openat()
1220 VN_RELE(vp); in vn_openat()
1224 *vpp = vp; in vn_openat()
1241 vnode_t *vp, in vn_open_upgrade() argument
1244 ASSERT(vp->v_type == VREG); in vn_open_upgrade()
1247 atomic_inc_32(&vp->v_rdcnt); in vn_open_upgrade()
1249 atomic_inc_32(&vp->v_wrcnt); in vn_open_upgrade()
1255 vnode_t *vp, in vn_open_downgrade() argument
1258 ASSERT(vp->v_type == VREG); in vn_open_downgrade()
1261 ASSERT(vp->v_rdcnt > 0); in vn_open_downgrade()
1262 atomic_dec_32(&vp->v_rdcnt); in vn_open_downgrade()
1265 ASSERT(vp->v_wrcnt > 0); in vn_open_downgrade()
1266 atomic_dec_32(&vp->v_wrcnt); in vn_open_downgrade()
1304 struct vnode *vp = NULL; in vn_createat() local
1431 vp = *vpp; in vn_createat()
1432 if (VOP_REALVP(vp, &rvp, NULL) != 0) in vn_createat()
1433 rvp = vp; in vn_createat()
1434 if ((vap->va_mask & AT_SIZE) && nbl_need_check(vp)) { in vn_createat()
1435 nbl_start_crit(vp, RW_READER); in vn_createat()
1440 if (error = VOP_GETATTR(vp, &vattr, 0, CRED(), NULL)) { in vn_createat()
1443 if (MANDLOCK(vp, vattr.va_mode)) { in vn_createat()
1460 if (nbl_conflict(vp, NBL_WRITE, offset, in vn_createat()
1481 if (vp->v_flag & VROOT) { in vn_createat()
1483 error = VOP_CREATE(vp, "", vap, excl, mode, vpp, in vn_createat()
1495 VN_RELE(vp); in vn_createat()
1496 vp = NULL; in vn_createat()
1506 (vp->v_type == VREG)) { in vn_createat()
1508 if ((error = VOP_GETATTR(vp, &vattr, 0, in vn_createat()
1546 nbl_end_crit(vp); in vn_createat()
1549 if (vp != NULL) { in vn_createat()
1550 VN_RELE(vp); in vn_createat()
1551 vp = NULL; in vn_createat()
1785 struct vnode *vp; /* entry vnode */ in vn_removeat() local
1799 dvp = vp = NULL; in vn_removeat()
1800 if (error = lookuppnat(&pn, NULL, NO_FOLLOW, &dvp, &vp, startvp)) { in vn_removeat()
1810 if (vp == NULL) { in vn_removeat()
1815 vfsp = vp->v_vfsp; in vn_removeat()
1825 if (vp->v_flag & VROOT) { in vn_removeat()
1855 mutex_enter(&vp->v_lock); in vn_removeat()
1856 if ((vp->v_flag & VROOT) == 0) { in vn_removeat()
1858 mutex_exit(&vp->v_lock); in vn_removeat()
1862 vfsp = vp->v_vfsp; in vn_removeat()
1870 mutex_exit(&vp->v_lock); in vn_removeat()
1876 VN_RELE(vp); in vn_removeat()
1883 vp = coveredvp; in vn_removeat()
1888 if (vp->v_type == VDIR) in vn_removeat()
1904 vtype = vp->v_type; in vn_removeat()
1917 if (nbl_need_check(vp)) { in vn_removeat()
1918 nbl_start_crit(vp, RW_READER); in vn_removeat()
1920 if (nbl_conflict(vp, NBL_REMOVE, 0, 0, 0, NULL)) { in vn_removeat()
1925 VN_RELE(vp); in vn_removeat()
1926 vp = NULL; in vn_removeat()
1958 nbl_end_crit(vp); in vn_removeat()
1961 if (vp != NULL) in vn_removeat()
1962 VN_RELE(vp); in vn_removeat()
2115 vn_vfswlock_wait(vnode_t *vp) in vn_vfswlock_wait() argument
2119 ASSERT(vp != NULL); in vn_vfswlock_wait()
2121 vpvfsentry = vn_vfslocks_getlock(vp); in vn_vfswlock_wait()
2132 vn_vfsrlock_wait(vnode_t *vp) in vn_vfsrlock_wait() argument
2136 ASSERT(vp != NULL); in vn_vfsrlock_wait()
2138 vpvfsentry = vn_vfslocks_getlock(vp); in vn_vfsrlock_wait()
2155 vn_vfswlock(vnode_t *vp) in vn_vfswlock() argument
2165 if (vp == NULL) in vn_vfswlock()
2168 vpvfsentry = vn_vfslocks_getlock(vp); in vn_vfswlock()
2178 vn_vfsrlock(vnode_t *vp) in vn_vfsrlock() argument
2188 if (vp == NULL) in vn_vfsrlock()
2191 vpvfsentry = vn_vfslocks_getlock(vp); in vn_vfsrlock()
2201 vn_vfsunlock(vnode_t *vp) in vn_vfsunlock() argument
2211 vpvfsentry = vn_vfslocks_getlock(vp); in vn_vfsunlock()
2219 vn_vfswlock_held(vnode_t *vp) in vn_vfswlock_held() argument
2224 ASSERT(vp != NULL); in vn_vfswlock_held()
2226 vpvfsentry = vn_vfslocks_getlock(vp); in vn_vfswlock_held()
2278 struct vnode *vp; in vn_cache_constructor() local
2280 vp = buf; in vn_cache_constructor()
2282 mutex_init(&vp->v_lock, NULL, MUTEX_DEFAULT, NULL); in vn_cache_constructor()
2283 mutex_init(&vp->v_vsd_lock, NULL, MUTEX_DEFAULT, NULL); in vn_cache_constructor()
2284 cv_init(&vp->v_cv, NULL, CV_DEFAULT, NULL); in vn_cache_constructor()
2285 rw_init(&vp->v_nbllock, NULL, RW_DEFAULT, NULL); in vn_cache_constructor()
2286 vp->v_femhead = NULL; /* Must be done before vn_reinit() */ in vn_cache_constructor()
2287 vp->v_path = NULL; in vn_cache_constructor()
2288 vp->v_mpssdata = NULL; in vn_cache_constructor()
2289 vp->v_vsd = NULL; in vn_cache_constructor()
2290 vp->v_fopdata = NULL; in vn_cache_constructor()
2299 struct vnode *vp; in vn_cache_destructor() local
2301 vp = buf; in vn_cache_destructor()
2303 rw_destroy(&vp->v_nbllock); in vn_cache_destructor()
2304 cv_destroy(&vp->v_cv); in vn_cache_destructor()
2305 mutex_destroy(&vp->v_vsd_lock); in vn_cache_destructor()
2306 mutex_destroy(&vp->v_lock); in vn_cache_destructor()
2331 vn_recycle(vnode_t *vp) in vn_recycle() argument
2333 ASSERT(vp->v_pages == NULL); in vn_recycle()
2339 vp->v_rdcnt = 0; in vn_recycle()
2340 vp->v_wrcnt = 0; in vn_recycle()
2341 vp->v_mmap_read = 0; in vn_recycle()
2342 vp->v_mmap_write = 0; in vn_recycle()
2349 if (vp->v_femhead) { in vn_recycle()
2351 ASSERT(vp->v_femhead->femh_list == NULL); in vn_recycle()
2352 mutex_destroy(&vp->v_femhead->femh_lock); in vn_recycle()
2353 kmem_free(vp->v_femhead, sizeof (*(vp->v_femhead))); in vn_recycle()
2354 vp->v_femhead = NULL; in vn_recycle()
2356 if (vp->v_path) { in vn_recycle()
2357 kmem_free(vp->v_path, strlen(vp->v_path) + 1); in vn_recycle()
2358 vp->v_path = NULL; in vn_recycle()
2361 if (vp->v_fopdata != NULL) { in vn_recycle()
2362 free_fopdata(vp); in vn_recycle()
2364 vp->v_mpssdata = NULL; in vn_recycle()
2365 vsd_free(vp); in vn_recycle()
2379 vn_reinit(vnode_t *vp) in vn_reinit() argument
2381 vp->v_count = 1; in vn_reinit()
2382 vp->v_count_dnlc = 0; in vn_reinit()
2383 vp->v_vfsp = NULL; in vn_reinit()
2384 vp->v_stream = NULL; in vn_reinit()
2385 vp->v_vfsmountedhere = NULL; in vn_reinit()
2386 vp->v_flag = 0; in vn_reinit()
2387 vp->v_type = VNON; in vn_reinit()
2388 vp->v_rdev = NODEV; in vn_reinit()
2390 vp->v_filocks = NULL; in vn_reinit()
2391 vp->v_shrlocks = NULL; in vn_reinit()
2392 vp->v_pages = NULL; in vn_reinit()
2394 vp->v_locality = NULL; in vn_reinit()
2395 vp->v_xattrdir = NULL; in vn_reinit()
2398 vn_recycle(vp); in vn_reinit()
2404 vnode_t *vp; in vn_alloc() local
2406 vp = kmem_cache_alloc(vn_cache, kmflag); in vn_alloc()
2408 if (vp != NULL) { in vn_alloc()
2409 vp->v_femhead = NULL; /* Must be done before vn_reinit() */ in vn_alloc()
2410 vp->v_fopdata = NULL; in vn_alloc()
2411 vn_reinit(vp); in vn_alloc()
2414 return (vp); in vn_alloc()
2418 vn_free(vnode_t *vp) in vn_free() argument
2420 ASSERT(vp->v_shrlocks == NULL); in vn_free()
2421 ASSERT(vp->v_filocks == NULL); in vn_free()
2428 ASSERT((vp->v_count == 0) || (vp->v_count == 1)); in vn_free()
2429 ASSERT(vp->v_count_dnlc == 0); in vn_free()
2430 if (vp->v_path != NULL) { in vn_free()
2431 kmem_free(vp->v_path, strlen(vp->v_path) + 1); in vn_free()
2432 vp->v_path = NULL; in vn_free()
2436 if (vp->v_femhead) { in vn_free()
2438 ASSERT(vp->v_femhead->femh_list == NULL); in vn_free()
2439 mutex_destroy(&vp->v_femhead->femh_lock); in vn_free()
2440 kmem_free(vp->v_femhead, sizeof (*(vp->v_femhead))); in vn_free()
2441 vp->v_femhead = NULL; in vn_free()
2444 if (vp->v_fopdata != NULL) { in vn_free()
2445 free_fopdata(vp); in vn_free()
2447 vp->v_mpssdata = NULL; in vn_free()
2448 vsd_free(vp); in vn_free()
2449 kmem_cache_free(vn_cache, vp); in vn_free()
2456 vn_reclaim(vnode_t *vp) in vn_reclaim() argument
2458 vfs_t *vfsp = vp->v_vfsp; in vn_reclaim()
2464 (void) VFS_VNSTATE(vfsp, vp, VNTRANS_RECLAIMED); in vn_reclaim()
2468 vn_idle(vnode_t *vp) in vn_idle() argument
2470 vfs_t *vfsp = vp->v_vfsp; in vn_idle()
2476 (void) VFS_VNSTATE(vfsp, vp, VNTRANS_IDLED); in vn_idle()
2479 vn_exists(vnode_t *vp) in vn_exists() argument
2481 vfs_t *vfsp = vp->v_vfsp; in vn_exists()
2487 (void) VFS_VNSTATE(vfsp, vp, VNTRANS_EXISTS); in vn_exists()
2491 vn_invalid(vnode_t *vp) in vn_invalid() argument
2493 vfs_t *vfsp = vp->v_vfsp; in vn_invalid()
2499 (void) VFS_VNSTATE(vfsp, vp, VNTRANS_DESTROYED); in vn_invalid()
2505 vnevent_support(vnode_t *vp, caller_context_t *ct) in vnevent_support() argument
2507 if (vp == NULL) in vnevent_support()
2510 return (VOP_VNEVENT(vp, VE_SUPPORT, NULL, NULL, ct)); in vnevent_support()
2514 vnevent_rename_src(vnode_t *vp, vnode_t *dvp, char *name, caller_context_t *ct) in vnevent_rename_src() argument
2516 if (vp == NULL || vp->v_femhead == NULL) { in vnevent_rename_src()
2519 (void) VOP_VNEVENT(vp, VE_RENAME_SRC, dvp, name, ct); in vnevent_rename_src()
2523 vnevent_rename_dest(vnode_t *vp, vnode_t *dvp, char *name, in vnevent_rename_dest() argument
2526 if (vp == NULL || vp->v_femhead == NULL) { in vnevent_rename_dest()
2529 (void) VOP_VNEVENT(vp, VE_RENAME_DEST, dvp, name, ct); in vnevent_rename_dest()
2533 vnevent_rename_dest_dir(vnode_t *vp, caller_context_t *ct) in vnevent_rename_dest_dir() argument
2535 if (vp == NULL || vp->v_femhead == NULL) { in vnevent_rename_dest_dir()
2538 (void) VOP_VNEVENT(vp, VE_RENAME_DEST_DIR, NULL, NULL, ct); in vnevent_rename_dest_dir()
2542 vnevent_remove(vnode_t *vp, vnode_t *dvp, char *name, caller_context_t *ct) in vnevent_remove() argument
2544 if (vp == NULL || vp->v_femhead == NULL) { in vnevent_remove()
2547 (void) VOP_VNEVENT(vp, VE_REMOVE, dvp, name, ct); in vnevent_remove()
2551 vnevent_rmdir(vnode_t *vp, vnode_t *dvp, char *name, caller_context_t *ct) in vnevent_rmdir() argument
2553 if (vp == NULL || vp->v_femhead == NULL) { in vnevent_rmdir()
2556 (void) VOP_VNEVENT(vp, VE_RMDIR, dvp, name, ct); in vnevent_rmdir()
2560 vnevent_create(vnode_t *vp, caller_context_t *ct) in vnevent_create() argument
2562 if (vp == NULL || vp->v_femhead == NULL) { in vnevent_create()
2565 (void) VOP_VNEVENT(vp, VE_CREATE, NULL, NULL, ct); in vnevent_create()
2569 vnevent_link(vnode_t *vp, caller_context_t *ct) in vnevent_link() argument
2571 if (vp == NULL || vp->v_femhead == NULL) { in vnevent_link()
2574 (void) VOP_VNEVENT(vp, VE_LINK, NULL, NULL, ct); in vnevent_link()
2578 vnevent_mountedover(vnode_t *vp, caller_context_t *ct) in vnevent_mountedover() argument
2580 if (vp == NULL || vp->v_femhead == NULL) { in vnevent_mountedover()
2583 (void) VOP_VNEVENT(vp, VE_MOUNTEDOVER, NULL, NULL, ct); in vnevent_mountedover()
2587 vnevent_truncate(vnode_t *vp, caller_context_t *ct) in vnevent_truncate() argument
2589 if (vp == NULL || vp->v_femhead == NULL) { in vnevent_truncate()
2592 (void) VOP_VNEVENT(vp, VE_TRUNCATE, NULL, NULL, ct); in vnevent_truncate()
2600 vn_is_readonly(vnode_t *vp) in vn_is_readonly() argument
2602 return (vp->v_vfsp->vfs_flag & VFS_RDONLY); in vn_is_readonly()
2606 vn_has_flocks(vnode_t *vp) in vn_has_flocks() argument
2608 return (vp->v_filocks != NULL); in vn_has_flocks()
2612 vn_has_mandatory_locks(vnode_t *vp, int mode) in vn_has_mandatory_locks() argument
2614 return ((vp->v_filocks != NULL) && (MANDLOCK(vp, mode))); in vn_has_mandatory_locks()
2618 vn_has_cached_data(vnode_t *vp) in vn_has_cached_data() argument
2620 return (vp->v_pages != NULL); in vn_has_cached_data()
2628 vn_can_change_zones(vnode_t *vp) in vn_can_change_zones() argument
2640 if (VOP_REALVP(vp, &rvp, NULL) != 0) in vn_can_change_zones()
2641 rvp = vp; in vn_can_change_zones()
2660 vn_ismntpt(vnode_t *vp) in vn_ismntpt() argument
2662 return (vp->v_vfsmountedhere != NULL); in vn_ismntpt()
2667 vn_mountedvfs(vnode_t *vp) in vn_mountedvfs() argument
2669 return (vp->v_vfsmountedhere); in vn_mountedvfs()
2676 vn_in_dnlc(vnode_t *vp) in vn_in_dnlc() argument
2678 return (vp->v_count_dnlc > 0); in vn_in_dnlc()
2692 vnode_t *vp, in vn_has_other_opens() argument
2696 ASSERT(vp != NULL); in vn_has_other_opens()
2700 if (vp->v_wrcnt > 1) in vn_has_other_opens()
2704 if ((vp->v_rdcnt > 1) || (vp->v_wrcnt > 1)) in vn_has_other_opens()
2708 if ((vp->v_rdcnt > 1) && (vp->v_wrcnt > 1)) in vn_has_other_opens()
2712 if (vp->v_rdcnt > 1) in vn_has_other_opens()
2728 vnode_t *vp, in vn_is_opened() argument
2732 ASSERT(vp != NULL); in vn_is_opened()
2736 if (vp->v_wrcnt) in vn_is_opened()
2740 if (vp->v_rdcnt && vp->v_wrcnt) in vn_is_opened()
2744 if (vp->v_rdcnt || vp->v_wrcnt) in vn_is_opened()
2748 if (vp->v_rdcnt) in vn_is_opened()
2762 vnode_t *vp, in vn_is_mapped() argument
2766 ASSERT(vp != NULL); in vn_is_mapped()
2778 if (atomic_add_64_nv((&(vp->v_mmap_write)), 0)) in vn_is_mapped()
2782 if ((atomic_add_64_nv((&(vp->v_mmap_read)), 0)) && in vn_is_mapped()
2783 (atomic_add_64_nv((&(vp->v_mmap_write)), 0))) in vn_is_mapped()
2787 if ((atomic_add_64_nv((&(vp->v_mmap_read)), 0)) || in vn_is_mapped()
2788 (atomic_add_64_nv((&(vp->v_mmap_write)), 0))) in vn_is_mapped()
2792 if (atomic_add_64_nv((&(vp->v_mmap_read)), 0)) in vn_is_mapped()
2799 if (vp->v_mmap_write) in vn_is_mapped()
2803 if (vp->v_mmap_read && vp->v_mmap_write) in vn_is_mapped()
2807 if (vp->v_mmap_read || vp->v_mmap_write) in vn_is_mapped()
2811 if (vp->v_mmap_read) in vn_is_mapped()
2830 vn_setops(vnode_t *vp, vnodeops_t *vnodeops) in vn_setops() argument
2834 ASSERT(vp != NULL); in vn_setops()
2837 op = vp->v_op; in vn_setops()
2844 if (vp->v_femhead != NULL || atomic_cas_ptr(&vp->v_op, op, vnodeops) != in vn_setops()
2846 fem_setvnops(vp, vnodeops); in vn_setops()
2857 vn_getops(vnode_t *vp) in vn_getops() argument
2861 ASSERT(vp != NULL); in vn_getops()
2863 op = vp->v_op; in vn_getops()
2865 if (vp->v_femhead == NULL && op == vp->v_op) { in vn_getops()
2868 return (fem_getvnops(vp)); in vn_getops()
2877 vn_matchops(vnode_t *vp, vnodeops_t *vnodeops) in vn_matchops() argument
2879 return (vn_getops(vp) == vnodeops); in vn_matchops()
2891 vn_matchopval(vnode_t *vp, char *vopname, fs_generic_func_p funcp) in vn_matchopval() argument
2895 vnodeops_t *vop = vn_getops(vp); in vn_matchopval()
2933 vn_setpath(vnode_t *rootvp, struct vnode *startvp, struct vnode *vp, in vn_setpath() argument
2994 mutex_enter(&vp->v_lock); in vn_setpath()
2995 if (vp->v_path != NULL) { in vn_setpath()
2996 mutex_exit(&vp->v_lock); in vn_setpath()
2999 vp->v_path = rpath; in vn_setpath()
3000 mutex_exit(&vp->v_lock); in vn_setpath()
3010 vn_setpath_str(struct vnode *vp, const char *str, size_t len) in vn_setpath_str() argument
3014 mutex_enter(&vp->v_lock); in vn_setpath_str()
3015 if (vp->v_path != NULL) { in vn_setpath_str()
3016 mutex_exit(&vp->v_lock); in vn_setpath_str()
3021 vp->v_path = buf; in vn_setpath_str()
3022 bcopy(str, vp->v_path, len); in vn_setpath_str()
3023 vp->v_path[len] = '\0'; in vn_setpath_str()
3025 mutex_exit(&vp->v_lock); in vn_setpath_str()
3033 vn_renamepath(vnode_t *dvp, vnode_t *vp, const char *nm, size_t len) in vn_renamepath() argument
3037 mutex_enter(&vp->v_lock); in vn_renamepath()
3038 tmp = vp->v_path; in vn_renamepath()
3039 vp->v_path = NULL; in vn_renamepath()
3040 mutex_exit(&vp->v_lock); in vn_renamepath()
3041 vn_setpath(rootdir, dvp, vp, nm, len); in vn_renamepath()
3103 vn_vmpss_usepageio(vnode_t *vp) in vn_vmpss_usepageio() argument
3105 vfs_t *vfsp = vp->v_vfsp; in vn_vmpss_usepageio()
3132 vnode_t *vp = *vpp; in fop_open() local
3134 VN_HOLD(vp); in fop_open()
3154 VOPXID_MAP_CR(vp, cr); in fop_open()
3163 VOPSTATS_UPDATE(vp, open); in fop_open()
3164 if ((vp->v_type == VREG) && (mode & FREAD)) in fop_open()
3165 atomic_dec_32(&vp->v_rdcnt); in fop_open()
3166 if ((vp->v_type == VREG) && (mode & FWRITE)) in fop_open()
3167 atomic_dec_32(&vp->v_wrcnt); in fop_open()
3178 if (*vpp != vp && *vpp != NULL) { in fop_open()
3179 vn_copypath(vp, *vpp); in fop_open()
3182 if ((vp->v_type == VREG) && (mode & FREAD)) in fop_open()
3183 atomic_dec_32(&vp->v_rdcnt); in fop_open()
3186 if ((vp->v_type == VREG) && (mode & FWRITE)) in fop_open()
3187 atomic_dec_32(&vp->v_wrcnt); in fop_open()
3190 VN_RELE(vp); in fop_open()
3196 vnode_t *vp, in fop_close() argument
3205 VOPXID_MAP_CR(vp, cr); in fop_close()
3207 err = (*(vp)->v_op->vop_close)(vp, flag, count, offset, cr, ct); in fop_close()
3208 VOPSTATS_UPDATE(vp, close); in fop_close()
3213 if ((vp->v_type == VREG) && (count == 1)) { in fop_close()
3215 ASSERT(vp->v_rdcnt > 0); in fop_close()
3216 atomic_dec_32(&vp->v_rdcnt); in fop_close()
3219 ASSERT(vp->v_wrcnt > 0); in fop_close()
3220 atomic_dec_32(&vp->v_wrcnt); in fop_close()
3228 vnode_t *vp, in fop_read() argument
3237 VOPXID_MAP_CR(vp, cr); in fop_read()
3239 err = (*(vp)->v_op->vop_read)(vp, uiop, ioflag, cr, ct); in fop_read()
3240 VOPSTATS_UPDATE_IO(vp, read, in fop_read()
3247 vnode_t *vp, in fop_write() argument
3256 VOPXID_MAP_CR(vp, cr); in fop_write()
3258 err = (*(vp)->v_op->vop_write)(vp, uiop, ioflag, cr, ct); in fop_write()
3259 VOPSTATS_UPDATE_IO(vp, write, in fop_write()
3266 vnode_t *vp, in fop_ioctl() argument
3276 VOPXID_MAP_CR(vp, cr); in fop_ioctl()
3278 err = (*(vp)->v_op->vop_ioctl)(vp, cmd, arg, flag, cr, rvalp, ct); in fop_ioctl()
3279 VOPSTATS_UPDATE(vp, ioctl); in fop_ioctl()
3285 vnode_t *vp, in fop_setfl() argument
3293 VOPXID_MAP_CR(vp, cr); in fop_setfl()
3295 err = (*(vp)->v_op->vop_setfl)(vp, oflags, nflags, cr, ct); in fop_setfl()
3296 VOPSTATS_UPDATE(vp, setfl); in fop_setfl()
3302 vnode_t *vp, in fop_getattr() argument
3310 VOPXID_MAP_CR(vp, cr); in fop_getattr()
3316 if (vfs_has_feature(vp->v_vfsp, VFSFT_XVATTR) == 0) { in fop_getattr()
3325 vfs_has_feature(vp->v_vfsp, VFSFT_ACEMASKONACCESS) == 0) { in fop_getattr()
3328 err = (*(vp)->v_op->vop_getattr)(vp, vap, flags, cr, ct); in fop_getattr()
3329 VOPSTATS_UPDATE(vp, getattr); in fop_getattr()
3335 vnode_t *vp, in fop_setattr() argument
3343 VOPXID_MAP_CR(vp, cr); in fop_setattr()
3349 if (vfs_has_feature(vp->v_vfsp, VFSFT_XVATTR) == 0) { in fop_setattr()
3358 vfs_has_feature(vp->v_vfsp, VFSFT_ACEMASKONACCESS) == 0) { in fop_setattr()
3361 err = (*(vp)->v_op->vop_setattr)(vp, vap, flags, cr, ct); in fop_setattr()
3362 VOPSTATS_UPDATE(vp, setattr); in fop_setattr()
3368 vnode_t *vp, in fop_access() argument
3377 vfs_has_feature(vp->v_vfsp, VFSFT_ACEMASKONACCESS) == 0) { in fop_access()
3381 VOPXID_MAP_CR(vp, cr); in fop_access()
3383 err = (*(vp)->v_op->vop_access)(vp, mode, flags, cr, ct); in fop_access()
3384 VOPSTATS_UPDATE(vp, access); in fop_access()
3626 vnode_t *vp, in fop_readdir() argument
3641 vfs_has_feature(vp->v_vfsp, VFSFT_DIRENTFLAGS) == 0) in fop_readdir()
3644 VOPXID_MAP_CR(vp, cr); in fop_readdir()
3646 err = (*(vp)->v_op->vop_readdir)(vp, uiop, cr, eofp, ct, flags); in fop_readdir()
3647 VOPSTATS_UPDATE_IO(vp, readdir, in fop_readdir()
3692 vnode_t *vp, in fop_readlink() argument
3699 VOPXID_MAP_CR(vp, cr); in fop_readlink()
3701 err = (*(vp)->v_op->vop_readlink)(vp, uiop, cr, ct); in fop_readlink()
3702 VOPSTATS_UPDATE(vp, readlink); in fop_readlink()
3708 vnode_t *vp, in fop_fsync() argument
3715 VOPXID_MAP_CR(vp, cr); in fop_fsync()
3717 err = (*(vp)->v_op->vop_fsync)(vp, syncflag, cr, ct); in fop_fsync()
3718 VOPSTATS_UPDATE(vp, fsync); in fop_fsync()
3724 vnode_t *vp, in fop_inactive() argument
3729 VOPSTATS_UPDATE(vp, inactive); in fop_inactive()
3731 VOPXID_MAP_CR(vp, cr); in fop_inactive()
3733 (*(vp)->v_op->vop_inactive)(vp, cr, ct); in fop_inactive()
3738 vnode_t *vp, in fop_fid() argument
3744 err = (*(vp)->v_op->vop_fid)(vp, fidp, ct); in fop_fid()
3745 VOPSTATS_UPDATE(vp, fid); in fop_fid()
3751 vnode_t *vp, in fop_rwlock() argument
3757 ret = ((*(vp)->v_op->vop_rwlock)(vp, write_lock, ct)); in fop_rwlock()
3758 VOPSTATS_UPDATE(vp, rwlock); in fop_rwlock()
3764 vnode_t *vp, in fop_rwunlock() argument
3768 (*(vp)->v_op->vop_rwunlock)(vp, write_lock, ct); in fop_rwunlock()
3769 VOPSTATS_UPDATE(vp, rwunlock); in fop_rwunlock()
3774 vnode_t *vp, in fop_seek() argument
3781 err = (*(vp)->v_op->vop_seek)(vp, ooff, noffp, ct); in fop_seek()
3782 VOPSTATS_UPDATE(vp, seek); in fop_seek()
3801 vnode_t *vp, in fop_frlock() argument
3812 VOPXID_MAP_CR(vp, cr); in fop_frlock()
3814 err = (*(vp)->v_op->vop_frlock) in fop_frlock()
3815 (vp, cmd, bfp, flag, offset, flk_cbp, cr, ct); in fop_frlock()
3816 VOPSTATS_UPDATE(vp, frlock); in fop_frlock()
3822 vnode_t *vp, in fop_space() argument
3832 VOPXID_MAP_CR(vp, cr); in fop_space()
3834 err = (*(vp)->v_op->vop_space)(vp, cmd, bfp, flag, offset, cr, ct); in fop_space()
3835 VOPSTATS_UPDATE(vp, space); in fop_space()
3841 vnode_t *vp, in fop_realvp() argument
3847 err = (*(vp)->v_op->vop_realvp)(vp, vpp, ct); in fop_realvp()
3848 VOPSTATS_UPDATE(vp, realvp); in fop_realvp()
3854 vnode_t *vp, in fop_getpage() argument
3868 VOPXID_MAP_CR(vp, cr); in fop_getpage()
3870 err = (*(vp)->v_op->vop_getpage) in fop_getpage()
3871 (vp, off, len, protp, plarr, plsz, seg, addr, rw, cr, ct); in fop_getpage()
3872 VOPSTATS_UPDATE(vp, getpage); in fop_getpage()
3878 vnode_t *vp, in fop_putpage() argument
3887 VOPXID_MAP_CR(vp, cr); in fop_putpage()
3889 err = (*(vp)->v_op->vop_putpage)(vp, off, len, flags, cr, ct); in fop_putpage()
3890 VOPSTATS_UPDATE(vp, putpage); in fop_putpage()
3896 vnode_t *vp, in fop_map() argument
3909 VOPXID_MAP_CR(vp, cr); in fop_map()
3911 err = (*(vp)->v_op->vop_map) in fop_map()
3912 (vp, off, as, addrp, len, prot, maxprot, flags, cr, ct); in fop_map()
3913 VOPSTATS_UPDATE(vp, map); in fop_map()
3919 vnode_t *vp, in fop_addmap() argument
3933 VOPXID_MAP_CR(vp, cr); in fop_addmap()
3935 error = (*(vp)->v_op->vop_addmap) in fop_addmap()
3936 (vp, off, as, addr, len, prot, maxprot, flags, cr, ct); in fop_addmap()
3938 if ((!error) && (vp->v_type == VREG)) { in fop_addmap()
3945 atomic_add_64((uint64_t *)(&(vp->v_mmap_read)), in fop_addmap()
3953 atomic_add_64((uint64_t *)(&(vp->v_mmap_write)), in fop_addmap()
3956 atomic_add_64((uint64_t *)(&(vp->v_mmap_read)), in fop_addmap()
3959 atomic_add_64((uint64_t *)(&(vp->v_mmap_read)), in fop_addmap()
3963 VOPSTATS_UPDATE(vp, addmap); in fop_addmap()
3969 vnode_t *vp, in fop_delmap() argument
3983 VOPXID_MAP_CR(vp, cr); in fop_delmap()
3985 error = (*(vp)->v_op->vop_delmap) in fop_delmap()
3986 (vp, off, as, addr, len, prot, maxprot, flags, cr, ct); in fop_delmap()
3995 if ((error != EAGAIN) && (vp->v_type == VREG)) { in fop_delmap()
4000 atomic_add_64((uint64_t *)(&(vp->v_mmap_read)), in fop_delmap()
4008 atomic_add_64((uint64_t *)(&(vp->v_mmap_write)), in fop_delmap()
4011 atomic_add_64((uint64_t *)(&(vp->v_mmap_read)), in fop_delmap()
4014 atomic_add_64((uint64_t *)(&(vp->v_mmap_read)), in fop_delmap()
4018 VOPSTATS_UPDATE(vp, delmap); in fop_delmap()
4025 vnode_t *vp, in fop_poll() argument
4034 err = (*(vp)->v_op->vop_poll)(vp, events, anyyet, reventsp, phpp, ct); in fop_poll()
4035 VOPSTATS_UPDATE(vp, poll); in fop_poll()
4041 vnode_t *vp, in fop_dump() argument
4053 err = (*(vp)->v_op->vop_dump)(vp, addr, lbdn, dblks, ct); in fop_dump()
4054 VOPSTATS_UPDATE(vp, dump); in fop_dump()
4060 vnode_t *vp, in fop_pathconf() argument
4068 VOPXID_MAP_CR(vp, cr); in fop_pathconf()
4070 err = (*(vp)->v_op->vop_pathconf)(vp, cmd, valp, cr, ct); in fop_pathconf()
4071 VOPSTATS_UPDATE(vp, pathconf); in fop_pathconf()
4077 vnode_t *vp, in fop_pageio() argument
4087 VOPXID_MAP_CR(vp, cr); in fop_pageio()
4089 err = (*(vp)->v_op->vop_pageio)(vp, pp, io_off, io_len, flags, cr, ct); in fop_pageio()
4090 VOPSTATS_UPDATE(vp, pageio); in fop_pageio()
4096 vnode_t *vp, in fop_dumpctl() argument
4102 err = (*(vp)->v_op->vop_dumpctl)(vp, action, blkp, ct); in fop_dumpctl()
4103 VOPSTATS_UPDATE(vp, dumpctl); in fop_dumpctl()
4109 vnode_t *vp, in fop_dispose() argument
4117 VOPSTATS_UPDATE(vp, dispose); in fop_dispose()
4119 VOPXID_MAP_CR(vp, cr); in fop_dispose()
4121 (*(vp)->v_op->vop_dispose)(vp, pp, flag, dn, cr, ct); in fop_dispose()
4126 vnode_t *vp, in fop_setsecattr() argument
4134 VOPXID_MAP_CR(vp, cr); in fop_setsecattr()
4141 vfs_has_feature(vp->v_vfsp, VFSFT_ACEMASKONACCESS) == 0) { in fop_setsecattr()
4144 err = (*(vp)->v_op->vop_setsecattr) (vp, vsap, flag, cr, ct); in fop_setsecattr()
4145 VOPSTATS_UPDATE(vp, setsecattr); in fop_setsecattr()
4151 vnode_t *vp, in fop_getsecattr() argument
4164 vfs_has_feature(vp->v_vfsp, VFSFT_ACEMASKONACCESS) == 0) { in fop_getsecattr()
4168 VOPXID_MAP_CR(vp, cr); in fop_getsecattr()
4170 err = (*(vp)->v_op->vop_getsecattr) (vp, vsap, flag, cr, ct); in fop_getsecattr()
4171 VOPSTATS_UPDATE(vp, getsecattr); in fop_getsecattr()
4177 vnode_t *vp, in fop_shrlock() argument
4186 VOPXID_MAP_CR(vp, cr); in fop_shrlock()
4188 err = (*(vp)->v_op->vop_shrlock)(vp, cmd, shr, flag, cr, ct); in fop_shrlock()
4189 VOPSTATS_UPDATE(vp, shrlock); in fop_shrlock()
4194 fop_vnevent(vnode_t *vp, vnevent_t vnevent, vnode_t *dvp, char *fnm, in fop_vnevent() argument
4199 err = (*(vp)->v_op->vop_vnevent)(vp, vnevent, dvp, fnm, ct); in fop_vnevent()
4200 VOPSTATS_UPDATE(vp, vnevent); in fop_vnevent()
4205 fop_reqzcbuf(vnode_t *vp, enum uio_rw ioflag, xuio_t *uiop, cred_t *cr, in fop_reqzcbuf() argument
4210 if (vfs_has_feature(vp->v_vfsp, VFSFT_ZEROCOPY_SUPPORTED) == 0) in fop_reqzcbuf()
4212 err = (*(vp)->v_op->vop_reqzcbuf)(vp, ioflag, uiop, cr, ct); in fop_reqzcbuf()
4213 VOPSTATS_UPDATE(vp, reqzcbuf); in fop_reqzcbuf()
4218 fop_retzcbuf(vnode_t *vp, xuio_t *uiop, cred_t *cr, caller_context_t *ct) in fop_retzcbuf() argument
4222 if (vfs_has_feature(vp->v_vfsp, VFSFT_ZEROCOPY_SUPPORTED) == 0) in fop_retzcbuf()
4224 err = (*(vp)->v_op->vop_retzcbuf)(vp, uiop, cr, ct); in fop_retzcbuf()
4225 VOPSTATS_UPDATE(vp, retzcbuf); in fop_retzcbuf()
4358 vsd_get(vnode_t *vp, uint_t key) in vsd_get() argument
4362 ASSERT(vp != NULL); in vsd_get()
4363 ASSERT(mutex_owned(&vp->v_vsd_lock)); in vsd_get()
4365 vsd = vp->v_vsd; in vsd_get()
4377 vsd_set(vnode_t *vp, uint_t key, void *value) in vsd_set() argument
4381 ASSERT(vp != NULL); in vsd_set()
4382 ASSERT(mutex_owned(&vp->v_vsd_lock)); in vsd_set()
4387 vsd = vp->v_vsd; in vsd_set()
4389 vsd = vp->v_vsd = kmem_zalloc(sizeof (*vsd), KM_SLEEP); in vsd_set()
4432 vsd_free(vnode_t *vp) in vsd_free() argument
4435 struct vsd_node *vsd = vp->v_vsd; in vsd_free()
4442 vp->v_vsd = NULL; in vsd_free()
4470 vp->v_vsd = NULL; in vsd_free()
4525 vn_is_reparse(vnode_t *vp, cred_t *cr, caller_context_t *ct) in vn_is_reparse() argument
4530 if ((vp->v_type != VLNK) || in vn_is_reparse()
4531 !(vfs_has_feature(vp->v_vfsp, VFSFT_XVATTR))) in vn_is_reparse()
4539 if (VOP_GETATTR(vp, &xvattr.xva_vattr, 0, cr, ct)) in vn_is_reparse()