diff options
author | Jan Kara <jack@suse.cz> | 2007-05-08 03:35:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:21 -0400 |
commit | 60448b1d6db4e82946ff9a2ac88df341f5fa87a2 (patch) | |
tree | d0623c3dc26be55aa17319e1e9e8d0fbeea98ac4 /fs/udf/dir.c | |
parent | 277866a0e3a4f97e859f7a621f5b4f5359c9526c (diff) |
udf: use sector_t and loff_t for file offsets
Use sector_t and loff_t for file offsets in UDF filesystem. Otherwise an
overflow may occur for long files. Also make inode_bmap() return offset in
the extent in number of blocks instead of number of bytes - for most
callers this is more convenient.
Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/udf/dir.c')
-rw-r--r-- | fs/udf/dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/udf/dir.c b/fs/udf/dir.c index 2391c9150c4..3c50b82a230 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c | |||
@@ -113,7 +113,8 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d | |||
113 | loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2; | 113 | loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2; |
114 | struct buffer_head * bh = NULL, * tmp, * bha[16]; | 114 | struct buffer_head * bh = NULL, * tmp, * bha[16]; |
115 | kernel_lb_addr bloc, eloc; | 115 | kernel_lb_addr bloc, eloc; |
116 | uint32_t extoffset, elen, offset; | 116 | uint32_t extoffset, elen; |
117 | sector_t offset; | ||
117 | int i, num; | 118 | int i, num; |
118 | unsigned int dt_type; | 119 | unsigned int dt_type; |
119 | 120 | ||
@@ -129,7 +130,6 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d | |||
129 | else if (inode_bmap(dir, nf_pos >> (dir->i_sb->s_blocksize_bits - 2), | 130 | else if (inode_bmap(dir, nf_pos >> (dir->i_sb->s_blocksize_bits - 2), |
130 | &bloc, &extoffset, &eloc, &elen, &offset, &bh) == (EXT_RECORDED_ALLOCATED >> 30)) | 131 | &bloc, &extoffset, &eloc, &elen, &offset, &bh) == (EXT_RECORDED_ALLOCATED >> 30)) |
131 | { | 132 | { |
132 | offset >>= dir->i_sb->s_blocksize_bits; | ||
133 | block = udf_get_lb_pblock(dir->i_sb, eloc, offset); | 133 | block = udf_get_lb_pblock(dir->i_sb, eloc, offset); |
134 | if ((++offset << dir->i_sb->s_blocksize_bits) < elen) | 134 | if ((++offset << dir->i_sb->s_blocksize_bits) < elen) |
135 | { | 135 | { |