diff options
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r-- | fs/udf/namei.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index dacd8f4cea8a..112a5fb0b27b 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c | |||
@@ -395,7 +395,6 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, | |||
395 | } | 395 | } |
396 | 396 | ||
397 | block = dinfo->i_location.logicalBlockNum; | 397 | block = dinfo->i_location.logicalBlockNum; |
398 | |||
399 | } else { | 398 | } else { |
400 | block = udf_get_lb_pblock(dir->i_sb, dinfo->i_location, 0); | 399 | block = udf_get_lb_pblock(dir->i_sb, dinfo->i_location, 0); |
401 | fibh->sbh = fibh->ebh = NULL; | 400 | fibh->sbh = fibh->ebh = NULL; |
@@ -474,6 +473,14 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, | |||
474 | } | 473 | } |
475 | 474 | ||
476 | add: | 475 | add: |
476 | if (dinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) { | ||
477 | elen = (elen + sb->s_blocksize - 1) & ~(sb->s_blocksize - 1); | ||
478 | if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) | ||
479 | epos.offset -= sizeof(short_ad); | ||
480 | else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) | ||
481 | epos.offset -= sizeof(long_ad); | ||
482 | udf_write_aext(dir, &epos, eloc, elen, 1); | ||
483 | } | ||
477 | f_pos += nfidlen; | 484 | f_pos += nfidlen; |
478 | 485 | ||
479 | if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB && | 486 | if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB && |
@@ -491,15 +498,9 @@ add: | |||
491 | if (!fibh->sbh) | 498 | if (!fibh->sbh) |
492 | return NULL; | 499 | return NULL; |
493 | epos.block = dinfo->i_location; | 500 | epos.block = dinfo->i_location; |
494 | eloc.logicalBlockNum = block; | ||
495 | eloc.partitionReferenceNum = | ||
496 | dinfo->i_location.partitionReferenceNum; | ||
497 | elen = dir->i_sb->s_blocksize; | ||
498 | epos.offset = udf_file_entry_alloc_offset(dir); | 501 | epos.offset = udf_file_entry_alloc_offset(dir); |
499 | if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) | 502 | /* Load extent udf_expand_dir_adinicb() has created */ |
500 | epos.offset += sizeof(short_ad); | 503 | udf_current_aext(dir, &epos, &eloc, &elen, 1); |
501 | else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) | ||
502 | epos.offset += sizeof(long_ad); | ||
503 | } | 504 | } |
504 | 505 | ||
505 | if (sb->s_blocksize - fibh->eoffset >= nfidlen) { | 506 | if (sb->s_blocksize - fibh->eoffset >= nfidlen) { |