diff options
author | Jan Kara <jack@suse.cz> | 2007-05-08 00:35:13 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 11:15:21 -0700 |
commit | 60448b1d6db4e82946ff9a2ac88df341f5fa87a2 (patch) | |
tree | d0623c3dc26be55aa17319e1e9e8d0fbeea98ac4 /fs/udf/namei.c | |
parent | 277866a0e3a4f97e859f7a621f5b4f5359c9526c (diff) | |
download | linux-3.10-60448b1d6db4e82946ff9a2ac88df341f5fa87a2.tar.gz linux-3.10-60448b1d6db4e82946ff9a2ac88df341f5fa87a2.tar.bz2 linux-3.10-60448b1d6db4e82946ff9a2ac88df341f5fa87a2.zip |
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/namei.c')
-rw-r--r-- | fs/udf/namei.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index b25437527de..b9859ac169c 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -156,7 +156,8 @@ udf_find_entry(struct inode *dir, struct dentry *dentry, uint16_t liu; loff_t size; kernel_lb_addr bloc, eloc; - uint32_t extoffset, elen, offset; + uint32_t extoffset, elen; + sector_t offset; struct buffer_head *bh = NULL; size = (udf_ext0_offset(dir) + dir->i_size) >> 2; @@ -168,7 +169,6 @@ udf_find_entry(struct inode *dir, struct dentry *dentry, else if (inode_bmap(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2), &bloc, &extoffset, &eloc, &elen, &offset, &bh) == (EXT_RECORDED_ALLOCATED >> 30)) { - offset >>= dir->i_sb->s_blocksize_bits; block = udf_get_lb_pblock(dir->i_sb, eloc, offset); if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { @@ -354,7 +354,8 @@ udf_add_entry(struct inode *dir, struct dentry *dentry, uint16_t liu; int block; kernel_lb_addr bloc, eloc; - uint32_t extoffset, elen, offset; + uint32_t extoffset, elen; + sector_t offset; struct buffer_head *bh = NULL; sb = dir->i_sb; @@ -386,7 +387,6 @@ udf_add_entry(struct inode *dir, struct dentry *dentry, else if (inode_bmap(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2), &bloc, &extoffset, &eloc, &elen, &offset, &bh) == (EXT_RECORDED_ALLOCATED >> 30)) { - offset >>= dir->i_sb->s_blocksize_bits; block = udf_get_lb_pblock(dir->i_sb, eloc, offset); if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { @@ -782,7 +782,8 @@ static int empty_dir(struct inode *dir) loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2; int block; kernel_lb_addr bloc, eloc; - uint32_t extoffset, elen, offset; + uint32_t extoffset, elen; + sector_t offset; struct buffer_head *bh = NULL; f_pos = (udf_ext0_offset(dir) >> 2); @@ -794,7 +795,6 @@ static int empty_dir(struct inode *dir) else if (inode_bmap(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2), &bloc, &extoffset, &eloc, &elen, &offset, &bh) == (EXT_RECORDED_ALLOCATED >> 30)) { - offset >>= dir->i_sb->s_blocksize_bits; block = udf_get_lb_pblock(dir->i_sb, eloc, offset); if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { |