aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r--fs/udf/namei.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index f84bfaa8d941..76cfaf79d982 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -47,7 +47,7 @@ int udf_write_fi(struct inode *inode, struct fileIdentDesc *cfi,
47 struct fileIdentDesc *sfi, struct udf_fileident_bh *fibh, 47 struct fileIdentDesc *sfi, struct udf_fileident_bh *fibh,
48 uint8_t *impuse, uint8_t *fileident) 48 uint8_t *impuse, uint8_t *fileident)
49{ 49{
50 uint16_t crclen = fibh->eoffset - fibh->soffset - sizeof(tag); 50 uint16_t crclen = fibh->eoffset - fibh->soffset - sizeof(struct tag);
51 uint16_t crc; 51 uint16_t crc;
52 int offset; 52 int offset;
53 uint16_t liu = le16_to_cpu(cfi->lengthOfImpUse); 53 uint16_t liu = le16_to_cpu(cfi->lengthOfImpUse);
@@ -99,18 +99,18 @@ int udf_write_fi(struct inode *inode, struct fileIdentDesc *cfi,
99 memset(fibh->ebh->b_data, 0x00, padlen + offset); 99 memset(fibh->ebh->b_data, 0x00, padlen + offset);
100 } 100 }
101 101
102 crc = crc_itu_t(0, (uint8_t *)cfi + sizeof(tag), 102 crc = crc_itu_t(0, (uint8_t *)cfi + sizeof(struct tag),
103 sizeof(struct fileIdentDesc) - sizeof(tag)); 103 sizeof(struct fileIdentDesc) - sizeof(struct tag));
104 104
105 if (fibh->sbh == fibh->ebh) { 105 if (fibh->sbh == fibh->ebh) {
106 crc = crc_itu_t(crc, (uint8_t *)sfi->impUse, 106 crc = crc_itu_t(crc, (uint8_t *)sfi->impUse,
107 crclen + sizeof(tag) - 107 crclen + sizeof(struct tag) -
108 sizeof(struct fileIdentDesc)); 108 sizeof(struct fileIdentDesc));
109 } else if (sizeof(struct fileIdentDesc) >= -fibh->soffset) { 109 } else if (sizeof(struct fileIdentDesc) >= -fibh->soffset) {
110 crc = crc_itu_t(crc, fibh->ebh->b_data + 110 crc = crc_itu_t(crc, fibh->ebh->b_data +
111 sizeof(struct fileIdentDesc) + 111 sizeof(struct fileIdentDesc) +
112 fibh->soffset, 112 fibh->soffset,
113 crclen + sizeof(tag) - 113 crclen + sizeof(struct tag) -
114 sizeof(struct fileIdentDesc)); 114 sizeof(struct fileIdentDesc));
115 } else { 115 } else {
116 crc = crc_itu_t(crc, (uint8_t *)sfi->impUse, 116 crc = crc_itu_t(crc, (uint8_t *)sfi->impUse,
@@ -154,7 +154,7 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir,
154 uint8_t lfi; 154 uint8_t lfi;
155 uint16_t liu; 155 uint16_t liu;
156 loff_t size; 156 loff_t size;
157 kernel_lb_addr eloc; 157 struct kernel_lb_addr eloc;
158 uint32_t elen; 158 uint32_t elen;
159 sector_t offset; 159 sector_t offset;
160 struct extent_position epos = {}; 160 struct extent_position epos = {};
@@ -174,9 +174,9 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir,
174 block = udf_get_lb_pblock(dir->i_sb, eloc, offset); 174 block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
175 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { 175 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
176 if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) 176 if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
177 epos.offset -= sizeof(short_ad); 177 epos.offset -= sizeof(struct short_ad);
178 else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) 178 else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
179 epos.offset -= sizeof(long_ad); 179 epos.offset -= sizeof(struct long_ad);
180 } else 180 } else
181 offset = 0; 181 offset = 0;
182 182
@@ -268,7 +268,7 @@ static struct dentry *udf_lookup(struct inode *dir, struct dentry *dentry,
268#ifdef UDF_RECOVERY 268#ifdef UDF_RECOVERY
269 /* temporary shorthand for specifying files by inode number */ 269 /* temporary shorthand for specifying files by inode number */
270 if (!strncmp(dentry->d_name.name, ".B=", 3)) { 270 if (!strncmp(dentry->d_name.name, ".B=", 3)) {
271 kernel_lb_addr lb = { 271 struct kernel_lb_addr lb = {
272 .logicalBlockNum = 0, 272 .logicalBlockNum = 0,
273 .partitionReferenceNum = 273 .partitionReferenceNum =
274 simple_strtoul(dentry->d_name.name + 3, 274 simple_strtoul(dentry->d_name.name + 3,
@@ -313,7 +313,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir,
313 uint8_t lfi; 313 uint8_t lfi;
314 uint16_t liu; 314 uint16_t liu;
315 int block; 315 int block;
316 kernel_lb_addr eloc; 316 struct kernel_lb_addr eloc;
317 uint32_t elen = 0; 317 uint32_t elen = 0;
318 sector_t offset; 318 sector_t offset;
319 struct extent_position epos = {}; 319 struct extent_position epos = {};
@@ -358,9 +358,9 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir,
358 block = udf_get_lb_pblock(dir->i_sb, eloc, offset); 358 block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
359 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { 359 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
360 if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) 360 if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
361 epos.offset -= sizeof(short_ad); 361 epos.offset -= sizeof(struct short_ad);
362 else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) 362 else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
363 epos.offset -= sizeof(long_ad); 363 epos.offset -= sizeof(struct long_ad);
364 } else 364 } else
365 offset = 0; 365 offset = 0;
366 366
@@ -409,9 +409,9 @@ add:
409 if (dinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB && elen) { 409 if (dinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB && elen) {
410 elen = (elen + sb->s_blocksize - 1) & ~(sb->s_blocksize - 1); 410 elen = (elen + sb->s_blocksize - 1) & ~(sb->s_blocksize - 1);
411 if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) 411 if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
412 epos.offset -= sizeof(short_ad); 412 epos.offset -= sizeof(struct short_ad);
413 else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) 413 else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
414 epos.offset -= sizeof(long_ad); 414 epos.offset -= sizeof(struct long_ad);
415 udf_write_aext(dir, &epos, eloc, elen, 1); 415 udf_write_aext(dir, &epos, eloc, elen, 1);
416 } 416 }
417 f_pos += nfidlen; 417 f_pos += nfidlen;
@@ -494,10 +494,10 @@ add:
494 memset(cfi, 0, sizeof(struct fileIdentDesc)); 494 memset(cfi, 0, sizeof(struct fileIdentDesc));
495 if (UDF_SB(sb)->s_udfrev >= 0x0200) 495 if (UDF_SB(sb)->s_udfrev >= 0x0200)
496 udf_new_tag((char *)cfi, TAG_IDENT_FID, 3, 1, block, 496 udf_new_tag((char *)cfi, TAG_IDENT_FID, 3, 1, block,
497 sizeof(tag)); 497 sizeof(struct tag));
498 else 498 else
499 udf_new_tag((char *)cfi, TAG_IDENT_FID, 2, 1, block, 499 udf_new_tag((char *)cfi, TAG_IDENT_FID, 2, 1, block,
500 sizeof(tag)); 500 sizeof(struct tag));
501 cfi->fileVersionNum = cpu_to_le16(1); 501 cfi->fileVersionNum = cpu_to_le16(1);
502 cfi->lengthFileIdent = namelen; 502 cfi->lengthFileIdent = namelen;
503 cfi->lengthOfImpUse = cpu_to_le16(0); 503 cfi->lengthOfImpUse = cpu_to_le16(0);
@@ -530,7 +530,7 @@ static int udf_delete_entry(struct inode *inode, struct fileIdentDesc *fi,
530 cfi->fileCharacteristics |= FID_FILE_CHAR_DELETED; 530 cfi->fileCharacteristics |= FID_FILE_CHAR_DELETED;
531 531
532 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_STRICT)) 532 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_STRICT))
533 memset(&(cfi->icb), 0x00, sizeof(long_ad)); 533 memset(&(cfi->icb), 0x00, sizeof(struct long_ad));
534 534
535 return udf_write_fi(inode, cfi, fi, fibh, NULL, NULL); 535 return udf_write_fi(inode, cfi, fi, fibh, NULL, NULL);
536} 536}
@@ -710,7 +710,7 @@ static int empty_dir(struct inode *dir)
710 loff_t f_pos; 710 loff_t f_pos;
711 loff_t size = udf_ext0_offset(dir) + dir->i_size; 711 loff_t size = udf_ext0_offset(dir) + dir->i_size;
712 int block; 712 int block;
713 kernel_lb_addr eloc; 713 struct kernel_lb_addr eloc;
714 uint32_t elen; 714 uint32_t elen;
715 sector_t offset; 715 sector_t offset;
716 struct extent_position epos = {}; 716 struct extent_position epos = {};
@@ -727,9 +727,9 @@ static int empty_dir(struct inode *dir)
727 block = udf_get_lb_pblock(dir->i_sb, eloc, offset); 727 block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
728 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { 728 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
729 if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) 729 if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
730 epos.offset -= sizeof(short_ad); 730 epos.offset -= sizeof(struct short_ad);
731 else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) 731 else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
732 epos.offset -= sizeof(long_ad); 732 epos.offset -= sizeof(struct long_ad);
733 } else 733 } else
734 offset = 0; 734 offset = 0;
735 735
@@ -778,7 +778,7 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry)
778 struct inode *inode = dentry->d_inode; 778 struct inode *inode = dentry->d_inode;
779 struct udf_fileident_bh fibh; 779 struct udf_fileident_bh fibh;
780 struct fileIdentDesc *fi, cfi; 780 struct fileIdentDesc *fi, cfi;
781 kernel_lb_addr tloc; 781 struct kernel_lb_addr tloc;
782 782
783 retval = -ENOENT; 783 retval = -ENOENT;
784 lock_kernel(); 784 lock_kernel();
@@ -824,7 +824,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry)
824 struct udf_fileident_bh fibh; 824 struct udf_fileident_bh fibh;
825 struct fileIdentDesc *fi; 825 struct fileIdentDesc *fi;
826 struct fileIdentDesc cfi; 826 struct fileIdentDesc cfi;
827 kernel_lb_addr tloc; 827 struct kernel_lb_addr tloc;
828 828
829 retval = -ENOENT; 829 retval = -ENOENT;
830 lock_kernel(); 830 lock_kernel();
@@ -897,7 +897,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
897 inode->i_op = &page_symlink_inode_operations; 897 inode->i_op = &page_symlink_inode_operations;
898 898
899 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) { 899 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
900 kernel_lb_addr eloc; 900 struct kernel_lb_addr eloc;
901 uint32_t bsize; 901 uint32_t bsize;
902 902
903 block = udf_new_block(inode->i_sb, inode, 903 block = udf_new_block(inode->i_sb, inode,
@@ -1108,7 +1108,7 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
1108 struct fileIdentDesc ocfi, ncfi; 1108 struct fileIdentDesc ocfi, ncfi;
1109 struct buffer_head *dir_bh = NULL; 1109 struct buffer_head *dir_bh = NULL;
1110 int retval = -ENOENT; 1110 int retval = -ENOENT;
1111 kernel_lb_addr tloc; 1111 struct kernel_lb_addr tloc;
1112 struct udf_inode_info *old_iinfo = UDF_I(old_inode); 1112 struct udf_inode_info *old_iinfo = UDF_I(old_inode);
1113 1113
1114 lock_kernel(); 1114 lock_kernel();
@@ -1187,7 +1187,7 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
1187 */ 1187 */
1188 ncfi.fileVersionNum = ocfi.fileVersionNum; 1188 ncfi.fileVersionNum = ocfi.fileVersionNum;
1189 ncfi.fileCharacteristics = ocfi.fileCharacteristics; 1189 ncfi.fileCharacteristics = ocfi.fileCharacteristics;
1190 memcpy(&(ncfi.icb), &(ocfi.icb), sizeof(long_ad)); 1190 memcpy(&(ncfi.icb), &(ocfi.icb), sizeof(struct long_ad));
1191 udf_write_fi(new_dir, &ncfi, nfi, &nfibh, NULL, NULL); 1191 udf_write_fi(new_dir, &ncfi, nfi, &nfibh, NULL, NULL);
1192 1192
1193 /* The old fid may have moved - find it again */ 1193 /* The old fid may have moved - find it again */
@@ -1272,7 +1272,7 @@ static struct dentry *udf_nfs_get_inode(struct super_block *sb, u32 block,
1272 u16 partref, __u32 generation) 1272 u16 partref, __u32 generation)
1273{ 1273{
1274 struct inode *inode; 1274 struct inode *inode;
1275 kernel_lb_addr loc; 1275 struct kernel_lb_addr loc;
1276 1276
1277 if (block == 0) 1277 if (block == 0)
1278 return ERR_PTR(-ESTALE); 1278 return ERR_PTR(-ESTALE);
@@ -1318,7 +1318,7 @@ static int udf_encode_fh(struct dentry *de, __u32 *fh, int *lenp,
1318{ 1318{
1319 int len = *lenp; 1319 int len = *lenp;
1320 struct inode *inode = de->d_inode; 1320 struct inode *inode = de->d_inode;
1321 kernel_lb_addr location = UDF_I(inode)->i_location; 1321 struct kernel_lb_addr location = UDF_I(inode)->i_location;
1322 struct fid *fid = (struct fid *)fh; 1322 struct fid *fid = (struct fid *)fh;
1323 int type = FILEID_UDF_WITHOUT_PARENT; 1323 int type = FILEID_UDF_WITHOUT_PARENT;
1324 1324