Lines Matching defs:epos
76 brelse(iinfo->cached_extent.epos.bh);
103 memcpy(pos, &iinfo->cached_extent.epos,
124 memcpy(&iinfo->cached_extent.epos, pos, sizeof(*pos));
128 iinfo->cached_extent.epos.offset -= sizeof(struct short_ad);
131 iinfo->cached_extent.epos.offset -= sizeof(struct long_ad);
333 struct extent_position epos;
406 epos.bh = NULL;
407 epos.block = iinfo->i_location;
408 epos.offset = udf_file_entry_alloc_offset(inode);
409 udf_add_aext(inode, &epos, &eloc, inode->i_size, 0);
412 brelse(epos.bh);
620 struct extent_position epos;
646 etype = inode_bmap(inode, first_block, &epos, &eloc, &elen, &offset);
652 if ((!epos.bh && epos.offset == udf_file_entry_alloc_offset(inode)) ||
653 (epos.bh && epos.offset == sizeof(struct allocExtDesc))) {
660 epos.offset -= adsize;
661 etype = udf_next_aext(inode, &epos, &extent.extLocation,
674 udf_do_extend_final_block(inode, &epos, &extent, new_elen);
676 err = udf_do_extend_file(inode, &epos, &extent, new_elen);
684 brelse(epos.bh);
1160 struct extent_position *epos)
1169 udf_delete_aext(inode, *epos);
1172 err = udf_insert_aext(inode, *epos,
1182 udf_next_aext(inode, epos, &laarr[i].extLocation,
1189 udf_next_aext(inode, epos, &tmploc, &tmplen, 0);
1190 udf_write_aext(inode, epos, &laarr[i].extLocation,
1928 struct extent_position *epos)
1945 neloc.partitionReferenceNum = epos->block.partitionReferenceNum;
1959 cpu_to_le32(epos->block.logicalBlockNum);
1977 if (epos->offset + adsize > sb->s_blocksize) {
1982 epos->offset -= adsize;
1983 cp_type = udf_current_aext(inode, epos, &cp_loc, &cp_len, 0);
1987 udf_write_aext(inode, epos, &nepos.block,
1990 __udf_add_aext(inode, epos, &nepos.block,
1994 brelse(epos->bh);
1995 *epos = nepos;
2005 int __udf_add_aext(struct inode *inode, struct extent_position *epos,
2019 if (!epos->bh) {
2021 epos->offset - udf_file_entry_alloc_offset(inode));
2023 aed = (struct allocExtDesc *)epos->bh->b_data;
2025 epos->offset - sizeof(struct allocExtDesc));
2026 WARN_ON(epos->offset + adsize > inode->i_sb->s_blocksize);
2029 udf_write_aext(inode, epos, eloc, elen, inc);
2031 if (!epos->bh) {
2035 aed = (struct allocExtDesc *)epos->bh->b_data;
2039 udf_update_tag(epos->bh->b_data,
2040 epos->offset + (inc ? 0 : adsize));
2042 udf_update_tag(epos->bh->b_data,
2044 mark_buffer_dirty_inode(epos->bh, inode);
2054 int udf_add_aext(struct inode *inode, struct extent_position *epos,
2067 if (epos->offset + (2 * adsize) > sb->s_blocksize) {
2072 epos->block.partitionReferenceNum,
2073 epos->block.logicalBlockNum, &err);
2077 err = udf_setup_indirect_aext(inode, new_block, epos);
2082 return __udf_add_aext(inode, epos, eloc, elen, inc);
2085 void udf_write_aext(struct inode *inode, struct extent_position *epos,
2094 if (!epos->bh)
2095 ptr = iinfo->i_data + epos->offset -
2099 ptr = epos->bh->b_data + epos->offset;
2119 if (epos->bh) {
2123 (struct allocExtDesc *)epos->bh->b_data;
2124 udf_update_tag(epos->bh->b_data,
2128 mark_buffer_dirty_inode(epos->bh, inode);
2134 epos->offset += adsize;
2143 int8_t udf_next_aext(struct inode *inode, struct extent_position *epos,
2149 while ((etype = udf_current_aext(inode, epos, eloc, elen, inc)) ==
2160 epos->block = *eloc;
2161 epos->offset = sizeof(struct allocExtDesc);
2162 brelse(epos->bh);
2163 block = udf_get_lb_pblock(inode->i_sb, &epos->block, 0);
2164 epos->bh = udf_tread(inode->i_sb, block);
2165 if (!epos->bh) {
2174 int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
2184 if (!epos->bh) {
2185 if (!epos->offset)
2186 epos->offset = udf_file_entry_alloc_offset(inode);
2187 ptr = iinfo->i_data + epos->offset -
2193 if (!epos->offset)
2194 epos->offset = sizeof(struct allocExtDesc);
2195 ptr = epos->bh->b_data + epos->offset;
2197 le32_to_cpu(((struct allocExtDesc *)epos->bh->b_data)->
2203 sad = udf_get_fileshortad(ptr, alen, &epos->offset, inc);
2213 lad = udf_get_filelongad(ptr, alen, &epos->offset, inc);
2228 static int udf_insert_aext(struct inode *inode, struct extent_position epos,
2236 if (epos.bh)
2237 get_bh(epos.bh);
2239 while ((etype = udf_next_aext(inode, &epos, &oeloc, &oelen, 0)) != -1) {
2240 udf_write_aext(inode, &epos, &neloc, nelen, 1);
2244 err = udf_add_aext(inode, &epos, &neloc, nelen, 1);
2245 brelse(epos.bh);
2250 int8_t udf_delete_aext(struct inode *inode, struct extent_position epos)
2260 if (epos.bh) {
2261 get_bh(epos.bh);
2262 get_bh(epos.bh);
2273 oepos = epos;
2274 if (udf_next_aext(inode, &epos, &eloc, &elen, 1) == -1)
2277 while ((etype = udf_next_aext(inode, &epos, &eloc, &elen, 1)) != -1) {
2279 if (oepos.bh != epos.bh) {
2280 oepos.block = epos.block;
2282 get_bh(epos.bh);
2283 oepos.bh = epos.bh;
2284 oepos.offset = epos.offset - adsize;
2290 if (epos.bh != oepos.bh) {
2291 udf_free_blocks(inode->i_sb, inode, &epos.block, 0, 1);
2320 epos.offset - adsize);
2328 brelse(epos.bh);
2371 struct extent_position epos = {};
2376 if (inode_bmap(inode, block, &epos, &eloc, &elen, &offset) ==
2383 brelse(epos.bh);