Lines Matching refs:ip
245 struct inode *ip; /* the file we contain */ member
289 struct inode *ip = VTOI(vp); in ufs_close() local
290 if (ip->i_delaylen) { in ufs_close()
292 (void) ufs_putpages(vp, ip->i_delayoff, ip->i_delaylen, in ufs_close()
294 ip->i_delaylen = 0; in ufs_close()
306 struct inode *ip = VTOI(vp); in ufs_read() local
312 ASSERT(RW_READ_HELD(&ip->i_rwlock)); in ufs_read()
318 if (MANDLOCK(vp, ip->i_mode)) { in ufs_read()
328 ufsvfsp = ip->i_ufsvfs; in ufs_read()
339 if ((ip->i_mode & IFMT) == IFDIR) { in ufs_read()
341 rw_enter(&ip->i_contents, RW_READER); in ufs_read()
342 error = rdip(ip, uiop, ioflag, cr); in ufs_read()
343 rw_exit(&ip->i_contents); in ufs_read()
353 rw_exit(&ip->i_rwlock); in ufs_read()
359 rw_enter(&ip->i_rwlock, RW_READER); in ufs_read()
380 rw_enter(&ip->i_contents, RW_READER); in ufs_read()
381 error = rdip(ip, uiop, ioflag, cr); in ufs_read()
382 rw_exit(&ip->i_contents); in ufs_read()
405 ufs_check_rewrite(struct inode *ip, struct uio *uiop, int ioflag) in ufs_check_rewrite() argument
423 return (((ip->i_mode & IFMT) == IFREG) && !(ioflag & FAPPEND) && in ufs_check_rewrite()
425 (uiop->uio_loffset < ip->i_size) && (uiop->uio_resid > 0) && in ufs_check_rewrite()
426 ((ip->i_size - uiop->uio_loffset) >= uiop->uio_resid) && in ufs_check_rewrite()
427 !(ioflag & FSYNC) && !bmap_has_holes(ip) && in ufs_check_rewrite()
436 struct inode *ip = VTOI(vp); in ufs_write() local
446 ASSERT(RW_LOCK_HELD(&ip->i_rwlock)); in ufs_write()
454 if ((ufsvfsp = ip->i_ufsvfs) == NULL) { in ufs_write()
458 if (MANDLOCK(vp, ip->i_mode)) { in ufs_write()
460 ASSERT(RW_WRITE_HELD(&ip->i_rwlock)); in ufs_write()
472 exclusive = rw_write_held(&ip->i_rwlock); in ufs_write()
473 rewriteflg = ufs_check_rewrite(ip, uiop, ioflag); in ufs_write()
478 if ((ip->i_flag & IDIRECTIO || ufsvfsp->vfs_forcedirectio) && in ufs_write()
485 rw_enter(&ip->i_contents, RW_READER); in ufs_write()
486 error = ufs_directio_write(ip, uiop, ioflag, 1, cr, in ufs_write()
501 mutex_enter(&ip->i_tlock); in ufs_write()
502 i_flag_save = ip->i_flag; in ufs_write()
503 ip->i_flag |= IUPD | ICHG; in ufs_write()
504 ip->i_seq++; in ufs_write()
505 ITIMES_NOLOCK(ip); in ufs_write()
507 ip->i_flag &= ~IMOD; in ufs_write()
508 ip->i_flag |= IMODACC; in ufs_write()
510 mutex_exit(&ip->i_tlock); in ufs_write()
511 rw_exit(&ip->i_contents); in ufs_write()
516 rw_exit(&ip->i_contents); in ufs_write()
521 if (!exclusive && !rw_tryupgrade(&ip->i_rwlock)) { in ufs_write()
522 rw_exit(&ip->i_rwlock); in ufs_write()
523 rw_enter(&ip->i_rwlock, RW_WRITER); in ufs_write()
528 if (MANDLOCK(vp, ip->i_mode)) in ufs_write()
540 TRANS_WRITE_RESV(ip, uiop, ulp, &resv, &resid); in ufs_write()
545 if (ufs_WRITES && (ip->i_writes > ufs_HW)) { in ufs_write()
546 mutex_enter(&ip->i_tlock); in ufs_write()
547 while (ip->i_writes > ufs_HW) { in ufs_write()
549 cv_wait(&ip->i_wrcv, &ip->i_tlock); in ufs_write()
551 mutex_exit(&ip->i_tlock); in ufs_write()
568 rw_enter(&ip->i_contents, RW_READER); in ufs_write()
569 mutex_enter(&ip->i_tlock); in ufs_write()
570 i_flag_save = ip->i_flag; in ufs_write()
571 ip->i_flag |= IUPD | ICHG; in ufs_write()
572 ip->i_seq++; in ufs_write()
573 ITIMES_NOLOCK(ip); in ufs_write()
575 ip->i_flag &= ~IMOD; in ufs_write()
576 ip->i_flag |= IMODACC; in ufs_write()
578 mutex_exit(&ip->i_tlock); in ufs_write()
579 rw_exit(&ip->i_contents); in ufs_write()
596 rw_enter(&ip->i_contents, RW_WRITER); in ufs_write()
597 if ((ioflag & FAPPEND) != 0 && (ip->i_mode & IFMT) == IFREG) { in ufs_write()
601 uiop->uio_loffset = ip->i_size; in ufs_write()
609 ip->i_flag |= IQUIET; in ufs_write()
611 TRANS_WRITE(ip, uiop, ioflag, error, ulp, cr, resv, resid); in ufs_write()
613 error = wrip(ip, uiop, ioflag, cr); in ufs_write()
615 ip->i_flag &= ~IQUIET; in ufs_write()
617 rw_exit(&ip->i_contents); in ufs_write()
664 wrip(struct inode *ip, struct uio *uio, int ioflag, struct cred *cr) in wrip() argument
695 vp = ITOV(ip); in wrip()
701 if ((ufsvfsp = ip->i_ufsvfs) == NULL) in wrip()
704 fs = ip->i_fs; in wrip()
706 ASSERT(RW_WRITE_HELD(&ip->i_contents)); in wrip()
709 type = ip->i_mode & IFMT; in wrip()
751 ip->i_flag |= INOACC; /* don't update ref time in getpage */ in wrip()
754 ip->i_flag |= ISYNC; in wrip()
760 if (ip->i_flag & IDIRECTIO || ufsvfsp->vfs_forcedirectio) { in wrip()
762 error = ufs_directio_write(ip, uio, ioflag, 0, cr, in wrip()
769 (ip->i_flag & (ICHG|IUPD))) { in wrip()
771 ip->i_flag |= ISEQ; in wrip()
810 fs = ip->i_fs; in wrip()
831 if (uoff + n > ip->i_size) { in wrip()
838 error = bmap_write(ip, uoff, (int)(on + n), in wrip()
844 if (ip->i_flag & (ICHG|IUPD)) { in wrip()
846 ip->i_flag |= ISEQ; in wrip()
859 ASSERT(ip->i_writer == NULL); in wrip()
860 ip->i_writer = curthread; in wrip()
876 iblocks = ip->i_blocks; in wrip()
877 error = bmap_write(ip, uoff, (int)(on + n), in wrip()
883 if (ip->i_flag & (ICHG|IUPD)) { in wrip()
885 ip->i_flag |= ISEQ; in wrip()
894 if (iblocks == ip->i_blocks) in wrip()
905 error = ufs_indirblk_sync(ip, uoff); in wrip()
924 rw_exit(&ip->i_contents); in wrip()
1014 rw_enter(&ip->i_contents, RW_WRITER); in wrip()
1015 old_i_size = ip->i_size; in wrip()
1016 UFS_SET_ISIZE(uoff + n, ip); in wrip()
1017 TRANS_INODE(ufsvfsp, ip); in wrip()
1023 if ((ip->i_size > MAXOFF32_T) && in wrip()
1031 mutex_enter(&ip->i_tlock); in wrip()
1032 ip->i_writer = NULL; in wrip()
1033 cv_broadcast(&ip->i_wrcv); in wrip()
1034 mutex_exit(&ip->i_tlock); in wrip()
1035 rw_exit(&ip->i_contents); in wrip()
1163 rw_enter(&ip->i_contents, RW_WRITER); in wrip()
1176 (void) ufs_itrunc(ip, old_i_size, 0, cr); in wrip()
1182 ip->i_flag |= IUPD | ICHG; in wrip()
1191 ip->i_flag |= ISEQ; in wrip()
1193 ip->i_flag |= IATTCHG; in wrip()
1194 if ((ip->i_mode & (IEXEC | (IEXEC >> 3) | in wrip()
1196 (ip->i_mode & (ISUID | ISGID)) != 0 && in wrip()
1198 (ip->i_mode & ISUID) != 0 && ip->i_uid == 0) != 0) { in wrip()
1207 ip->i_mode &= ~(ISUID | ISGID); in wrip()
1215 if (!ufs_check_rewrite(ip, uio, ioflag) || !(ioflag & FDSYNC)) { in wrip()
1216 TRANS_INODE(ufsvfsp, ip); in wrip()
1225 ip->i_seq++; in wrip()
1226 ip->i_flag &= ~ISEQ; /* no longer deferred */ in wrip()
1243 if ((ip->i_flag & ISYNC) != 0) { in wrip()
1247 if ((ip->i_flag & (IATTCHG|IBDWRITE)) || in wrip()
1249 ufs_iupdat(ip, 1); in wrip()
1262 ip->i_flag &= ~(INOACC | ISYNC); in wrip()
1263 ITIMES_NOLOCK(ip); in wrip()
1271 rdip(struct inode *ip, struct uio *uio, int ioflag, cred_t *cr) in rdip() argument
1287 vp = ITOV(ip); in rdip()
1289 ASSERT(RW_LOCK_HELD(&ip->i_contents)); in rdip()
1291 ufsvfsp = ip->i_ufsvfs; in rdip()
1299 type = ip->i_mode & IFMT; in rdip()
1316 if (!ULOCKFS_IS_NOIACC(ITOUL(ip)) && (fs->fs_ronly == 0) && in rdip()
1318 mutex_enter(&ip->i_tlock); in rdip()
1319 ip->i_flag |= IACC; in rdip()
1320 mutex_exit(&ip->i_tlock); in rdip()
1325 if (ip->i_flag & IDIRECTIO || ufsvfsp->vfs_forcedirectio) { in rdip()
1326 error = ufs_directio_read(ip, uio, cr, &directio_status); in rdip()
1331 rwtype = (rw_write_held(&ip->i_contents)?RW_WRITER:RW_READER); in rdip()
1342 diff = ip->i_size - uoff; in rdip()
1365 rw_exit(&ip->i_contents); in rdip()
1405 rw_enter(&ip->i_contents, rwtype); in rdip()
1420 if (TRANS_ISTRANS(ufsvfsp) && ((ip->i_mode & IFMT) == IFDIR)) { in rdip()
1426 (ip->i_flag & (IATTCHG|IBDWRITE)))) { in rdip()
1427 ufs_iupdat(ip, 1); in rdip()
1437 ITIMES(ip); in rdip()
1857 struct inode *ip = VTOI(vp); in ufs_ioctl() local
1866 TOP_IUPDAT_SIZE(ip)); in ufs_ioctl()
1873 TOP_IUPDAT_SIZE(ip)); in ufs_ioctl()
1892 struct inode *ip = VTOI(vp); in ufs_getattr() local
1901 UFS_GET_ISIZE(&vap->va_size, ip); in ufs_getattr()
1908 ufsvfsp = ip->i_ufsvfs; in ufs_getattr()
1914 rw_enter(&ip->i_contents, RW_READER); in ufs_getattr()
1924 vap->va_mode = ip->i_mode & MODEMASK; in ufs_getattr()
1935 if (ip->i_ufs_acl && ip->i_ufs_acl->aclass.acl_ismask) { in ufs_getattr()
1938 (ip->i_ufs_acl->aclass.acl_maskbits & PERMMASK) << 3; in ufs_getattr()
1940 vap->va_uid = ip->i_uid; in ufs_getattr()
1941 vap->va_gid = ip->i_gid; in ufs_getattr()
1942 vap->va_fsid = ip->i_dev; in ufs_getattr()
1943 vap->va_nodeid = (ino64_t)ip->i_number; in ufs_getattr()
1944 vap->va_nlink = ip->i_nlink; in ufs_getattr()
1945 vap->va_size = ip->i_size; in ufs_getattr()
1947 vap->va_rdev = ip->i_rdev; in ufs_getattr()
1950 mutex_enter(&ip->i_tlock); in ufs_getattr()
1951 ITIMES_NOLOCK(ip); /* mark correct time in inode */ in ufs_getattr()
1952 vap->va_seq = ip->i_seq; in ufs_getattr()
1953 vap->va_atime.tv_sec = (time_t)ip->i_atime.tv_sec; in ufs_getattr()
1954 vap->va_atime.tv_nsec = ip->i_atime.tv_usec*1000; in ufs_getattr()
1955 vap->va_mtime.tv_sec = (time_t)ip->i_mtime.tv_sec; in ufs_getattr()
1956 vap->va_mtime.tv_nsec = ip->i_mtime.tv_usec*1000; in ufs_getattr()
1957 vap->va_ctime.tv_sec = (time_t)ip->i_ctime.tv_sec; in ufs_getattr()
1958 vap->va_ctime.tv_nsec = ip->i_ctime.tv_usec*1000; in ufs_getattr()
1959 mutex_exit(&ip->i_tlock); in ufs_getattr()
1961 switch (ip->i_mode & IFMT) { in ufs_getattr()
1972 vap->va_blksize = ip->i_fs->fs_bsize; in ufs_getattr()
1975 vap->va_nblocks = (fsblkcnt64_t)ip->i_blocks; in ufs_getattr()
1976 rw_exit(&ip->i_contents); in ufs_getattr()
1991 struct inode *ip = vip; in ufs_priv_access() local
1993 return (ufs_iaccess(ip, mode, cr, 0)); in ufs_priv_access()
2001 struct inode *ip = VTOI(vp); in ufs_setattr() local
2002 struct ufsvfs *ufsvfsp = ip->i_ufsvfs; in ufs_setattr()
2059 ufs_tryirwlock(&ip->i_rwlock, RW_WRITER, retry_file); in ufs_setattr()
2072 rw_enter(&ip->i_contents, RW_WRITER); in ufs_setattr()
2077 if (error = ufs_iaccess(ip, IWRITE, cr, 0)) in ufs_setattr()
2080 rw_exit(&ip->i_contents); in ufs_setattr()
2081 error = TRANS_ITRUNC(ip, vap->va_size, 0, cr); in ufs_setattr()
2083 rw_enter(&ip->i_contents, RW_WRITER); in ufs_setattr()
2092 trans_size = (int)TOP_SETATTR_SIZE(ip); in ufs_setattr()
2103 ufs_tryirwlock_trans(&ip->i_rwlock, RW_WRITER, TOP_SETATTR, in ufs_setattr()
2117 rw_enter(&ip->i_contents, RW_WRITER); in ufs_setattr()
2119 oldva.va_mode = ip->i_mode; in ufs_setattr()
2120 oldva.va_uid = ip->i_uid; in ufs_setattr()
2121 oldva.va_gid = ip->i_gid; in ufs_setattr()
2126 ufs_priv_access, ip); in ufs_setattr()
2136 ip->i_mode = (ip->i_mode & IFMT) | (vap->va_mode & ~IFMT); in ufs_setattr()
2137 TRANS_INODE(ufsvfsp, ip); in ufs_setattr()
2138 ip->i_flag |= ICHG; in ufs_setattr()
2141 if ((ip->i_mode & (ISVTX | IEXEC | IFDIR)) == ISVTX) in ufs_setattr()
2153 if (ufsvfsp->vfs_qinod == ip) { in ufs_setattr()
2162 if (ip->i_uid == vap->va_uid) { in ufs_setattr()
2171 blocks = ip->i_blocks; in ufs_setattr()
2174 (void) chkdq(ip, -blocks, /* force */ 1, cr, in ufs_setattr()
2176 (void) chkiq(ufsvfsp, /* change */ -1, ip, in ufs_setattr()
2177 (uid_t)ip->i_uid, /* force */ 1, cr, in ufs_setattr()
2179 dqrele(ip->i_dquot); in ufs_setattr()
2182 ip->i_uid = vap->va_uid; in ufs_setattr()
2192 ip->i_dquot = getinoquota(ip); in ufs_setattr()
2193 (void) chkdq(ip, blocks, /* force */ 1, cr, in ufs_setattr()
2196 (struct inode *)NULL, (uid_t)ip->i_uid, in ufs_setattr()
2201 ip->i_gid = vap->va_gid; in ufs_setattr()
2203 TRANS_INODE(ufsvfsp, ip); in ufs_setattr()
2204 ip->i_flag |= ICHG; in ufs_setattr()
2226 ip->i_atime.tv_sec = vap->va_atime.tv_sec; in ufs_setattr()
2227 ip->i_atime.tv_usec = vap->va_atime.tv_nsec / 1000; in ufs_setattr()
2228 ip->i_flag &= ~IACC; in ufs_setattr()
2231 ip->i_mtime.tv_sec = vap->va_mtime.tv_sec; in ufs_setattr()
2232 ip->i_mtime.tv_usec = vap->va_mtime.tv_nsec / 1000; in ufs_setattr()
2238 ip->i_ctime.tv_sec = TIME32_MAX; in ufs_setattr()
2239 ip->i_ctime.tv_usec = 0; in ufs_setattr()
2241 ip->i_ctime.tv_sec = now.tv_sec; in ufs_setattr()
2242 ip->i_ctime.tv_usec = now.tv_nsec / 1000; in ufs_setattr()
2244 ip->i_flag &= ~(IUPD|ICHG); in ufs_setattr()
2245 ip->i_flag |= IMODTIME; in ufs_setattr()
2247 TRANS_INODE(ufsvfsp, ip); in ufs_setattr()
2248 ip->i_flag |= IMOD; in ufs_setattr()
2258 if (ip->i_shadow) { in ufs_setattr()
2266 ip->i_flag |= IQUIET; in ufs_setattr()
2267 error = ufs_acl_setattr(ip, vap, cr); in ufs_setattr()
2268 ip->i_flag &= ~IQUIET; in ufs_setattr()
2275 ip->i_seq++; in ufs_setattr()
2281 ufs_iupdat(ip, 1); in ufs_setattr()
2283 ITIMES_NOLOCK(ip); in ufs_setattr()
2286 rw_exit(&ip->i_contents); in ufs_setattr()
2291 rw_exit(&ip->i_rwlock); in ufs_setattr()
2333 struct inode *ip = VTOI(vp); in ufs_access() local
2335 if (ip->i_ufsvfs == NULL) in ufs_access()
2349 return (ufs_iaccess(ip, mode, cr, 1)); in ufs_access()
2357 struct inode *ip = VTOI(vp); in ufs_readlink() local
2372 if (ip->i_size == 0) { in ufs_readlink()
2377 ufsvfsp = ip->i_ufsvfs; in ufs_readlink()
2386 if (ip->i_flag & IFASTSYMLNK) { in ufs_readlink()
2387 rw_enter(&ip->i_rwlock, RW_READER); in ufs_readlink()
2388 rw_enter(&ip->i_contents, RW_READER); in ufs_readlink()
2389 if (ip->i_flag & IFASTSYMLNK) { in ufs_readlink()
2390 if (!ULOCKFS_IS_NOIACC(ITOUL(ip)) && in ufs_readlink()
2391 (ip->i_fs->fs_ronly == 0) && in ufs_readlink()
2393 mutex_enter(&ip->i_tlock); in ufs_readlink()
2394 ip->i_flag |= IACC; in ufs_readlink()
2395 mutex_exit(&ip->i_tlock); in ufs_readlink()
2397 error = uiomove((caddr_t)&ip->i_db[1], in ufs_readlink()
2398 MIN(ip->i_size, uiop->uio_resid), in ufs_readlink()
2400 ITIMES(ip); in ufs_readlink()
2403 rw_exit(&ip->i_contents); in ufs_readlink()
2404 rw_exit(&ip->i_rwlock); in ufs_readlink()
2417 ino = ip->i_number; in ufs_readlink()
2418 igen = ip->i_gen; in ufs_readlink()
2423 rw_enter(&ip->i_rwlock, RW_WRITER); in ufs_readlink()
2424 rw_enter(&ip->i_contents, RW_WRITER); in ufs_readlink()
2425 if (ip->i_flag & IFASTSYMLNK) { in ufs_readlink()
2426 rw_exit(&ip->i_contents); in ufs_readlink()
2427 rw_exit(&ip->i_rwlock); in ufs_readlink()
2432 if (ip->i_size <= FSL_SIZE && in ufs_readlink()
2442 size = ip->i_size; in ufs_readlink()
2459 error = rdip(ip, tuiop, 0, cr); in ufs_readlink()
2460 if (!(error == 0 && ip->i_number == ino && ip->i_gen == igen)) { in ufs_readlink()
2461 rw_exit(&ip->i_contents); in ufs_readlink()
2462 rw_exit(&ip->i_rwlock); in ufs_readlink()
2469 if ((tflag == 0 && ip->i_size <= FSL_SIZE && in ufs_readlink()
2470 ip->i_size == size) || (tflag == 1 && in ufs_readlink()
2472 error = kcopy(basep, &ip->i_db[1], ip->i_size); in ufs_readlink()
2474 ip->i_flag |= IFASTSYMLNK; in ufs_readlink()
2478 (void) VOP_PUTPAGE(ITOV(ip), in ufs_readlink()
2486 ip->i_db[i] = 0; in ufs_readlink()
2488 ip->i_ib[i] = 0; in ufs_readlink()
2497 rw_exit(&ip->i_contents); in ufs_readlink()
2498 rw_exit(&ip->i_rwlock); in ufs_readlink()
2512 struct inode *ip = VTOI(vp); in ufs_fsync() local
2513 struct ufsvfs *ufsvfsp = ip->i_ufsvfs; in ufs_fsync()
2540 ((ip->i_flag & (IMOD|IMODACC)) == IMODACC)) { in ufs_fsync()
2545 rw_enter(&ip->i_contents, RW_READER); in ufs_fsync()
2546 mutex_enter(&ip->i_tlock); in ufs_fsync()
2547 ip->i_flag &= ~IMODTIME; in ufs_fsync()
2548 mutex_exit(&ip->i_tlock); in ufs_fsync()
2549 ufs_iupdat(ip, I_SYNC); in ufs_fsync()
2550 rw_exit(&ip->i_contents); in ufs_fsync()
2580 TRANS_IUPDAT(ip, 1); in ufs_fsync()
2584 error = TRANS_SYNCIP(ip, 0, I_DSYNC, TOP_FSYNC); in ufs_fsync()
2587 error = TRANS_SYNCIP(ip, 0, I_SYNC, TOP_FSYNC); in ufs_fsync()
2589 rw_enter(&ip->i_contents, RW_WRITER); in ufs_fsync()
2591 error = ufs_sync_indir(ip); in ufs_fsync()
2592 rw_exit(&ip->i_contents); in ufs_fsync()
2618 struct inode *ip; in ufs_lookup() local
2630 ip = VTOI(dvp); in ufs_lookup()
2638 if (!(ip->i_ufsvfs->vfs_vfs->vfs_flag & VFS_XATTR)) in ufs_lookup()
2644 if ((ip->i_cflags & IXATTR)) { in ufs_lookup()
2700 if ((error = ufs_iaccess(ip, IEXEC, cr, 1)) == 0) { in ufs_lookup()
2714 if ((error = ufs_iaccess(ip, IEXEC, cr, 1)) != 0) { in ufs_lookup()
2744 if (error = ufs_diraccess(ip, IEXEC, cr)) in ufs_lookup()
2747 ufsvfsp = ip->i_ufsvfs; in ufs_lookup()
2752 error = ufs_dirlook(ip, nm, &xip, cr, 1, 0); in ufs_lookup()
2756 ip = xip; in ufs_lookup()
2757 *vpp = ITOV(ip); in ufs_lookup()
2772 } else if (ip->i_cflags & ICOMPRESS) { in ufs_lookup()
2803 struct inode *ip; in ufs_create() local
2819 ip = VTOI(dvp); in ufs_create()
2820 ufsvfsp = ip->i_ufsvfs; in ufs_create()
2828 trans_size = (int)TOP_CREATE_SIZE(ip); in ufs_create()
2845 rw_enter(&ip->i_contents, RW_WRITER); in ufs_create()
2855 ufs_tryirwlock_trans(&ip->i_rwlock, RW_WRITER, TOP_CREATE, in ufs_create()
2867 rw_exit(&ip->i_rwlock); in ufs_create()
2868 if (error = ufs_iaccess(ip, IEXEC, cr, 1)) { in ufs_create()
2878 error = ufs_direnter_cm(ip, name, DE_CREATE, in ufs_create()
2888 rw_exit(&ip->i_rwlock); in ufs_create()
2890 ip = xip; in ufs_create()
2891 if (ip != NULL) { in ufs_create()
2893 rw_enter(&ip->i_contents, RW_WRITER); in ufs_create()
2906 if ((((ip->i_mode & IFMT) == IFDIR) || in ufs_create()
2907 ((ip->i_mode & IFMT) == IFATTRDIR)) && in ufs_create()
2911 error = ufs_iaccess(ip, mode, cr, 0); in ufs_create()
2916 rw_exit(&ip->i_contents); in ufs_create()
2918 VN_RELE(ITOV(ip)); in ufs_create()
2934 if (ip != dip) in ufs_create()
2937 ip->i_seq++; in ufs_create()
2939 if (((ip->i_mode & IFMT) == IFREG) && in ufs_create()
2948 if (ip->i_size == 0) { in ufs_create()
2949 ip->i_flag |= ICHG | IUPD; in ufs_create()
2950 ip->i_seq++; in ufs_create()
2951 TRANS_INODE(ufsvfsp, ip); in ufs_create()
2962 ((ip->i_mode & IFMT) == IFREG) && in ufs_create()
2963 (ip->i_size > (offset_t)MAXOFF32_T)) { in ufs_create()
2964 rw_exit(&ip->i_contents); in ufs_create()
2972 rw_exit(&ip->i_contents); in ufs_create()
2974 ufs_tryirwlock_trans(&ip->i_rwlock, in ufs_create()
2978 VN_RELE(ITOV(ip)); in ufs_create()
2983 rw_enter(&ip->i_contents, RW_WRITER); in ufs_create()
2984 (void) ufs_itrunc(ip, (u_offset_t)0, 0, in ufs_create()
2986 rw_exit(&ip->i_rwlock); in ufs_create()
2991 vnevent_create(ITOV(ip), ct); in ufs_create()
2997 if (ip != NULL) { in ufs_create()
2999 rw_exit(&ip->i_contents); in ufs_create()
3004 *vpp = ITOV(ip); in ufs_create()
3005 ITIMES(ip); in ufs_create()
3006 rw_exit(&ip->i_contents); in ufs_create()
3054 ufs_tryirwlock(&ip->i_rwlock, RW_WRITER, retry_trunc); in ufs_create()
3058 VN_RELE(ITOV(ip)); in ufs_create()
3061 (void) TRANS_ITRUNC(ip, (u_offset_t)0, 0, cr); in ufs_create()
3062 rw_exit(&ip->i_rwlock); in ufs_create()
3088 struct inode *ip = VTOI(vp); in ufs_remove() local
3089 struct ufsvfs *ufsvfsp = ip->i_ufsvfs; in ufs_remove()
3129 ufs_tryirwlock_trans(&ip->i_rwlock, RW_WRITER, TOP_REMOVE, retry); in ufs_remove()
3132 error = ufs_dirremove(ip, nm, (struct inode *)0, (struct vnode *)0, in ufs_remove()
3134 rw_exit(&ip->i_rwlock); in ufs_remove()
3251 struct inode *ip = NULL; /* check inode */ in ufs_rename() local
3553 &ip, cr, 0); in ufs_rename()
3559 if (ip == NULL) { in ufs_rename()
3568 VN_RELE(ITOV(ip)); in ufs_rename()
3650 struct inode *ip; in ufs_mkdir() local
3669 ip = VTOI(dvp); in ufs_mkdir()
3670 ufsvfsp = ip->i_ufsvfs; in ufs_mkdir()
3676 trans_size = (int)TOP_MKDIR_SIZE(ip)); in ufs_mkdir()
3683 ufs_tryirwlock_trans(&ip->i_rwlock, RW_WRITER, TOP_MKDIR, retry); in ufs_mkdir()
3687 error = ufs_direnter_cm(ip, dirname, DE_MKDIR, vap, &xip, cr, in ufs_mkdir()
3698 rw_exit(&ip->i_rwlock); in ufs_mkdir()
3700 ip = xip; in ufs_mkdir()
3701 *vpp = ITOV(ip); in ufs_mkdir()
3727 struct inode *ip = VTOI(vp); in ufs_rmdir() local
3728 struct ufsvfs *ufsvfsp = ip->i_ufsvfs; in ufs_rmdir()
3768 ufs_tryirwlock_trans(&ip->i_rwlock, RW_WRITER, TOP_RMDIR, retry); in ufs_rmdir()
3771 error = ufs_dirremove(ip, nm, (struct inode *)0, cdir, DR_RMDIR, cr); in ufs_rmdir()
3773 rw_exit(&ip->i_rwlock); in ufs_rmdir()
3791 struct inode *ip; in ufs_readdir() local
3805 ip = VTOI(vp); in ufs_readdir()
3806 ASSERT(RW_READ_HELD(&ip->i_rwlock)); in ufs_readdir()
3829 ufsvfsp = ip->i_ufsvfs; in ufs_readdir()
3839 ASSERT(ip->i_size <= MAXOFF32_T); in ufs_readdir()
3845 if (offset >= (uint_t)ip->i_size || ip->i_nlink <= 0) { in ufs_readdir()
3870 if (offset + bytes_wanted > (int)ip->i_size) in ufs_readdir()
3871 bytes_wanted = (int)(ip->i_size - offset); in ufs_readdir()
3885 if (!ULOCKFS_IS_NOIACC(ITOUL(ip)) && (ip->i_fs->fs_ronly == 0) && in ufs_readdir()
3887 ip->i_flag |= IACC; in ufs_readdir()
3894 (u_longlong_t)ip->i_number, ufsvfsp->vfs_fs->fs_fsmnt); in ufs_readdir()
3962 if (offset < (int)ip->i_size && !outcount) in ufs_readdir()
3975 ITIMES(ip); in ufs_readdir()
3980 *eofp = (uiop->uio_offset >= (int)ip->i_size); in ufs_readdir()
3994 struct inode *ip, *dip = VTOI(dvp); in ufs_symlink() local
4011 ip = (struct inode *)NULL; in ufs_symlink()
4040 error = ufs_dirmakeinode(dip, &ip, vap, DE_SYMLINK, cr); in ufs_symlink()
4071 rw_enter(&ip->i_contents, RW_WRITER); in ufs_symlink()
4077 ip->i_flag |= IQUIET; in ufs_symlink()
4079 error = ufs_rdwri(UIO_WRITE, ioflag, ip, target, strlen(target), in ufs_symlink()
4082 ip->i_flag &= ~IQUIET; in ufs_symlink()
4085 rw_exit(&ip->i_contents); in ufs_symlink()
4099 ASSERT(MAXPATHLEN <= VBSIZE(ITOV(ip))); in ufs_symlink()
4101 if (ip->i_size > 0 && ip->i_size <= FSL_SIZE) { in ufs_symlink()
4102 if (kcopy(target, &ip->i_db[1], ip->i_size) == 0) { in ufs_symlink()
4103 ip->i_flag |= IFASTSYMLNK; in ufs_symlink()
4108 ip->i_db[i] = 0; in ufs_symlink()
4110 ip->i_ib[i] = 0; in ufs_symlink()
4114 rw_exit(&ip->i_contents); in ufs_symlink()
4123 error = ufs_direnter_lr(dip, linkname, DE_SYMLINK, NULL, ip, cr); in ufs_symlink()
4132 if (error && (ip != NULL)) { in ufs_symlink()
4133 rw_enter(&ip->i_contents, RW_WRITER); in ufs_symlink()
4134 ip->i_nlink--; in ufs_symlink()
4135 ip->i_flag |= ICHG; in ufs_symlink()
4136 ip->i_seq++; in ufs_symlink()
4137 ufs_setreclaim(ip); in ufs_symlink()
4138 rw_exit(&ip->i_contents); in ufs_symlink()
4142 if (ip != NULL) in ufs_symlink()
4143 VN_RELE(ITOV(ip)); in ufs_symlink()
4174 ufs_rdwri(enum uio_rw rw, int ioflag, struct inode *ip, caddr_t base, in ufs_rdwri() argument
4182 ASSERT(RW_LOCK_HELD(&ip->i_contents)); in ufs_rdwri()
4199 error = wrip(ip, &auio, ioflag, cr); in ufs_rdwri()
4204 error = rdip(ip, &auio, ioflag, cr); in ufs_rdwri()
4220 struct inode *ip = VTOI(vp); in ufs_fid() local
4222 if (ip->i_ufsvfs == NULL) in ufs_fid()
4233 ufid->ufid_ino = ip->i_number; in ufs_fid()
4234 ufid->ufid_gen = ip->i_gen; in ufs_fid()
4243 struct inode *ip = VTOI(vp); in ufs_rwlock() local
4251 rw_enter(&ip->i_rwlock, RW_READER); in ufs_rwlock()
4267 ufsvfsp = ip->i_ufsvfs; in ufs_rwlock()
4269 if (!(ip->i_flag & IDIRECTIO || forcedirectio) || in ufs_rwlock()
4271 rw_enter(&ip->i_rwlock, RW_WRITER); in ufs_rwlock()
4278 if (MANDLOCK(vp, ip->i_mode)) { in ufs_rwlock()
4279 rw_enter(&ip->i_rwlock, RW_WRITER); in ufs_rwlock()
4288 rw_enter(&ip->i_rwlock, RW_READER); in ufs_rwlock()
4289 if (MANDLOCK(vp, ip->i_mode)) { in ufs_rwlock()
4290 rw_exit(&ip->i_rwlock); in ufs_rwlock()
4291 rw_enter(&ip->i_rwlock, RW_WRITER); in ufs_rwlock()
4301 struct inode *ip = VTOI(vp); in ufs_rwunlock() local
4303 rw_exit(&ip->i_rwlock); in ufs_rwunlock()
4319 struct inode *ip = VTOI(vp); in ufs_frlock() local
4321 if (ip->i_ufsvfs == NULL) in ufs_frlock()
4331 if (ip->i_mapcnt > 0 && MANDLOCK(vp, ip->i_mode)) in ufs_frlock()
4375 #define CLUSTSZ(ip) ((ip)->i_ufsvfs->vfs_ioclustsz) argument
4407 struct inode *ip = VTOI(vp); in ufs_getpage() local
4408 struct ufsvfs *ufsvfsp = ip->i_ufsvfs; in ufs_getpage()
4445 trans_size = TOP_GETPAGE_SIZE(ip); in ufs_getpage()
4468 seqmode = ip->i_nextr == uoff && rw != S_CREATE; in ufs_getpage()
4471 dolock = (rw_owner(&ip->i_contents) != curthread); in ufs_getpage()
4487 rw_enter(&ip->i_contents, rwtype); in ufs_getpage()
4503 P2ROUNDUP_TYPED(ip->i_size, PAGESIZE, u_offset_t); in ufs_getpage()
4506 rw_exit(&ip->i_contents); in ufs_getpage()
4521 has_holes = bmap_has_holes(ip); in ufs_getpage()
4543 rw_exit(&ip->i_contents); in ufs_getpage()
4546 if (!rw_tryupgrade(&ip->i_contents)) { in ufs_getpage()
4547 rw_exit(&ip->i_contents); in ufs_getpage()
4569 blk_size = (int)blksize(fs, ip, lblkno(fs, offset)); in ufs_getpage()
4570 err = bmap_write(ip, offset, blk_size, in ufs_getpage()
4572 if (ip->i_flag & (ICHG|IUPD)) in ufs_getpage()
4573 ip->i_seq++; in ufs_getpage()
4584 rw_downgrade(&ip->i_contents); in ufs_getpage()
4623 ip->i_nextrio = pgoff; in ufs_getpage()
4634 nextrio = ip->i_nextrio; in ufs_getpage()
4636 pgoff + CLUSTSZ(ip) >= nextrio && pgoff <= nextrio && in ufs_getpage()
4637 nextrio < ip->i_size && page_exists(vp, pgoff)) { in ufs_getpage()
4649 ip->i_nextrio = nextrio + pgsize; in ufs_getpage()
4706 ip->i_nextr = pgoff; in ufs_getpage()
4725 if ((ip->i_flag & (IACC | INOACC)) == 0) { in ufs_getpage()
4726 if ((rw != S_OTHER) && (ip->i_mode & IFMT) != IFDIR) { in ufs_getpage()
4727 if (!ULOCKFS_IS_NOIACC(ITOUL(ip)) && in ufs_getpage()
4730 mutex_enter(&ip->i_tlock); in ufs_getpage()
4731 ip->i_flag |= IACC; in ufs_getpage()
4732 ITIMES_NOLOCK(ip); in ufs_getpage()
4733 mutex_exit(&ip->i_tlock); in ufs_getpage()
4739 rw_exit(&ip->i_contents); in ufs_getpage()
4767 struct inode *ip = VTOI(vp); in ufs_getpage_miss() local
4774 int bsize = ip->i_fs->fs_bsize; in ufs_getpage_miss()
4784 if (err = bmap_read(ip, off, &bn, &contig)) in ufs_getpage_miss()
4794 if (ISFALLOCBLK(ip, bn)) in ufs_getpage_miss()
4813 ufsvfs_t *ufsvfsp = ip->i_ufsvfs; in ufs_getpage_miss()
4847 bp = pageio_setup(pp, io_len, ip->i_devvp, B_READ); in ufs_getpage_miss()
4848 bp->b_edev = ip->i_dev; in ufs_getpage_miss()
4849 bp->b_dev = cmpdev(ip->i_dev); in ufs_getpage_miss()
4852 bp->b_file = ip->i_vnode; in ufs_getpage_miss()
4866 ip->i_nextrio = off + ((io_len + PAGESIZE - 1) & PAGEMASK); in ufs_getpage_miss()
4872 if (seq && ip->i_nextrio < ip->i_size) in ufs_getpage_miss()
4893 struct inode *ip = VTOI(vp); in ufs_getpage_ra() local
4895 u_offset_t io_off = ip->i_nextrio; in ufs_getpage_ra()
4904 int bsize = ip->i_fs->fs_bsize; in ufs_getpage_ra()
4912 if ((ufsvfsp = ip->i_ufsvfs) == NULL) in ufs_getpage_ra()
4914 if (ip->i_flag & IDIRECTIO || ufsvfsp->vfs_forcedirectio) in ufs_getpage_ra()
4924 err = bmap_read(ip, io_off, &bn, &contig); in ufs_getpage_ra()
4929 if (err || bn == UFS_HOLE || ISFALLOCBLK(ip, bn)) in ufs_getpage_ra()
4948 ip->i_nextrio = (io_off + io_len + PAGESIZE - 1) & PAGEMASK; in ufs_getpage_ra()
4950 bp = pageio_setup(pp, io_len, ip->i_devvp, B_READ | B_ASYNC); in ufs_getpage_ra()
4951 bp->b_edev = ip->i_dev; in ufs_getpage_ra()
4952 bp->b_dev = cmpdev(ip->i_dev); in ufs_getpage_ra()
4955 bp->b_file = ip->i_vnode; in ufs_getpage_ra()
4985 struct inode *ip = VTOI(vp); in ufs_putpage() local
5000 if (ip->i_ufsvfs == NULL) { in ufs_putpage()
5008 mutex_enter(&ip->i_tlock); in ufs_putpage()
5012 if (ip->i_delaylen == 0) { in ufs_putpage()
5013 ip->i_delayoff = off; in ufs_putpage()
5014 ip->i_delaylen = len; in ufs_putpage()
5015 mutex_exit(&ip->i_tlock); in ufs_putpage()
5022 if (ip->i_delaylen >= CLUSTSZ(ip) || in ufs_putpage()
5023 ip->i_delayoff + ip->i_delaylen != off) { in ufs_putpage()
5027 doff = ip->i_delayoff; in ufs_putpage()
5028 dlen = ip->i_delaylen; in ufs_putpage()
5029 ip->i_delayoff = off; in ufs_putpage()
5030 ip->i_delaylen = len; in ufs_putpage()
5031 mutex_exit(&ip->i_tlock); in ufs_putpage()
5041 ip->i_delaylen += len; in ufs_putpage()
5042 mutex_exit(&ip->i_tlock); in ufs_putpage()
5070 struct inode *ip = VTOI(vp); in ufs_putpages() local
5084 mutex_enter(&ip->i_tlock); in ufs_putpages()
5085 ip->i_delayoff = ip->i_delaylen = 0; in ufs_putpages()
5086 mutex_exit(&ip->i_tlock); in ufs_putpages()
5088 dolock = (rw_owner(&ip->i_contents) != curthread); in ufs_putpages()
5102 if (ip->i_writer == curthread) in ufs_putpages()
5103 rw_enter(&ip->i_contents, RW_READER); in ufs_putpages()
5106 rw_enter(&ip->i_contents, RW_READER); in ufs_putpages()
5107 mutex_enter(&ip->i_tlock); in ufs_putpages()
5113 if (ip->i_writer == NULL) { in ufs_putpages()
5114 mutex_exit(&ip->i_tlock); in ufs_putpages()
5117 rw_exit(&ip->i_contents); in ufs_putpages()
5124 mutex_exit(&ip->i_tlock); in ufs_putpages()
5127 cv_wait(&ip->i_wrcv, &ip->i_tlock); in ufs_putpages()
5128 mutex_exit(&ip->i_tlock); in ufs_putpages()
5135 rw_exit(&ip->i_contents); in ufs_putpages()
5150 if ((eoff = blkroundup(ip->i_fs, ip->i_size)) != 0) in ufs_putpages()
5190 if (err == 0 && off == 0 && (len == 0 || len >= ip->i_size)) { in ufs_putpages()
5195 mutex_enter(&ip->i_tlock); in ufs_putpages()
5196 ip->i_flag &= ~IMODTIME; in ufs_putpages()
5197 mutex_exit(&ip->i_tlock); in ufs_putpages()
5200 rw_exit(&ip->i_contents); in ufs_putpages()
5207 struct inode *ip; in ufs_iodone() local
5213 ip = VTOI(bp->b_pages->p_vnode); in ufs_iodone()
5215 mutex_enter(&ip->i_tlock); in ufs_iodone()
5216 if (ip->i_writes >= ufs_LW) { in ufs_iodone()
5217 if ((ip->i_writes -= bp->b_bcount) <= ufs_LW) in ufs_iodone()
5219 cv_broadcast(&ip->i_wrcv); /* wake all up */ in ufs_iodone()
5221 ip->i_writes -= bp->b_bcount; in ufs_iodone()
5224 mutex_exit(&ip->i_tlock); in ufs_iodone()
5242 struct inode *ip = VTOI(vp); in ufs_putapage() local
5243 struct ufsvfs *ufsvfsp = ip->i_ufsvfs; in ufs_putapage()
5252 ASSERT(RW_LOCK_HELD(&ip->i_contents)); in ufs_putapage()
5259 fs = ip->i_fs; in ufs_putapage()
5268 if ((ip->i_flag & IMODTIME) == 0) { in ufs_putapage()
5269 mutex_enter(&ip->i_tlock); in ufs_putapage()
5270 ip->i_flag |= IUPD; in ufs_putapage()
5271 ip->i_seq++; in ufs_putapage()
5272 ITIMES_NOLOCK(ip); in ufs_putapage()
5273 mutex_exit(&ip->i_tlock); in ufs_putapage()
5282 err = bmap_read(ip, off, &bn, &contig); in ufs_putapage()
5300 if (ip->i_writer == curthread) { in ufs_putapage()
5312 err = ufs_fault(ITOV(ip), "ufs_putapage: bn == UFS_HOLE"); in ufs_putapage()
5320 if (ISFALLOCBLK(ip, bn)) { in ufs_putapage()
5363 (u_offset_t)(roundup(ip->i_size, PAGESIZE))); in ufs_putapage()
5367 bp = pageio_setup(pp, io_len, ip->i_devvp, B_WRITE | flags); in ufs_putapage()
5369 ULOCKFS_SET_MOD(ITOUL(ip)); in ufs_putapage()
5371 bp->b_edev = ip->i_dev; in ufs_putapage()
5372 bp->b_dev = cmpdev(ip->i_dev); in ufs_putapage()
5375 bp->b_file = ip->i_vnode; in ufs_putapage()
5394 (((ip->i_mode & IFMT) == IFSHAD || ufsvfsp->vfs_qinod == ip) && in ufs_putapage()
5400 TRANS_BEGIN_ASYNC(ufsvfsp, TOP_PUTPAGE, TOP_PUTPAGE_SIZE(ip)); in ufs_putapage()
5403 if ((ip->i_mode & IFMT) == IFSHAD) { in ufs_putapage()
5405 } else if (ufsvfsp->vfs_qinod == ip) { in ufs_putapage()
5411 TRANS_END_ASYNC(ufsvfsp, TOP_PUTPAGE, TOP_PUTPAGE_SIZE(ip)); in ufs_putapage()
5419 mutex_enter(&ip->i_tlock); in ufs_putapage()
5420 ip->i_writes += bp->b_bcount; in ufs_putapage()
5421 mutex_exit(&ip->i_tlock); in ufs_putapage()
5591 struct inode *ip = VTOI(vp); in ufs_addmap() local
5597 mutex_enter(&ip->i_tlock); in ufs_addmap()
5598 ip->i_mapcnt += btopr(len); in ufs_addmap()
5599 mutex_exit(&ip->i_tlock); in ufs_addmap()
5609 struct inode *ip = VTOI(vp); in ufs_delmap() local
5615 mutex_enter(&ip->i_tlock); in ufs_delmap()
5616 ip->i_mapcnt -= btopr(len); /* Count released mappings */ in ufs_delmap()
5617 ASSERT(ip->i_mapcnt >= 0); in ufs_delmap()
5618 mutex_exit(&ip->i_tlock); in ufs_delmap()
5691 struct inode *ip = VTOI(vp); in ufs_l_pathconf() local
5737 rw_enter(&ip->i_contents, RW_WRITER); in ufs_l_pathconf()
5738 ufs_unhook_shadow(ip, sip); in ufs_l_pathconf()
5739 rw_exit(&ip->i_contents); in ufs_l_pathconf()
5766 *valp = (ulong_t)ip->i_fs->fs_bsize; in ufs_l_pathconf()
5801 struct inode *ip = VTOI(vp); in ufs_pageio() local
5818 dolock = (rw_owner(&ip->i_contents) != curthread); in ufs_pageio()
5825 if ((ufsvfsp = ip->i_ufsvfs) == NULL) in ufs_pageio()
5873 rw_enter(&ip->i_contents, RW_READER); in ufs_pageio()
5874 } else if (!rw_tryenter(&ip->i_contents, RW_READER)) { in ufs_pageio()
5885 if (vmpss && btopr(io_off + io_len) > btopr(ip->i_size)) { in ufs_pageio()
5887 rw_exit(&ip->i_contents); in ufs_pageio()
5894 if (bmap_has_holes(ip)) { in ufs_pageio()
5900 rw_exit(&ip->i_contents); in ufs_pageio()
5913 if (err = bmap_read(ip, (u_offset_t)(io_off + done_len), in ufs_pageio()
5922 err = ufs_fault(ITOV(ip), "ufs_pageio: bn == UFS_HOLE"); in ufs_pageio()
5939 bp = pageio_setup(cpp, cur_len, ip->i_devvp, flags); in ufs_pageio()
5942 bp->b_edev = ip->i_dev; in ufs_pageio()
5943 bp->b_dev = cmpdev(ip->i_dev); in ufs_pageio()
5946 bp->b_file = ip->i_vnode; in ufs_pageio()
5998 if (vmpss && !(ip->i_flag & IACC) && !ULOCKFS_IS_NOIACC(ulp) && in ufs_pageio()
6000 mutex_enter(&ip->i_tlock); in ufs_pageio()
6001 ip->i_flag |= IACC; in ufs_pageio()
6002 ITIMES_NOLOCK(ip); in ufs_pageio()
6003 mutex_exit(&ip->i_tlock); in ufs_pageio()
6007 rw_exit(&ip->i_contents); in ufs_pageio()
6024 struct inode *ip = VTOI(vp); in ufs_dump() local
6025 struct fs *fs = ip->i_fs; in ufs_dump()
6034 if (ip->i_ufsvfs == NULL) in ufs_dump()
6040 mutex_enter(&ip->i_tlock); in ufs_dump()
6042 (dump_info->ip != ip) || in ufs_dump()
6043 (dump_info->time.tv_sec != ip->i_mtime.tv_sec) || in ufs_dump()
6044 (dump_info->time.tv_usec != ip->i_mtime.tv_usec)) { in ufs_dump()
6045 mutex_exit(&ip->i_tlock); in ufs_dump()
6048 mutex_exit(&ip->i_tlock); in ufs_dump()
6053 UFS_GET_ISIZE(&file_size, ip); in ufs_dump()
6075 error = bdev_dump(ip->i_dev, addr, dbn, ndbs); in ufs_dump()
6103 struct inode *ip = VTOI(vp); in ufs_dumpctl() local
6104 ufsvfs_t *ufsvfsp = ip->i_ufsvfs; in ufs_dumpctl()
6128 rw_enter(&ip->i_contents, RW_READER); in ufs_dumpctl()
6130 if (bmap_has_holes(ip)) { in ufs_dumpctl()
6131 rw_exit(&ip->i_contents); in ufs_dumpctl()
6138 entries = (int)lblkno(fs, blkroundup(fs, ip->i_size)); in ufs_dumpctl()
6142 rw_exit(&ip->i_contents); in ufs_dumpctl()
6148 dump_info->ip = ip; in ufs_dumpctl()
6153 *storeblk++ = ip->i_db[entry]; in ufs_dumpctl()
6160 ip->i_dev, fsbtodb(fs, ip->i_ib[i]), fs->fs_bsize); in ufs_dumpctl()
6165 if ((storeblk = save_dblks(ip, ufsvfsp, in ufs_dumpctl()
6175 rw_exit(&ip->i_contents); in ufs_dumpctl()
6181 mutex_enter(&ip->i_tlock); in ufs_dumpctl()
6182 dump_info->time = ip->i_mtime; in ufs_dumpctl()
6183 mutex_exit(&ip->i_tlock); in ufs_dumpctl()
6185 rw_exit(&ip->i_contents); in ufs_dumpctl()
6243 save_dblks(struct inode *ip, struct ufsvfs *ufsvfsp, daddr32_t *storeblk, in save_dblks() argument
6262 ip->i_dev, fsbtodb(fs, dblk[i]), fs->fs_bsize); in save_dblks()
6267 storeblk = save_dblks(ip, ufsvfsp, storeblk, bp->b_un.b_daddr, in save_dblks()
6282 struct inode *ip = VTOI(vp); in ufs_getsecattr() local
6284 struct ufsvfs *ufsvfsp = ip->i_ufsvfs; in ufs_getsecattr()
6299 rw_enter(&ip->i_contents, RW_READER); in ufs_getsecattr()
6300 err = ufs_acl_get(ip, vsap, flag, cr); in ufs_getsecattr()
6301 rw_exit(&ip->i_contents); in ufs_getsecattr()
6314 struct inode *ip = VTOI(vp); in ufs_setsecattr() local
6324 ASSERT(RW_LOCK_HELD(&ip->i_rwlock)); in ufs_setsecattr()
6343 rw_exit(&ip->i_rwlock); in ufs_setsecattr()
6347 if (!rw_write_held(&ip->i_rwlock)) { in ufs_setsecattr()
6348 rw_exit(&ip->i_rwlock); in ufs_setsecattr()
6349 rw_enter(&ip->i_rwlock, RW_WRITER); in ufs_setsecattr()
6382 rw_enter(&ip->i_rwlock, RW_WRITER); in ufs_setsecattr()
6389 rw_enter(&ip->i_contents, RW_WRITER); in ufs_setsecattr()
6394 ip->i_flag |= IQUIET; in ufs_setsecattr()
6395 err = ufs_acl_set(ip, vsap, flag, cr); in ufs_setsecattr()
6396 ip->i_flag &= ~IQUIET; in ufs_setsecattr()
6397 rw_exit(&ip->i_contents); in ufs_setsecattr()
6409 rw_exit(&ip->i_rwlock); in ufs_setsecattr()
6425 rw_exit(&ip->i_rwlock); in ufs_setsecattr()
6438 rw_enter(&ip->i_rwlock, RW_READER); in ufs_setsecattr()
6457 struct inode *ip; in ufs_eventlookup() local
6462 ip = VTOI(dvp); in ufs_eventlookup()
6480 if (error = ufs_diraccess(ip, IEXEC|IWRITE, cr)) in ufs_eventlookup()
6505 ufsvfsp = ip->i_ufsvfs; in ufs_eventlookup()
6511 if ((error = ufs_dirlook(ip, nm, &xip, cr, 1, 1)) == 0) { in ufs_eventlookup()