Lines Matching refs:ip

135 	struct ud_inode *ip;
145 for (ip = ih->ih_chain[0];
146 ip != (struct ud_inode *)ih;
147 ip = ip->i_forw) {
148 if ((prn == ip->i_icb_prn) && (ploc == ip->i_icb_block) &&
149 (vfsp->vfs_dev == ip->i_dev)) {
151 return (ip);
166 struct ud_inode *ip;
193 for (ip = ih->ih_chain[0];
194 ip != (struct ud_inode *)ih;
195 ip = ip->i_forw) {
197 if ((prn == ip->i_icb_prn) &&
198 (ploc == ip->i_icb_block) &&
199 (vfsp->vfs_dev == ip->i_dev)) {
201 vp = ITOV(ip);
205 rw_enter(&ip->i_contents, RW_READER);
206 mutex_enter(&ip->i_tlock);
207 if ((ip->i_flag & IREF) == 0) {
209 ud_remove_from_free_list(ip, UD_UNKN);
212 ip->i_flag |= IREF;
213 mutex_exit(&ip->i_tlock);
214 rw_exit(&ip->i_contents);
216 *ipp = ip;
263 ip = udf_ifreeh;
264 vp = ITOV(ip);
266 ud_remove_from_free_list(ip, UD_BEGIN);
269 if (ip->i_flag & IREF) {
277 rw_enter(&ip->i_contents, RW_WRITER);
285 mutex_enter(&ip->i_tlock);
286 ip->i_flag = (ip->i_flag & IMODTIME) | IREF;
287 mutex_exit(&ip->i_tlock);
290 if (ud_syncip(ip, B_INVAL, I_SYNC) != 0) {
291 ud_idrop(ip);
292 rw_exit(&ip->i_contents);
297 mutex_enter(&ip->i_tlock);
298 ip->i_flag &= ~IMODTIME;
299 mutex_exit(&ip->i_tlock);
301 if (ip->i_ext) {
302 kmem_free(ip->i_ext,
303 sizeof (struct icb_ext) * ip->i_ext_count);
304 ip->i_ext = 0;
305 ip->i_ext_count = ip->i_ext_used = 0;
308 if (ip->i_con) {
309 kmem_free(ip->i_con,
310 sizeof (struct icb_ext) * ip->i_con_count);
311 ip->i_con = 0;
312 ip->i_con_count = ip->i_con_used = ip->i_con_read = 0;
331 ip = (struct ud_inode *)kmem_zalloc(sizeof (struct ud_inode),
334 if ((ip == NULL) || (vp == NULL)) {
338 if (ip != NULL)
339 kmem_free(ip, sizeof (struct ud_inode));
346 if (ip == NULL)
347 ip = (struct ud_inode *)
355 ip->i_vnode = vp;
357 ip->i_marker1 = (uint32_t)0xAAAAAAAA;
358 ip->i_marker2 = (uint32_t)0xBBBBBBBB;
359 ip->i_marker3 = (uint32_t)0xCCCCCCCC;
361 rw_init(&ip->i_rwlock, NULL, RW_DEFAULT, NULL);
362 rw_init(&ip->i_contents, NULL, RW_DEFAULT, NULL);
363 mutex_init(&ip->i_tlock, NULL, MUTEX_DEFAULT, NULL);
365 ip->i_forw = ip;
366 ip->i_back = ip;
367 vp->v_data = (caddr_t)ip;
369 ip->i_flag = IREF;
370 cv_init(&ip->i_wrcv, NULL, CV_DRIVER, NULL);
375 rw_enter(&ip->i_contents, RW_WRITER);
381 rw_exit(&ip->i_contents);
390 rw_exit(&ip->i_contents);
400 remque(ip);
401 ip->i_forw = ip;
402 ip->i_back = ip;
403 insque(ip, ih);
405 ip->i_dev = vfsp->vfs_dev;
406 ip->i_udf = udf_vfsp;
407 ip->i_diroff = 0;
408 ip->i_devvp = ip->i_udf->udf_devvp;
409 ip->i_icb_prn = prn;
410 ip->i_icb_block = ploc;
411 ip->i_icb_lbano = loc;
412 ip->i_nextr = 0;
413 ip->i_seq = 0;
424 bp = ud_bread(ip->i_dev,
425 ip->i_icb_lbano << udf_vfsp->udf_l2d_shift,
435 ip->i_icb_block, 1, udf_vfsp->udf_lbsize) != 0)) {
440 bp->b_un.b_addr, ip->i_icb_block) == 0) {
447 ip->i_icb_prn = old_prn;
448 ip->i_icb_block = old_block;
449 ip->i_icb_lbano = old_lbano;
454 bp = ud_bread(ip->i_dev,
461 UD_FILE_ENTRY, ip->i_icb_block, 1,
481 ip->i_icb_lbano = 0;
489 ip->i_icb_prn = 0xffff;
490 ip->i_icb_block = 0;
498 remque(ip);
499 ip->i_forw = ip;
500 ip->i_back = ip;
504 mutex_enter(&ip->i_tlock);
506 ud_add_to_free_list(ip, UD_BEGIN);
508 ip->i_flag = 0;
509 mutex_exit(&ip->i_tlock);
510 rw_exit(&ip->i_contents);
521 old_prn = ip->i_icb_prn;
522 old_block = ip->i_icb_block;
523 old_lbano = ip->i_icb_lbano;
538 ibp = ud_bread(ip->i_dev,
539 (ip->i_icb_lbano + 1) << udf_vfsp->udf_l2d_shift,
553 UD_INDIRECT_ENT, ip->i_icb_block + 1,
558 ip->i_icb_prn = SWAP_16(lad->lad_ext_prn);
559 ip->i_icb_block = SWAP_32(lad->lad_ext_loc);
560 ip->i_icb_lbano = ud_xlate_to_daddr(udf_vfsp,
561 ip->i_icb_prn, ip->i_icb_block,
573 ip->i_icb_block + 1) != 0) {
592 ip->i_uid = SWAP_32(fe->fe_uid);
593 if (ip->i_uid == -1) {
594 ip->i_uid = ud_default_uid;
596 ip->i_gid = SWAP_32(fe->fe_gid);
597 if (ip->i_gid == -1) {
598 ip->i_gid = ud_default_gid;
600 ip->i_perm = SWAP_32(fe->fe_perms) & 0xFFFF;
602 ip->i_perm &= ~(IWRITE | (IWRITE >> 5) | (IWRITE >> 10));
605 ip->i_nlink = SWAP_16(fe->fe_lcount);
606 ip->i_size = SWAP_64(fe->fe_info_len);
607 ip->i_lbr = SWAP_64(fe->fe_lbr);
609 ud_dtime2utime(&ip->i_atime, &fe->fe_acc_time);
610 ud_dtime2utime(&ip->i_mtime, &fe->fe_mod_time);
611 ud_dtime2utime(&ip->i_ctime, &fe->fe_attr_time);
614 ip->i_uniqid = SWAP_64(fe->fe_uniq_id);
624 UD_EXT_ATTR_HDR, ip->i_icb_block, 1,
640 ea_len, ea_off, ip->i_icb_block);
660 ip->i_icb_block);
664 ip->i_major = GET_32(&ds->ds_major_id);
665 ip->i_minor = GET_32(&ds->ds_minor_id);
681 ip->i_icb_block);
709 ip->i_nextr = 0;
711 ip->i_maxent = SWAP_16(fe->fe_icb_tag.itag_max_ent);
712 ip->i_astrat = SWAP_16(fe->fe_icb_tag.itag_strategy);
714 ip->i_desc_type = icb_tag_flags & 0x7;
717 ip->i_ext = NULL;
718 ip->i_ext_count = ip->i_ext_used = 0;
719 ip->i_con = 0;
720 ip->i_con_count = ip->i_con_used = ip->i_con_read = 0;
722 ip->i_data_off = 0xB0 + SWAP_32(fe->fe_len_ear);
723 ip->i_max_emb = udf_vfsp->udf_lbsize - ip->i_data_off;
724 if (ip->i_desc_type == ICB_FLAG_SHORT_AD) {
728 ip->i_ext_used = 0;
729 ip->i_ext_count = ndesc =
731 ip->i_ext_count =
732 ((ip->i_ext_count / EXT_PER_MALLOC) + 1) * EXT_PER_MALLOC;
733 ip->i_ext = (struct icb_ext *)kmem_zalloc(ip->i_ext_count *
735 ip->i_cur_max_ext = ip->i_max_emb / sizeof (struct short_ad);
736 ip->i_cur_max_ext --;
738 if ((ip->i_astrat != STRAT_TYPE4) &&
739 (ip->i_astrat != STRAT_TYPE4096)) {
745 iext = ip->i_ext;
752 if (ip->i_con == NULL) {
753 ip->i_con_count = EXT_PER_MALLOC;
754 ip->i_con_used = 0;
755 ip->i_con_read = 0;
756 ip->i_con = kmem_zalloc(
757 ip->i_con_count *
761 con = &ip->i_con[ip->i_con_used];
766 ip->i_con_used++;
782 ip->i_ext_used++;
786 } else if (ip->i_desc_type == ICB_FLAG_LONG_AD) {
790 ip->i_ext_used = 0;
791 ip->i_ext_count = ndesc =
793 ip->i_ext_count =
794 ((ip->i_ext_count / EXT_PER_MALLOC) + 1) * EXT_PER_MALLOC;
795 ip->i_ext = (struct icb_ext *)kmem_zalloc(ip->i_ext_count *
798 ip->i_cur_max_ext = ip->i_max_emb / sizeof (struct long_ad);
799 ip->i_cur_max_ext --;
801 if ((ip->i_astrat != STRAT_TYPE4) &&
802 (ip->i_astrat != STRAT_TYPE4096)) {
808 iext = ip->i_ext;
815 if (ip->i_con == NULL) {
816 ip->i_con_count = EXT_PER_MALLOC;
817 ip->i_con_used = 0;
818 ip->i_con_read = 0;
819 ip->i_con = kmem_zalloc(
820 ip->i_con_count *
824 con = &ip->i_con[ip->i_con_used];
829 ip->i_con_used++;
844 ip->i_ext_used++;
848 } else if (ip->i_desc_type == ICB_FLAG_ONE_AD) {
857 ip->i_desc_type);
863 ip->i_char = ISUID;
865 ip->i_char = 0;
868 ip->i_char |= ISGID;
871 ip->i_char |= ISVTX;
875 ip->i_type = VDIR;
878 ip->i_type = VREG;
881 ip->i_type = VBLK;
884 ip->i_type = VCHR;
887 ip->i_type = VFIFO;
890 ip->i_type = VSOCK;
893 ip->i_type = VLNK;
896 ip->i_type = VNON;
900 if (ip->i_type == VBLK || ip->i_type == VCHR) {
901 ip->i_rdev = makedevice(ip->i_major, ip->i_minor);
912 vp->v_type = ip->i_type;
913 vp->v_rdev = ip->i_rdev;
914 if (ip->i_udf->udf_root_blkno == loc) {
921 *ipp = ip;
922 rw_exit(&ip->i_contents);
928 ud_iinactive(struct ud_inode *ip, struct cred *cr)
942 rw_enter(&ip->i_contents, RW_WRITER);
957 vp = ITOV(ip);
964 if ((vp->v_count > 1) || ((ip->i_flag & IREF) == 0)) {
967 rw_exit(&ip->i_contents);
977 if (ip->i_udf == NULL) {
978 addr = (caddr_t)ip->i_ext;
979 size = sizeof (struct icb_ext) * ip->i_ext_count;
980 ip->i_ext = 0;
981 ip->i_ext_count = ip->i_ext_used = 0;
982 addr1 = (caddr_t)ip->i_con;
983 size1 = sizeof (struct icb_ext) * ip->i_con_count;
984 ip->i_con = 0;
985 ip->i_con_count = ip->i_con_used = ip->i_con_read = 0;
986 rw_exit(&ip->i_contents);
993 cv_destroy(&ip->i_wrcv); /* throttling */
994 rw_destroy(&ip->i_rwlock);
995 rw_exit(&ip->i_contents);
996 rw_destroy(&ip->i_contents);
1000 kmem_free(ip, sizeof (struct ud_inode));
1004 if ((ip->i_udf->udf_flags & UDF_FL_RDONLY) == 0) {
1005 if (ip->i_nlink <= 0) {
1006 ip->i_marker3 = (uint32_t)0xDDDD0000;
1007 ip->i_nlink = 1; /* prevent free-ing twice */
1008 (void) ud_itrunc(ip, 0, 0, cr);
1009 type = ip->i_type;
1010 ip->i_perm = 0;
1011 ip->i_uid = 0;
1012 ip->i_gid = 0;
1013 ip->i_rdev = 0; /* Zero in core version of rdev */
1014 mutex_enter(&ip->i_tlock);
1015 ip->i_flag |= IUPD|ICHG;
1016 mutex_exit(&ip->i_tlock);
1017 ud_ifree(ip, type);
1018 ip->i_icb_prn = 0xFFFF;
1024 (void) ud_syncip(ip, B_FREE | B_ASYNC, 0);
1034 rw_exit(&ip->i_contents);
1039 ud_iupdat(ip, 0);
1069 mutex_enter(&ip->i_tlock);
1071 ud_add_to_free_list(ip, UD_END);
1073 ip->i_flag &= IMODTIME;
1074 mutex_exit(&ip->i_tlock);
1075 rw_exit(&ip->i_contents);
1090 mutex_enter(&ip->i_tlock);
1092 ud_add_to_free_list(ip, UD_BEGIN);
1094 ip->i_flag &= IMODTIME;
1095 mutex_exit(&ip->i_tlock);
1096 rw_exit(&ip->i_contents);
1121 remque(ip);
1122 ip->i_forw = ip;
1123 ip->i_back = ip;
1128 if (ip->i_icb_prn != 0xFFFF) {
1129 ud_iupdat(ip, 0);
1131 addr = (caddr_t)ip->i_ext;
1132 size = sizeof (struct icb_ext) * ip->i_ext_count;
1133 ip->i_ext = 0;
1134 ip->i_ext_count = ip->i_ext_used = 0;
1135 addr1 = (caddr_t)ip->i_con;
1136 size1 = sizeof (struct icb_ext) * ip->i_con_count;
1137 ip->i_con = 0;
1138 ip->i_con_count = ip->i_con_used = ip->i_con_read = 0;
1139 cv_destroy(&ip->i_wrcv); /* throttling */
1140 rw_destroy(&ip->i_rwlock);
1141 rw_exit(&ip->i_contents);
1142 rw_destroy(&ip->i_contents);
1145 ip->i_marker3 = (uint32_t)0xDDDDDDDD;
1147 kmem_free(ip, sizeof (struct ud_inode));
1153 ud_iupdat(struct ud_inode *ip, int32_t waitfor)
1162 ASSERT(RW_WRITE_HELD(&ip->i_contents));
1168 if (ip->i_udf == NULL) {
1172 udf_vfsp = ip->i_udf;
1173 flag = ip->i_flag; /* Atomic read */
1176 ip->i_flag &= ~(IUPD|IACC|ICHG|IMOD|IMODACC|IATTCHG);
1180 bp = ud_bread(ip->i_dev,
1181 ip->i_icb_lbano << udf_vfsp->udf_l2d_shift,
1182 ip->i_udf->udf_lbsize);
1189 ip->i_icb_block,
1190 1, ip->i_udf->udf_lbsize) != 0) {
1195 mutex_enter(&ip->i_tlock);
1196 if (ip->i_flag & (IUPD|IACC|ICHG)) {
1197 IMARK(ip);
1199 ip->i_flag &= ~(IUPD|IACC|ICHG|IMOD|IMODACC);
1200 mutex_exit(&ip->i_tlock);
1202 fe->fe_uid = SWAP_32(ip->i_uid);
1203 fe->fe_gid = SWAP_32(ip->i_gid);
1205 fe->fe_perms = SWAP_32(ip->i_perm);
1207 fe->fe_lcount = SWAP_16(ip->i_nlink);
1208 fe->fe_info_len = SWAP_64(ip->i_size);
1209 fe->fe_lbr = SWAP_64(ip->i_lbr);
1211 ud_utime2dtime(&ip->i_atime, &fe->fe_acc_time);
1212 ud_utime2dtime(&ip->i_mtime, &fe->fe_mod_time);
1213 ud_utime2dtime(&ip->i_ctime, &fe->fe_attr_time);
1215 if (ip->i_char & ISUID) {
1220 if (ip->i_char & ISGID) {
1223 if (ip->i_char & ISVTX) {
1226 tag_flags |= ip->i_desc_type;
1230 * if (ip->i_astrat == STRAT_TYPE4) {
1236 fe->fe_icb_tag.itag_strategy = SWAP_16(ip->i_astrat);
1243 if (ip->i_desc_type == ICB_FLAG_ONE_AD) {
1244 crc_len += ip->i_size;
1245 fe->fe_len_adesc = SWAP_32(((uint32_t)ip->i_size));
1246 } else if ((ip->i_size != 0) && (ip->i_ext != NULL) &&
1247 (ip->i_ext_used != 0)) {
1249 if ((error = ud_read_icb_till_off(ip,
1250 ip->i_size)) == 0) {
1251 if (ip->i_astrat == STRAT_TYPE4) {
1252 error = ud_updat_ext4(ip, fe);
1253 } else if (ip->i_astrat == STRAT_TYPE4096) {
1254 error = ud_updat_ext4096(ip, fe);
1269 ip->i_udf->udf_lbsize - crc_len);
1271 ud_make_tag(ip->i_udf, &fe->fe_tag,
1272 UD_FILE_ENTRY, ip->i_icb_block, crc_len);
1282 ip->i_flag &= ~(IBDWRITE);
1294 ip->i_flag |= (IBDWRITE);
1303 blkflush(ip->i_dev,
1304 (daddr_t)fsbtodb(udf_vfsp, ip->i_icb_lbano));
1305 ip->i_flag &= ~(IBDWRITE);
1311 ud_updat_ext4(struct ud_inode *ip, struct file_entry *fe)
1322 ASSERT(ip);
1324 ASSERT((ip->i_desc_type == ICB_FLAG_SHORT_AD) ||
1325 (ip->i_desc_type == ICB_FLAG_LONG_AD));
1327 if (ip->i_desc_type == ICB_FLAG_SHORT_AD) {
1331 } else if (ip->i_desc_type == ICB_FLAG_LONG_AD) {
1340 ndent = ip->i_max_emb / elen;
1342 if (ip->i_ext_used < ndent) {
1344 if (ip->i_desc_type == ICB_FLAG_SHORT_AD) {
1345 ud_make_sad(ip->i_ext, sad, ip->i_ext_used);
1347 ud_make_lad(ip->i_ext, lad, ip->i_ext_used);
1349 fe->fe_len_adesc = SWAP_32(ip->i_ext_used * elen);
1355 while (index < ip->i_ext_used) {
1369 icon = &ip->i_con[con_index];
1374 icon = &ip->i_con[con_index];
1376 bno = ud_xlate_to_daddr(ip->i_udf,
1378 icon->ib_count >> ip->i_udf->udf_l2d_shift,
1380 bp = ud_bread(ip->i_dev,
1381 bno << ip->i_udf->udf_l2d_shift,
1382 ip->i_udf->udf_lbsize);
1394 if (count > (ip->i_ext_used - index)) {
1395 count = ip->i_ext_used - index;
1400 if (con_index >= ip->i_con_used) {
1403 icon = &ip->i_con[con_index];
1413 iext = &ip->i_ext[index];
1414 if (ip->i_desc_type == ICB_FLAG_SHORT_AD) {
1443 oicon = &ip->i_con[con_index - 1];
1452 SWAP_32(ip->i_icb_block);
1458 ud_make_tag(ip->i_udf, &aed->aed_tag,
1473 if (con_index != ip->i_con_used) {
1477 lbmask = ip->i_udf->udf_lbmask;
1478 l2b = ip->i_udf->udf_l2b_shift;
1482 for (; con_index < ip->i_con_used; con_index++) {
1483 icon = &ip->i_con[con_index];
1485 ud_free_space(ip->i_udf->udf_vfs, icon->ib_prn,
1488 ip->i_cur_max_ext -= (count / elen) - 1;
1490 ip->i_con_used = temp;
1497 ud_updat_ext4096(struct ud_inode *ip, struct file_entry *fe)
1549 * Truncate the inode ip to at most length size.
1683 ud_trunc_ext4(struct ud_inode *ip, u_offset_t length)
1694 ASSERT((ip->i_desc_type == ICB_FLAG_SHORT_AD) ||
1695 (ip->i_desc_type == ICB_FLAG_LONG_AD));
1697 if (ip->i_ext_used == 0) {
1701 ext_used = ip->i_ext_used;
1703 lbmask = ip->i_udf->udf_lbmask;
1704 l2b = ip->i_udf->udf_l2b_shift;
1706 ASSERT(ip->i_ext);
1708 ip->i_lbr = 0;
1710 iext = &ip->i_ext[index];
1730 ip->i_ext_used = index + 1;
1734 ip->i_lbr += iext->ib_count >> l2b;
1737 if (ip->i_ext_used != index) {
1739 ip->i_lbr +=
1744 ip->i_size = length;
1745 mutex_enter(&ip->i_tlock);
1746 ip->i_flag |= ICHG|IUPD;
1747 mutex_exit(&ip->i_tlock);
1748 ud_iupdat(ip, 1);
1758 ud_free_space(ip->i_udf->udf_vfs, text.ib_prn,
1762 for (index = ip->i_ext_used; index < ext_used; index++) {
1763 iext = &ip->i_ext[index];
1766 ud_free_space(ip->i_udf->udf_vfs, iext->ib_prn,
1776 if (ip->i_con) {
1778 ASSERT(ip->i_con_count >= ip->i_con_used);
1784 if (ip->i_desc_type == ICB_FLAG_SHORT_AD) {
1786 } else if (ip->i_desc_type == ICB_FLAG_LONG_AD) {
1789 ndent = ip->i_max_emb / elen;
1790 if (ip->i_ext_used > ndent) {
1791 ecount = ip->i_ext_used - ndent;
1796 for (index = 0; index < ip->i_con_used; index++) {
1797 icon = &ip->i_con[index];
1811 ud_free_space(ip->i_udf->udf_vfs,
1814 ip->i_cur_max_ext -= nient;
1823 ip->i_con_used -= con_freed;
1824 if (ip->i_con_read > ip->i_con_used) {
1825 ip->i_con_read = ip->i_con_used;
1831 ud_trunc_ext4096(struct ud_inode *ip, u_offset_t length)
1837 ud_trunc_ext4(ip, length);
1859 struct ud_inode *ip, *next;
1872 ip = next;
1873 next = ip->i_forw;
1874 if (ip->i_dev != dev) {
1877 vp = ITOV(ip);
1887 if (ip->i_flag & IREF) {
1897 rw_enter(&ip->i_contents, RW_WRITER);
1898 remque(ip);
1899 ip->i_forw = ip;
1900 ip->i_back = ip;
1910 (void) ud_syncip(ip, B_INVAL, I_SYNC);
1911 rw_exit(&ip->i_contents);
1929 ud_iaccess(struct ud_inode *ip, int32_t mode, struct cred *cr, int dolock)
1935 rw_enter(&ip->i_contents, RW_READER);
1936 ASSERT(RW_LOCK_HELD(&ip->i_contents));
1945 if (ip->i_udf->udf_flags & UDF_FL_RDONLY) {
1946 if ((ip->i_type != VCHR) &&
1947 (ip->i_type != VBLK) &&
1948 (ip->i_type != VFIFO)) {
1962 if (crgetuid(cr) != ip->i_uid) {
1964 if (!groupmember((uid_t)ip->i_gid, cr))
1968 ret = secpolicy_vnode_access2(cr, ITOV(ip), ip->i_uid,
1969 UD2VA_PERM(ip->i_perm << shift), UD2VA_PERM(mode));
1973 rw_exit(&ip->i_contents);
1978 ud_imark(struct ud_inode *ip)
1984 if (ip->i_flag & IACC) {
1985 ip->i_atime.tv_sec = now.tv_sec;
1986 ip->i_atime.tv_nsec = now.tv_nsec;
1988 if (ip->i_flag & IUPD) {
1989 ip->i_mtime.tv_sec = now.tv_sec;
1990 ip->i_mtime.tv_nsec = now.tv_nsec;
1991 ip->i_flag |= IMODTIME;
1993 if (ip->i_flag & ICHG) {
1994 ip->i_diroff = 0;
1995 ip->i_ctime.tv_sec = now.tv_sec;
1996 ip->i_ctime.tv_nsec = now.tv_nsec;
2002 ud_itimes_nolock(struct ud_inode *ip)
2006 if (ip->i_flag & (IUPD|IACC|ICHG)) {
2007 if (ip->i_flag & ICHG) {
2008 ip->i_flag |= IMOD;
2010 ip->i_flag |= IMODACC;
2012 ud_imark(ip);
2013 ip->i_flag &= ~(IACC|IUPD|ICHG);
2018 ud_delcache(struct ud_inode *ip)
2023 remque(ip);
2024 ip->i_forw = ip;
2025 ip->i_back = ip;
2030 ud_idrop(struct ud_inode *ip)
2032 struct vnode *vp = ITOV(ip);
2034 ASSERT(RW_WRITE_HELD(&ip->i_contents));
2052 mutex_enter(&ip->i_tlock);
2054 if (!vn_has_cached_data(vp) || ip->i_perm == 0) {
2055 ud_add_to_free_list(ip, UD_BEGIN);
2060 ud_add_to_free_list(ip, UD_END);
2063 ip->i_flag &= IMODTIME;
2064 mutex_exit(&ip->i_tlock);
2068 ud_add_to_free_list(struct ud_inode *ip, uint32_t at)
2070 ASSERT(ip);
2080 if (iq == ip) {
2081 cmn_err(CE_WARN, "Duplicate %p\n", (void *)ip);
2088 ip->i_freef = NULL;
2089 ip->i_freeb = NULL;
2094 udf_ifreeh = ip;
2095 udf_ifreet = ip;
2101 ip->i_freef = udf_ifreeh;
2102 udf_ifreeh->i_freeb = ip;
2103 udf_ifreeh = ip;
2108 ip->i_freeb = udf_ifreet;
2109 udf_ifreet->i_freef = ip;
2110 udf_ifreet = ip;
2116 ud_remove_from_free_list(struct ud_inode *ip, uint32_t at)
2118 ASSERT(ip);
2128 if (iq == ip) {
2134 cmn_err(CE_WARN, "ip %p is found %x times\n",
2135 (void *)ip, found);
2140 if ((ip->i_freef == NULL) && (ip->i_freeb == NULL)) {
2141 if (ip != udf_ifreeh) {
2146 if ((at == UD_BEGIN) || (ip == udf_ifreeh)) {
2147 udf_ifreeh = ip->i_freef;
2148 if (ip->i_freef == NULL) {
2154 ip->i_freeb->i_freef = ip->i_freef;
2155 if (ip->i_freef) {
2156 ip->i_freef->i_freeb = ip->i_freeb;
2158 udf_ifreet = ip->i_freeb;
2161 ip->i_freef = NULL;
2162 ip->i_freeb = NULL;