diff options
author | Steve Magnani <steve.magnani@digidescorp.com> | 2017-10-12 09:48:40 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2017-10-17 05:56:45 -0400 |
commit | b490bdd630cc43a5725e76c7c23f8a7e55551145 (patch) | |
tree | 9ee95e0af7d247b2a8b282b2b5ed1a783465e9da /fs/udf | |
parent | 503c3117d05c184b431e403cd05c463ac41370f0 (diff) |
udf: Fix 64-bit sign extension issues affecting blocks > 0x7FFFFFFF
Large (> 1 TiB) UDF filesystems appear subject to several problems when
mounted on 64-bit systems:
* readdir() can fail on a directory containing File Identifiers residing
above 0x7FFFFFFF. This manifests as a 'ls' command failing with EIO.
* FIBMAP on a file block located above 0x7FFFFFFF can return a negative
value. The low 32 bits are correct, but applications that don't mask the
high 32 bits of the result can perform incorrectly.
Per suggestion by Jan Kara, introduce a udf_pblk_t type for representation
of UDF block addresses. Ultimately, all driver functions that manipulate
UDF block addresses should use this type; for now, deployment is limited
to functions with actual or potential sign extension issues.
Changes to udf_readdir() and udf_block_map() address the issues noted
above; other changes address potential similar issues uncovered during
audit of the driver code.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r-- | fs/udf/balloc.c | 17 | ||||
-rw-r--r-- | fs/udf/dir.c | 2 | ||||
-rw-r--r-- | fs/udf/directory.c | 3 | ||||
-rw-r--r-- | fs/udf/ialloc.c | 2 | ||||
-rw-r--r-- | fs/udf/inode.c | 30 | ||||
-rw-r--r-- | fs/udf/misc.c | 4 | ||||
-rw-r--r-- | fs/udf/namei.c | 9 | ||||
-rw-r--r-- | fs/udf/super.c | 2 | ||||
-rw-r--r-- | fs/udf/truncate.c | 2 | ||||
-rw-r--r-- | fs/udf/udfdecl.h | 21 |
10 files changed, 51 insertions, 41 deletions
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index e0fd65fe73e8..cbfd6043274b 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c | |||
@@ -218,16 +218,18 @@ out: | |||
218 | return alloc_count; | 218 | return alloc_count; |
219 | } | 219 | } |
220 | 220 | ||
221 | static int udf_bitmap_new_block(struct super_block *sb, | 221 | static udf_pblk_t udf_bitmap_new_block(struct super_block *sb, |
222 | struct udf_bitmap *bitmap, uint16_t partition, | 222 | struct udf_bitmap *bitmap, uint16_t partition, |
223 | uint32_t goal, int *err) | 223 | uint32_t goal, int *err) |
224 | { | 224 | { |
225 | struct udf_sb_info *sbi = UDF_SB(sb); | 225 | struct udf_sb_info *sbi = UDF_SB(sb); |
226 | int newbit, bit = 0, block, block_group, group_start; | 226 | int newbit, bit = 0; |
227 | udf_pblk_t block; | ||
228 | int block_group, group_start; | ||
227 | int end_goal, nr_groups, bitmap_nr, i; | 229 | int end_goal, nr_groups, bitmap_nr, i; |
228 | struct buffer_head *bh = NULL; | 230 | struct buffer_head *bh = NULL; |
229 | char *ptr; | 231 | char *ptr; |
230 | int newblock = 0; | 232 | udf_pblk_t newblock = 0; |
231 | 233 | ||
232 | *err = -ENOSPC; | 234 | *err = -ENOSPC; |
233 | mutex_lock(&sbi->s_alloc_mutex); | 235 | mutex_lock(&sbi->s_alloc_mutex); |
@@ -545,13 +547,14 @@ static int udf_table_prealloc_blocks(struct super_block *sb, | |||
545 | return alloc_count; | 547 | return alloc_count; |
546 | } | 548 | } |
547 | 549 | ||
548 | static int udf_table_new_block(struct super_block *sb, | 550 | static udf_pblk_t udf_table_new_block(struct super_block *sb, |
549 | struct inode *table, uint16_t partition, | 551 | struct inode *table, uint16_t partition, |
550 | uint32_t goal, int *err) | 552 | uint32_t goal, int *err) |
551 | { | 553 | { |
552 | struct udf_sb_info *sbi = UDF_SB(sb); | 554 | struct udf_sb_info *sbi = UDF_SB(sb); |
553 | uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF; | 555 | uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF; |
554 | uint32_t newblock = 0, adsize; | 556 | udf_pblk_t newblock = 0; |
557 | uint32_t adsize; | ||
555 | uint32_t elen, goal_elen = 0; | 558 | uint32_t elen, goal_elen = 0; |
556 | struct kernel_lb_addr eloc, uninitialized_var(goal_eloc); | 559 | struct kernel_lb_addr eloc, uninitialized_var(goal_eloc); |
557 | struct extent_position epos, goal_epos; | 560 | struct extent_position epos, goal_epos; |
@@ -700,12 +703,12 @@ inline int udf_prealloc_blocks(struct super_block *sb, | |||
700 | return allocated; | 703 | return allocated; |
701 | } | 704 | } |
702 | 705 | ||
703 | inline int udf_new_block(struct super_block *sb, | 706 | inline udf_pblk_t udf_new_block(struct super_block *sb, |
704 | struct inode *inode, | 707 | struct inode *inode, |
705 | uint16_t partition, uint32_t goal, int *err) | 708 | uint16_t partition, uint32_t goal, int *err) |
706 | { | 709 | { |
707 | struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition]; | 710 | struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition]; |
708 | int block; | 711 | udf_pblk_t block; |
709 | 712 | ||
710 | if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP) | 713 | if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP) |
711 | block = udf_bitmap_new_block(sb, | 714 | block = udf_bitmap_new_block(sb, |
diff --git a/fs/udf/dir.c b/fs/udf/dir.c index 2d0e028067eb..c19dba45aa20 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c | |||
@@ -43,7 +43,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx) | |||
43 | struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL}; | 43 | struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL}; |
44 | struct fileIdentDesc *fi = NULL; | 44 | struct fileIdentDesc *fi = NULL; |
45 | struct fileIdentDesc cfi; | 45 | struct fileIdentDesc cfi; |
46 | int block, iblock; | 46 | udf_pblk_t block, iblock; |
47 | loff_t nf_pos; | 47 | loff_t nf_pos; |
48 | int flen; | 48 | int flen; |
49 | unsigned char *fname = NULL, *copy_name = NULL; | 49 | unsigned char *fname = NULL, *copy_name = NULL; |
diff --git a/fs/udf/directory.c b/fs/udf/directory.c index 7aa48bd7cbaf..c41c3cc8e5c6 100644 --- a/fs/udf/directory.c +++ b/fs/udf/directory.c | |||
@@ -26,7 +26,8 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, | |||
26 | sector_t *offset) | 26 | sector_t *offset) |
27 | { | 27 | { |
28 | struct fileIdentDesc *fi; | 28 | struct fileIdentDesc *fi; |
29 | int i, num, block; | 29 | int i, num; |
30 | udf_pblk_t block; | ||
30 | struct buffer_head *tmp, *bha[16]; | 31 | struct buffer_head *tmp, *bha[16]; |
31 | struct udf_inode_info *iinfo = UDF_I(dir); | 32 | struct udf_inode_info *iinfo = UDF_I(dir); |
32 | 33 | ||
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index c1ed18a10ce4..b6e420c1bfeb 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -50,7 +50,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode) | |||
50 | struct super_block *sb = dir->i_sb; | 50 | struct super_block *sb = dir->i_sb; |
51 | struct udf_sb_info *sbi = UDF_SB(sb); | 51 | struct udf_sb_info *sbi = UDF_SB(sb); |
52 | struct inode *inode; | 52 | struct inode *inode; |
53 | int block; | 53 | udf_pblk_t block; |
54 | uint32_t start = UDF_I(dir)->i_location.logicalBlockNum; | 54 | uint32_t start = UDF_I(dir)->i_location.logicalBlockNum; |
55 | struct udf_inode_info *iinfo; | 55 | struct udf_inode_info *iinfo; |
56 | struct udf_inode_info *dinfo = UDF_I(dir); | 56 | struct udf_inode_info *dinfo = UDF_I(dir); |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 8dacf4f57414..1d8324a99e37 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -52,7 +52,7 @@ static int udf_alloc_i_data(struct inode *inode, size_t size); | |||
52 | static sector_t inode_getblk(struct inode *, sector_t, int *, int *); | 52 | static sector_t inode_getblk(struct inode *, sector_t, int *, int *); |
53 | static int8_t udf_insert_aext(struct inode *, struct extent_position, | 53 | static int8_t udf_insert_aext(struct inode *, struct extent_position, |
54 | struct kernel_lb_addr, uint32_t); | 54 | struct kernel_lb_addr, uint32_t); |
55 | static void udf_split_extents(struct inode *, int *, int, int, | 55 | static void udf_split_extents(struct inode *, int *, int, udf_pblk_t, |
56 | struct kernel_long_ad *, int *); | 56 | struct kernel_long_ad *, int *); |
57 | static void udf_prealloc_extents(struct inode *, int, int, | 57 | static void udf_prealloc_extents(struct inode *, int, int, |
58 | struct kernel_long_ad *, int *); | 58 | struct kernel_long_ad *, int *); |
@@ -316,10 +316,10 @@ int udf_expand_file_adinicb(struct inode *inode) | |||
316 | return err; | 316 | return err; |
317 | } | 317 | } |
318 | 318 | ||
319 | struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, int *block, | 319 | struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, |
320 | int *err) | 320 | udf_pblk_t *block, int *err) |
321 | { | 321 | { |
322 | int newblock; | 322 | udf_pblk_t newblock; |
323 | struct buffer_head *dbh = NULL; | 323 | struct buffer_head *dbh = NULL; |
324 | struct kernel_lb_addr eloc; | 324 | struct kernel_lb_addr eloc; |
325 | uint8_t alloctype; | 325 | uint8_t alloctype; |
@@ -446,7 +446,7 @@ abort: | |||
446 | return err; | 446 | return err; |
447 | } | 447 | } |
448 | 448 | ||
449 | static struct buffer_head *udf_getblk(struct inode *inode, long block, | 449 | static struct buffer_head *udf_getblk(struct inode *inode, udf_pblk_t block, |
450 | int create, int *err) | 450 | int create, int *err) |
451 | { | 451 | { |
452 | struct buffer_head *bh; | 452 | struct buffer_head *bh; |
@@ -663,11 +663,11 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, | |||
663 | struct kernel_lb_addr eloc, tmpeloc; | 663 | struct kernel_lb_addr eloc, tmpeloc; |
664 | int c = 1; | 664 | int c = 1; |
665 | loff_t lbcount = 0, b_off = 0; | 665 | loff_t lbcount = 0, b_off = 0; |
666 | uint32_t newblocknum, newblock; | 666 | udf_pblk_t newblocknum, newblock; |
667 | sector_t offset = 0; | 667 | sector_t offset = 0; |
668 | int8_t etype; | 668 | int8_t etype; |
669 | struct udf_inode_info *iinfo = UDF_I(inode); | 669 | struct udf_inode_info *iinfo = UDF_I(inode); |
670 | int goal = 0, pgoal = iinfo->i_location.logicalBlockNum; | 670 | udf_pblk_t goal = 0, pgoal = iinfo->i_location.logicalBlockNum; |
671 | int lastblock = 0; | 671 | int lastblock = 0; |
672 | bool isBeyondEOF; | 672 | bool isBeyondEOF; |
673 | 673 | ||
@@ -879,8 +879,8 @@ out_free: | |||
879 | } | 879 | } |
880 | 880 | ||
881 | static void udf_split_extents(struct inode *inode, int *c, int offset, | 881 | static void udf_split_extents(struct inode *inode, int *c, int offset, |
882 | int newblocknum, struct kernel_long_ad *laarr, | 882 | udf_pblk_t newblocknum, |
883 | int *endnum) | 883 | struct kernel_long_ad *laarr, int *endnum) |
884 | { | 884 | { |
885 | unsigned long blocksize = inode->i_sb->s_blocksize; | 885 | unsigned long blocksize = inode->i_sb->s_blocksize; |
886 | unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; | 886 | unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; |
@@ -1166,7 +1166,7 @@ static void udf_update_extents(struct inode *inode, struct kernel_long_ad *laarr | |||
1166 | } | 1166 | } |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | struct buffer_head *udf_bread(struct inode *inode, int block, | 1169 | struct buffer_head *udf_bread(struct inode *inode, udf_pblk_t block, |
1170 | int create, int *err) | 1170 | int create, int *err) |
1171 | { | 1171 | { |
1172 | struct buffer_head *bh = NULL; | 1172 | struct buffer_head *bh = NULL; |
@@ -1852,7 +1852,7 @@ struct inode *__udf_iget(struct super_block *sb, struct kernel_lb_addr *ino, | |||
1852 | return inode; | 1852 | return inode; |
1853 | } | 1853 | } |
1854 | 1854 | ||
1855 | int udf_setup_indirect_aext(struct inode *inode, int block, | 1855 | int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block, |
1856 | struct extent_position *epos) | 1856 | struct extent_position *epos) |
1857 | { | 1857 | { |
1858 | struct super_block *sb = inode->i_sb; | 1858 | struct super_block *sb = inode->i_sb; |
@@ -1994,7 +1994,7 @@ int udf_add_aext(struct inode *inode, struct extent_position *epos, | |||
1994 | 1994 | ||
1995 | if (epos->offset + (2 * adsize) > sb->s_blocksize) { | 1995 | if (epos->offset + (2 * adsize) > sb->s_blocksize) { |
1996 | int err; | 1996 | int err; |
1997 | int new_block; | 1997 | udf_pblk_t new_block; |
1998 | 1998 | ||
1999 | new_block = udf_new_block(sb, NULL, | 1999 | new_block = udf_new_block(sb, NULL, |
2000 | epos->block.partitionReferenceNum, | 2000 | epos->block.partitionReferenceNum, |
@@ -2076,7 +2076,7 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos, | |||
2076 | 2076 | ||
2077 | while ((etype = udf_current_aext(inode, epos, eloc, elen, inc)) == | 2077 | while ((etype = udf_current_aext(inode, epos, eloc, elen, inc)) == |
2078 | (EXT_NEXT_EXTENT_ALLOCDECS >> 30)) { | 2078 | (EXT_NEXT_EXTENT_ALLOCDECS >> 30)) { |
2079 | int block; | 2079 | udf_pblk_t block; |
2080 | 2080 | ||
2081 | if (++indirections > UDF_MAX_INDIR_EXTS) { | 2081 | if (++indirections > UDF_MAX_INDIR_EXTS) { |
2082 | udf_err(inode->i_sb, | 2082 | udf_err(inode->i_sb, |
@@ -2289,13 +2289,13 @@ int8_t inode_bmap(struct inode *inode, sector_t block, | |||
2289 | return etype; | 2289 | return etype; |
2290 | } | 2290 | } |
2291 | 2291 | ||
2292 | long udf_block_map(struct inode *inode, sector_t block) | 2292 | udf_pblk_t udf_block_map(struct inode *inode, sector_t block) |
2293 | { | 2293 | { |
2294 | struct kernel_lb_addr eloc; | 2294 | struct kernel_lb_addr eloc; |
2295 | uint32_t elen; | 2295 | uint32_t elen; |
2296 | sector_t offset; | 2296 | sector_t offset; |
2297 | struct extent_position epos = {}; | 2297 | struct extent_position epos = {}; |
2298 | int ret; | 2298 | udf_pblk_t ret; |
2299 | 2299 | ||
2300 | down_read(&UDF_I(inode)->i_data_sem); | 2300 | down_read(&UDF_I(inode)->i_data_sem); |
2301 | 2301 | ||
diff --git a/fs/udf/misc.c b/fs/udf/misc.c index 3949c4bec3a3..97f3258a7483 100644 --- a/fs/udf/misc.c +++ b/fs/udf/misc.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "udf_i.h" | 28 | #include "udf_i.h" |
29 | #include "udf_sb.h" | 29 | #include "udf_sb.h" |
30 | 30 | ||
31 | struct buffer_head *udf_tgetblk(struct super_block *sb, int block) | 31 | struct buffer_head *udf_tgetblk(struct super_block *sb, udf_pblk_t block) |
32 | { | 32 | { |
33 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) | 33 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) |
34 | return sb_getblk(sb, udf_fixed_to_variable(block)); | 34 | return sb_getblk(sb, udf_fixed_to_variable(block)); |
@@ -36,7 +36,7 @@ struct buffer_head *udf_tgetblk(struct super_block *sb, int block) | |||
36 | return sb_getblk(sb, block); | 36 | return sb_getblk(sb, block); |
37 | } | 37 | } |
38 | 38 | ||
39 | struct buffer_head *udf_tread(struct super_block *sb, int block) | 39 | struct buffer_head *udf_tread(struct super_block *sb, udf_pblk_t block) |
40 | { | 40 | { |
41 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) | 41 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) |
42 | return sb_bread(sb, udf_fixed_to_variable(block)); | 42 | return sb_bread(sb, udf_fixed_to_variable(block)); |
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 885198dfd9f8..d3f18a6fbe40 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c | |||
@@ -164,7 +164,8 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir, | |||
164 | { | 164 | { |
165 | struct fileIdentDesc *fi = NULL; | 165 | struct fileIdentDesc *fi = NULL; |
166 | loff_t f_pos; | 166 | loff_t f_pos; |
167 | int block, flen; | 167 | udf_pblk_t block; |
168 | int flen; | ||
168 | unsigned char *fname = NULL, *copy_name = NULL; | 169 | unsigned char *fname = NULL, *copy_name = NULL; |
169 | unsigned char *nameptr; | 170 | unsigned char *nameptr; |
170 | uint8_t lfi; | 171 | uint8_t lfi; |
@@ -352,7 +353,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, | |||
352 | int nfidlen; | 353 | int nfidlen; |
353 | uint8_t lfi; | 354 | uint8_t lfi; |
354 | uint16_t liu; | 355 | uint16_t liu; |
355 | int block; | 356 | udf_pblk_t block; |
356 | struct kernel_lb_addr eloc; | 357 | struct kernel_lb_addr eloc; |
357 | uint32_t elen = 0; | 358 | uint32_t elen = 0; |
358 | sector_t offset; | 359 | sector_t offset; |
@@ -749,7 +750,7 @@ static int empty_dir(struct inode *dir) | |||
749 | struct udf_fileident_bh fibh; | 750 | struct udf_fileident_bh fibh; |
750 | loff_t f_pos; | 751 | loff_t f_pos; |
751 | loff_t size = udf_ext0_offset(dir) + dir->i_size; | 752 | loff_t size = udf_ext0_offset(dir) + dir->i_size; |
752 | int block; | 753 | udf_pblk_t block; |
753 | struct kernel_lb_addr eloc; | 754 | struct kernel_lb_addr eloc; |
754 | uint32_t elen; | 755 | uint32_t elen; |
755 | sector_t offset; | 756 | sector_t offset; |
@@ -913,7 +914,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry, | |||
913 | int eoffset, elen = 0; | 914 | int eoffset, elen = 0; |
914 | uint8_t *ea; | 915 | uint8_t *ea; |
915 | int err; | 916 | int err; |
916 | int block; | 917 | udf_pblk_t block; |
917 | unsigned char *name = NULL; | 918 | unsigned char *name = NULL; |
918 | int namelen; | 919 | int namelen; |
919 | struct udf_inode_info *iinfo; | 920 | struct udf_inode_info *iinfo; |
diff --git a/fs/udf/super.c b/fs/udf/super.c index 08bf097507f6..7ea0592e7f7c 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -2389,7 +2389,7 @@ static unsigned int udf_count_free_bitmap(struct super_block *sb, | |||
2389 | struct buffer_head *bh = NULL; | 2389 | struct buffer_head *bh = NULL; |
2390 | unsigned int accum = 0; | 2390 | unsigned int accum = 0; |
2391 | int index; | 2391 | int index; |
2392 | int block = 0, newblock; | 2392 | udf_pblk_t block = 0, newblock; |
2393 | struct kernel_lb_addr loc; | 2393 | struct kernel_lb_addr loc; |
2394 | uint32_t bytes; | 2394 | uint32_t bytes; |
2395 | uint8_t *ptr; | 2395 | uint8_t *ptr; |
diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c index 42b8c57795cb..b647f0bd150c 100644 --- a/fs/udf/truncate.c +++ b/fs/udf/truncate.c | |||
@@ -48,7 +48,7 @@ static void extent_trunc(struct inode *inode, struct extent_position *epos, | |||
48 | 48 | ||
49 | if (elen != nelen) { | 49 | if (elen != nelen) { |
50 | udf_write_aext(inode, epos, &neloc, nelen, 0); | 50 | udf_write_aext(inode, epos, &neloc, nelen, 0); |
51 | if (last_block - first_block > 0) { | 51 | if (last_block > first_block) { |
52 | if (etype == (EXT_RECORDED_ALLOCATED >> 30)) | 52 | if (etype == (EXT_RECORDED_ALLOCATED >> 30)) |
53 | mark_inode_dirty(inode); | 53 | mark_inode_dirty(inode); |
54 | 54 | ||
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h index 63b034984378..8e51704fd75d 100644 --- a/fs/udf/udfdecl.h +++ b/fs/udf/udfdecl.h | |||
@@ -73,6 +73,8 @@ static inline size_t udf_ext0_offset(struct inode *inode) | |||
73 | /* computes tag checksum */ | 73 | /* computes tag checksum */ |
74 | u8 udf_tag_checksum(const struct tag *t); | 74 | u8 udf_tag_checksum(const struct tag *t); |
75 | 75 | ||
76 | typedef uint32_t udf_pblk_t; | ||
77 | |||
76 | struct dentry; | 78 | struct dentry; |
77 | struct inode; | 79 | struct inode; |
78 | struct task_struct; | 80 | struct task_struct; |
@@ -144,15 +146,17 @@ static inline struct inode *udf_iget(struct super_block *sb, | |||
144 | return __udf_iget(sb, ino, false); | 146 | return __udf_iget(sb, ino, false); |
145 | } | 147 | } |
146 | extern int udf_expand_file_adinicb(struct inode *); | 148 | extern int udf_expand_file_adinicb(struct inode *); |
147 | extern struct buffer_head *udf_expand_dir_adinicb(struct inode *, int *, int *); | 149 | extern struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, |
148 | extern struct buffer_head *udf_bread(struct inode *, int, int, int *); | 150 | udf_pblk_t *block, int *err); |
151 | extern struct buffer_head *udf_bread(struct inode *inode, udf_pblk_t block, | ||
152 | int create, int *err); | ||
149 | extern int udf_setsize(struct inode *, loff_t); | 153 | extern int udf_setsize(struct inode *, loff_t); |
150 | extern void udf_evict_inode(struct inode *); | 154 | extern void udf_evict_inode(struct inode *); |
151 | extern int udf_write_inode(struct inode *, struct writeback_control *wbc); | 155 | extern int udf_write_inode(struct inode *, struct writeback_control *wbc); |
152 | extern long udf_block_map(struct inode *, sector_t); | 156 | extern udf_pblk_t udf_block_map(struct inode *inode, sector_t block); |
153 | extern int8_t inode_bmap(struct inode *, sector_t, struct extent_position *, | 157 | extern int8_t inode_bmap(struct inode *, sector_t, struct extent_position *, |
154 | struct kernel_lb_addr *, uint32_t *, sector_t *); | 158 | struct kernel_lb_addr *, uint32_t *, sector_t *); |
155 | extern int udf_setup_indirect_aext(struct inode *inode, int block, | 159 | extern int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block, |
156 | struct extent_position *epos); | 160 | struct extent_position *epos); |
157 | extern int __udf_add_aext(struct inode *inode, struct extent_position *epos, | 161 | extern int __udf_add_aext(struct inode *inode, struct extent_position *epos, |
158 | struct kernel_lb_addr *eloc, uint32_t elen, int inc); | 162 | struct kernel_lb_addr *eloc, uint32_t elen, int inc); |
@@ -168,8 +172,9 @@ extern int8_t udf_current_aext(struct inode *, struct extent_position *, | |||
168 | struct kernel_lb_addr *, uint32_t *, int); | 172 | struct kernel_lb_addr *, uint32_t *, int); |
169 | 173 | ||
170 | /* misc.c */ | 174 | /* misc.c */ |
171 | extern struct buffer_head *udf_tgetblk(struct super_block *, int); | 175 | extern struct buffer_head *udf_tgetblk(struct super_block *sb, |
172 | extern struct buffer_head *udf_tread(struct super_block *, int); | 176 | udf_pblk_t block); |
177 | extern struct buffer_head *udf_tread(struct super_block *sb, udf_pblk_t block); | ||
173 | extern struct genericFormat *udf_add_extendedattr(struct inode *, uint32_t, | 178 | extern struct genericFormat *udf_add_extendedattr(struct inode *, uint32_t, |
174 | uint32_t, uint8_t); | 179 | uint32_t, uint8_t); |
175 | extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t, | 180 | extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t, |
@@ -228,8 +233,8 @@ extern void udf_free_blocks(struct super_block *, struct inode *, | |||
228 | struct kernel_lb_addr *, uint32_t, uint32_t); | 233 | struct kernel_lb_addr *, uint32_t, uint32_t); |
229 | extern int udf_prealloc_blocks(struct super_block *, struct inode *, uint16_t, | 234 | extern int udf_prealloc_blocks(struct super_block *, struct inode *, uint16_t, |
230 | uint32_t, uint32_t); | 235 | uint32_t, uint32_t); |
231 | extern int udf_new_block(struct super_block *, struct inode *, uint16_t, | 236 | extern udf_pblk_t udf_new_block(struct super_block *sb, struct inode *inode, |
232 | uint32_t, int *); | 237 | uint16_t partition, uint32_t goal, int *err); |
233 | 238 | ||
234 | /* directory.c */ | 239 | /* directory.c */ |
235 | extern struct fileIdentDesc *udf_fileident_read(struct inode *, loff_t *, | 240 | extern struct fileIdentDesc *udf_fileident_read(struct inode *, loff_t *, |