Lines Matching refs:iinfo

73 	struct udf_inode_info *iinfo = UDF_I(inode);  in __udf_clear_extent_cache()  local
75 if (iinfo->cached_extent.lstart != -1) { in __udf_clear_extent_cache()
76 brelse(iinfo->cached_extent.epos.bh); in __udf_clear_extent_cache()
77 iinfo->cached_extent.lstart = -1; in __udf_clear_extent_cache()
84 struct udf_inode_info *iinfo = UDF_I(inode); in udf_clear_extent_cache() local
86 spin_lock(&iinfo->i_extent_cache_lock); in udf_clear_extent_cache()
88 spin_unlock(&iinfo->i_extent_cache_lock); in udf_clear_extent_cache()
95 struct udf_inode_info *iinfo = UDF_I(inode); in udf_read_extent_cache() local
98 spin_lock(&iinfo->i_extent_cache_lock); in udf_read_extent_cache()
99 if ((iinfo->cached_extent.lstart <= bcount) && in udf_read_extent_cache()
100 (iinfo->cached_extent.lstart != -1)) { in udf_read_extent_cache()
102 *lbcount = iinfo->cached_extent.lstart; in udf_read_extent_cache()
103 memcpy(pos, &iinfo->cached_extent.epos, in udf_read_extent_cache()
109 spin_unlock(&iinfo->i_extent_cache_lock); in udf_read_extent_cache()
117 struct udf_inode_info *iinfo = UDF_I(inode); in udf_update_extent_cache() local
119 spin_lock(&iinfo->i_extent_cache_lock); in udf_update_extent_cache()
124 memcpy(&iinfo->cached_extent.epos, pos, sizeof(*pos)); in udf_update_extent_cache()
125 iinfo->cached_extent.lstart = estart; in udf_update_extent_cache()
126 switch (iinfo->i_alloc_type) { in udf_update_extent_cache()
128 iinfo->cached_extent.epos.offset -= sizeof(struct short_ad); in udf_update_extent_cache()
131 iinfo->cached_extent.epos.offset -= sizeof(struct long_ad); in udf_update_extent_cache()
134 spin_unlock(&iinfo->i_extent_cache_lock); in udf_update_extent_cache()
139 struct udf_inode_info *iinfo = UDF_I(inode); in udf_evict_inode() local
148 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB && in udf_evict_inode()
149 inode->i_size != iinfo->i_lenExtents) { in udf_evict_inode()
154 (unsigned long long)iinfo->i_lenExtents); in udf_evict_inode()
160 kfree(iinfo->i_data); in udf_evict_inode()
161 iinfo->i_data = NULL; in udf_evict_inode()
171 struct udf_inode_info *iinfo = UDF_I(inode); in udf_write_failed() local
176 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) { in udf_write_failed()
177 down_write(&iinfo->i_data_sem); in udf_write_failed()
180 up_write(&iinfo->i_data_sem); in udf_write_failed()
260 struct udf_inode_info *iinfo = UDF_I(inode); in udf_expand_file_adinicb() local
264 if (!iinfo->i_lenAlloc) { in udf_expand_file_adinicb()
266 iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT; in udf_expand_file_adinicb()
268 iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; in udf_expand_file_adinicb()
271 up_write(&iinfo->i_data_sem); in udf_expand_file_adinicb()
279 up_write(&iinfo->i_data_sem); in udf_expand_file_adinicb()
287 memset(kaddr + iinfo->i_lenAlloc, 0x00, in udf_expand_file_adinicb()
288 PAGE_SIZE - iinfo->i_lenAlloc); in udf_expand_file_adinicb()
289 memcpy(kaddr, iinfo->i_data + iinfo->i_lenEAttr, in udf_expand_file_adinicb()
290 iinfo->i_lenAlloc); in udf_expand_file_adinicb()
295 down_write(&iinfo->i_data_sem); in udf_expand_file_adinicb()
296 memset(iinfo->i_data + iinfo->i_lenEAttr, 0x00, in udf_expand_file_adinicb()
297 iinfo->i_lenAlloc); in udf_expand_file_adinicb()
298 iinfo->i_lenAlloc = 0; in udf_expand_file_adinicb()
300 iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT; in udf_expand_file_adinicb()
302 iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; in udf_expand_file_adinicb()
307 up_write(&iinfo->i_data_sem); in udf_expand_file_adinicb()
312 down_write(&iinfo->i_data_sem); in udf_expand_file_adinicb()
314 memcpy(iinfo->i_data + iinfo->i_lenEAttr, kaddr, inode->i_size); in udf_expand_file_adinicb()
317 iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; in udf_expand_file_adinicb()
319 iinfo->i_lenAlloc = inode->i_size; in udf_expand_file_adinicb()
320 up_write(&iinfo->i_data_sem); in udf_expand_file_adinicb()
341 struct udf_inode_info *iinfo = UDF_I(inode); in udf_expand_dir_adinicb() local
349 iinfo->i_alloc_type = alloctype; in udf_expand_dir_adinicb()
356 iinfo->i_location.partitionReferenceNum, in udf_expand_dir_adinicb()
357 iinfo->i_location.logicalBlockNum, err); in udf_expand_dir_adinicb()
361 iinfo->i_location.partitionReferenceNum, in udf_expand_dir_adinicb()
380 iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; in udf_expand_dir_adinicb()
387 iinfo->i_alloc_type = alloctype; in udf_expand_dir_adinicb()
394 iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; in udf_expand_dir_adinicb()
401 memset(iinfo->i_data + iinfo->i_lenEAttr, 0, iinfo->i_lenAlloc); in udf_expand_dir_adinicb()
402 iinfo->i_lenAlloc = 0; in udf_expand_dir_adinicb()
405 iinfo->i_location.partitionReferenceNum; in udf_expand_dir_adinicb()
406 iinfo->i_lenExtents = inode->i_size; in udf_expand_dir_adinicb()
408 epos.block = iinfo->i_location; in udf_expand_dir_adinicb()
423 struct udf_inode_info *iinfo; in udf_get_block() local
434 iinfo = UDF_I(inode); in udf_get_block()
436 down_write(&iinfo->i_data_sem); in udf_get_block()
437 if (block == iinfo->i_next_alloc_block + 1) { in udf_get_block()
438 iinfo->i_next_alloc_block++; in udf_get_block()
439 iinfo->i_next_alloc_goal++; in udf_get_block()
446 if (((loff_t)block) << inode->i_blkbits > iinfo->i_lenExtents) in udf_get_block()
458 up_write(&iinfo->i_data_sem); in udf_get_block()
497 struct udf_inode_info *iinfo; in udf_do_extend_file() local
505 iinfo = UDF_I(inode); in udf_do_extend_file()
512 iinfo->i_lenExtents = in udf_do_extend_file()
513 (iinfo->i_lenExtents + sb->s_blocksize - 1) & in udf_do_extend_file()
579 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) in udf_do_extend_file()
581 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) in udf_do_extend_file()
622 struct udf_inode_info *iinfo = UDF_I(inode); in udf_extend_file() local
627 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) in udf_extend_file()
629 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) in udf_extend_file()
676 iinfo->i_lenExtents = newsize; in udf_extend_file()
695 struct udf_inode_info *iinfo = UDF_I(inode); in inode_getblk() local
696 udf_pblk_t goal = 0, pgoal = iinfo->i_location.logicalBlockNum; in inode_getblk()
703 prev_epos.block = iinfo->i_location; in inode_getblk()
847 if (iinfo->i_next_alloc_block == block) in inode_getblk()
848 goal = iinfo->i_next_alloc_goal; in inode_getblk()
852 goal = iinfo->i_location.logicalBlockNum + 1; in inode_getblk()
856 iinfo->i_location.partitionReferenceNum, in inode_getblk()
864 iinfo->i_lenExtents += inode->i_sb->s_blocksize; in inode_getblk()
889 iinfo->i_location.partitionReferenceNum, 0); in inode_getblk()
895 iinfo->i_next_alloc_block = block; in inode_getblk()
896 iinfo->i_next_alloc_goal = newblocknum; in inode_getblk()
1217 struct udf_inode_info *iinfo; in udf_setsize() local
1226 iinfo = UDF_I(inode); in udf_setsize()
1228 down_write(&iinfo->i_data_sem); in udf_setsize()
1229 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { in udf_setsize()
1235 down_write(&iinfo->i_data_sem); in udf_setsize()
1237 iinfo->i_lenAlloc = newsize; in udf_setsize()
1243 up_write(&iinfo->i_data_sem); in udf_setsize()
1247 up_write(&iinfo->i_data_sem); in udf_setsize()
1250 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { in udf_setsize()
1251 down_write(&iinfo->i_data_sem); in udf_setsize()
1253 memset(iinfo->i_data + iinfo->i_lenEAttr + newsize, in udf_setsize()
1256 iinfo->i_lenAlloc = newsize; in udf_setsize()
1258 up_write(&iinfo->i_data_sem); in udf_setsize()
1266 down_write(&iinfo->i_data_sem); in udf_setsize()
1269 up_write(&iinfo->i_data_sem); in udf_setsize()
1295 struct udf_inode_info *iinfo = UDF_I(inode); in udf_read_inode() local
1297 struct kernel_lb_addr *iloc = &iinfo->i_location; in udf_read_inode()
1359 memcpy(&iinfo->i_location, &loc, in udf_read_inode()
1379 iinfo->i_strat4096 = 0; in udf_read_inode()
1381 iinfo->i_strat4096 = 1; in udf_read_inode()
1383 iinfo->i_alloc_type = le16_to_cpu(fe->icbTag.flags) & in udf_read_inode()
1385 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_SHORT && in udf_read_inode()
1386 iinfo->i_alloc_type != ICBTAG_FLAG_AD_LONG && in udf_read_inode()
1387 iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) { in udf_read_inode()
1391 iinfo->i_unique = 0; in udf_read_inode()
1392 iinfo->i_lenEAttr = 0; in udf_read_inode()
1393 iinfo->i_lenExtents = 0; in udf_read_inode()
1394 iinfo->i_lenAlloc = 0; in udf_read_inode()
1395 iinfo->i_next_alloc_block = 0; in udf_read_inode()
1396 iinfo->i_next_alloc_goal = 0; in udf_read_inode()
1398 iinfo->i_efe = 1; in udf_read_inode()
1399 iinfo->i_use = 0; in udf_read_inode()
1404 memcpy(iinfo->i_data, in udf_read_inode()
1408 iinfo->i_efe = 0; in udf_read_inode()
1409 iinfo->i_use = 0; in udf_read_inode()
1413 memcpy(iinfo->i_data, in udf_read_inode()
1417 iinfo->i_efe = 0; in udf_read_inode()
1418 iinfo->i_use = 1; in udf_read_inode()
1419 iinfo->i_lenAlloc = le32_to_cpu( in udf_read_inode()
1426 memcpy(iinfo->i_data, in udf_read_inode()
1457 iinfo->i_extraPerms = le32_to_cpu(fe->permissions) & ~FE_MAPPED_PERMS; in udf_read_inode()
1472 iinfo->i_lenExtents = inode->i_size; in udf_read_inode()
1474 if (iinfo->i_efe == 0) { in udf_read_inode()
1482 iinfo->i_unique = le64_to_cpu(fe->uniqueID); in udf_read_inode()
1483 iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); in udf_read_inode()
1484 iinfo->i_lenAlloc = le32_to_cpu(fe->lengthAllocDescs); in udf_read_inode()
1485 iinfo->i_checkpoint = le32_to_cpu(fe->checkpoint); in udf_read_inode()
1486 iinfo->i_streamdir = 0; in udf_read_inode()
1487 iinfo->i_lenStreams = 0; in udf_read_inode()
1494 udf_disk_stamp_to_time(&iinfo->i_crtime, efe->createTime); in udf_read_inode()
1497 iinfo->i_unique = le64_to_cpu(efe->uniqueID); in udf_read_inode()
1498 iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); in udf_read_inode()
1499 iinfo->i_lenAlloc = le32_to_cpu(efe->lengthAllocDescs); in udf_read_inode()
1500 iinfo->i_checkpoint = le32_to_cpu(efe->checkpoint); in udf_read_inode()
1503 iinfo->i_streamdir = (efe->streamDirectoryICB.extLength != 0); in udf_read_inode()
1504 iinfo->i_locStreamdir = in udf_read_inode()
1506 iinfo->i_lenStreams = le64_to_cpu(efe->objectSize); in udf_read_inode()
1507 if (iinfo->i_lenStreams >= inode->i_size) in udf_read_inode()
1508 iinfo->i_lenStreams -= inode->i_size; in udf_read_inode()
1510 iinfo->i_lenStreams = 0; in udf_read_inode()
1512 inode->i_generation = iinfo->i_unique; in udf_read_inode()
1518 if (iinfo->i_lenEAttr > bs || iinfo->i_lenAlloc > bs) in udf_read_inode()
1521 if (udf_file_entry_alloc_offset(inode) + iinfo->i_lenAlloc > bs) in udf_read_inode()
1524 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { in udf_read_inode()
1529 if (iinfo->i_lenAlloc != inode->i_size) in udf_read_inode()
1547 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) in udf_read_inode()
1606 struct udf_inode_info *iinfo = UDF_I(inode); in udf_alloc_i_data() local
1607 iinfo->i_data = kmalloc(size, GFP_KERNEL); in udf_alloc_i_data()
1608 if (!iinfo->i_data) in udf_alloc_i_data()
1634 struct udf_inode_info *iinfo = UDF_I(inode); in udf_update_extra_perms() local
1640 iinfo->i_extraPerms &= ~FE_DELETE_PERMS; in udf_update_extra_perms()
1642 iinfo->i_extraPerms |= FE_PERM_U_DELETE; in udf_update_extra_perms()
1644 iinfo->i_extraPerms |= FE_PERM_G_DELETE; in udf_update_extra_perms()
1646 iinfo->i_extraPerms |= FE_PERM_O_DELETE; in udf_update_extra_perms()
1659 static void udf_adjust_time(struct udf_inode_info *iinfo, struct timespec64 time) in udf_adjust_time() argument
1661 if (iinfo->i_crtime.tv_sec > time.tv_sec || in udf_adjust_time()
1662 (iinfo->i_crtime.tv_sec == time.tv_sec && in udf_adjust_time()
1663 iinfo->i_crtime.tv_nsec > time.tv_nsec)) in udf_adjust_time()
1664 iinfo->i_crtime = time; in udf_adjust_time()
1679 struct udf_inode_info *iinfo = UDF_I(inode); in udf_update_inode() local
1682 udf_get_lb_pblock(inode->i_sb, &iinfo->i_location, 0)); in udf_update_inode()
1693 if (iinfo->i_use) { in udf_update_inode()
1697 use->lengthAllocDescs = cpu_to_le32(iinfo->i_lenAlloc); in udf_update_inode()
1699 iinfo->i_data, inode->i_sb->s_blocksize - in udf_update_inode()
1721 udfperms |= iinfo->i_extraPerms; in udf_update_inode()
1756 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) in udf_update_inode()
1763 if (iinfo->i_efe == 0) { in udf_update_inode()
1765 iinfo->i_data, in udf_update_inode()
1776 fe->uniqueID = cpu_to_le64(iinfo->i_unique); in udf_update_inode()
1777 fe->lengthExtendedAttr = cpu_to_le32(iinfo->i_lenEAttr); in udf_update_inode()
1778 fe->lengthAllocDescs = cpu_to_le32(iinfo->i_lenAlloc); in udf_update_inode()
1779 fe->checkpoint = cpu_to_le32(iinfo->i_checkpoint); in udf_update_inode()
1784 iinfo->i_data, in udf_update_inode()
1788 cpu_to_le64(inode->i_size + iinfo->i_lenStreams); in udf_update_inode()
1791 if (iinfo->i_streamdir) { in udf_update_inode()
1795 cpu_to_lelb(iinfo->i_locStreamdir); in udf_update_inode()
1800 udf_adjust_time(iinfo, inode->i_atime); in udf_update_inode()
1801 udf_adjust_time(iinfo, inode->i_mtime); in udf_update_inode()
1802 udf_adjust_time(iinfo, inode->i_ctime); in udf_update_inode()
1806 udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); in udf_update_inode()
1813 efe->uniqueID = cpu_to_le64(iinfo->i_unique); in udf_update_inode()
1814 efe->lengthExtendedAttr = cpu_to_le32(iinfo->i_lenEAttr); in udf_update_inode()
1815 efe->lengthAllocDescs = cpu_to_le32(iinfo->i_lenAlloc); in udf_update_inode()
1816 efe->checkpoint = cpu_to_le32(iinfo->i_checkpoint); in udf_update_inode()
1822 if (iinfo->i_strat4096) { in udf_update_inode()
1831 if (iinfo->i_use) in udf_update_inode()
1848 icbflags = iinfo->i_alloc_type | in udf_update_inode()
1863 iinfo->i_location.logicalBlockNum); in udf_update_inode()
1864 crclen += iinfo->i_lenEAttr + iinfo->i_lenAlloc - sizeof(struct tag); in udf_update_inode()
1993 struct udf_inode_info *iinfo = UDF_I(inode); in __udf_add_aext() local
1997 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) in __udf_add_aext()
1999 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) in __udf_add_aext()
2005 WARN_ON(iinfo->i_lenAlloc != in __udf_add_aext()
2017 iinfo->i_lenAlloc += adsize; in __udf_add_aext()
2077 struct udf_inode_info *iinfo = UDF_I(inode); in udf_write_aext() local
2080 ptr = iinfo->i_data + epos->offset - in udf_write_aext()
2082 iinfo->i_lenEAttr; in udf_write_aext()
2086 switch (iinfo->i_alloc_type) { in udf_write_aext()
2167 struct udf_inode_info *iinfo = UDF_I(inode); in udf_current_aext() local
2172 ptr = iinfo->i_data + epos->offset - in udf_current_aext()
2174 iinfo->i_lenEAttr; in udf_current_aext()
2176 iinfo->i_lenAlloc; in udf_current_aext()
2186 switch (iinfo->i_alloc_type) { in udf_current_aext()
2194 iinfo->i_location.partitionReferenceNum; in udf_current_aext()
2206 udf_debug("alloc_type = %u unsupported\n", iinfo->i_alloc_type); in udf_current_aext()
2240 struct udf_inode_info *iinfo; in udf_delete_aext() local
2249 iinfo = UDF_I(inode); in udf_delete_aext()
2250 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) in udf_delete_aext()
2252 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) in udf_delete_aext()
2279 iinfo->i_lenAlloc -= (adsize * 2); in udf_delete_aext()
2296 iinfo->i_lenAlloc -= adsize; in udf_delete_aext()
2325 struct udf_inode_info *iinfo; in inode_bmap() local
2327 iinfo = UDF_I(inode); in inode_bmap()
2330 pos->block = iinfo->i_location; in inode_bmap()
2338 iinfo->i_lenExtents = lbcount; in inode_bmap()