X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fisofs%2Frock.c;h=c09d4bd4b55a7451782f22d413434352830233dc;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=088acdcc95d9bb01347da7a01963a2ef447e33cf;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c index 088acdcc9..c09d4bd4b 100644 --- a/fs/isofs/rock.c +++ b/fs/isofs/rock.c @@ -41,7 +41,7 @@ #define CONTINUE_DECLS \ int cont_extent = 0, cont_offset = 0, cont_size = 0; \ - void * buffer = 0 + void *buffer = NULL #define CHECK_CE \ {cont_extent = isonum_733(rr->u.CE.extent); \ @@ -306,9 +306,7 @@ int parse_rock_ridge_inode_internal(struct iso_directory_record * de, goto out; case SIG('C','L'): ISOFS_I(inode)->i_first_extent = isonum_733(rr->u.CL.location); - reloc = iget(inode->i_sb, - (ISOFS_I(inode)->i_first_extent << - ISOFS_SB(inode->i_sb)->s_log_zone_size)); + reloc = isofs_iget(inode->i_sb, ISOFS_I(inode)->i_first_extent, 0); if (!reloc) goto out; inode->i_mode = reloc->i_mode; @@ -447,15 +445,15 @@ int parse_rock_ridge_inode(struct iso_directory_record * de, static int rock_ridge_symlink_readpage(struct file *file, struct page *page) { struct inode *inode = page->mapping->host; + struct iso_inode_info *ei = ISOFS_I(inode); char *link = kmap(page); unsigned long bufsize = ISOFS_BUFFER_SIZE(inode); - unsigned char bufbits = ISOFS_BUFFER_BITS(inode); struct buffer_head *bh; char *rpnt = link; unsigned char *pnt; struct iso_directory_record *raw_inode; CONTINUE_DECLS; - int block; + unsigned long block, offset; int sig; int len; unsigned char *chr; @@ -464,20 +462,21 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page) if (!ISOFS_SB(inode->i_sb)->s_rock) panic ("Cannot have symlink with high sierra variant of iso filesystem\n"); - block = inode->i_ino >> bufbits; + block = ei->i_iget5_block; lock_kernel(); bh = sb_bread(inode->i_sb, block); if (!bh) goto out_noread; - pnt = (unsigned char *) bh->b_data + (inode->i_ino & (bufsize - 1)); + offset = ei->i_iget5_offset; + pnt = (unsigned char *) bh->b_data + offset; raw_inode = (struct iso_directory_record *) pnt; /* * If we go past the end of the buffer, there is some sort of error. */ - if ((inode->i_ino & (bufsize - 1)) + *pnt > bufsize) + if (offset + *pnt > bufsize) goto out_bad_span; /* Now test for possible Rock Ridge extensions which will override