Commit 76ab07eb authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] rock: remove SETUP_ROCK_RIDGE

- Remove the SETUP_ROCK_RIDGE macro.

- In rock_ridge_symlink_readpage(), rename raw_inode to raw_de.  It points
  at a directory entry, not an inode.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 04f7aa9c
...@@ -37,18 +37,23 @@ static int check_sp(struct rock_ridge *rr, struct inode *inode) ...@@ -37,18 +37,23 @@ static int check_sp(struct rock_ridge *rr, struct inode *inode)
return 0; return 0;
} }
#define SETUP_ROCK_RIDGE(DE,CHR,LEN) \ static void setup_rock_ridge(struct iso_directory_record *de,
{LEN= sizeof(struct iso_directory_record) + DE->name_len[0]; \ struct inode *inode, unsigned char **chr, int *len)
if(LEN & 1) LEN++; \ {
CHR = ((unsigned char *) DE) + LEN; \ *len = sizeof(struct iso_directory_record) + de->name_len[0];
LEN = *((unsigned char *) DE) - LEN; \ if (*len & 1)
if (LEN<0) LEN=0; \ (*len)++;
if (ISOFS_SB(inode->i_sb)->s_rock_offset!=-1) \ *chr = (unsigned char *)de + *len;
{ \ *len = *((unsigned char *)de) - *len;
LEN-=ISOFS_SB(inode->i_sb)->s_rock_offset; \ if (*len < 0)
CHR+=ISOFS_SB(inode->i_sb)->s_rock_offset; \ *len = 0;
if (LEN<0) LEN=0; \
} \ if (ISOFS_SB(inode->i_sb)->s_rock_offset != -1) {
*len -= ISOFS_SB(inode->i_sb)->s_rock_offset;
*chr += ISOFS_SB(inode->i_sb)->s_rock_offset;
if (*len < 0)
*len = 0;
}
} }
#define MAYBE_CONTINUE(LABEL,DEV) \ #define MAYBE_CONTINUE(LABEL,DEV) \
...@@ -98,7 +103,7 @@ int get_rock_ridge_filename(struct iso_directory_record *de, ...@@ -98,7 +103,7 @@ int get_rock_ridge_filename(struct iso_directory_record *de,
return 0; return 0;
*retname = 0; *retname = 0;
SETUP_ROCK_RIDGE(de, chr, len); setup_rock_ridge(de, inode, &chr, &len);
repeat: repeat:
while (len > 2) { /* There may be one byte for padding somewhere */ while (len > 2) { /* There may be one byte for padding somewhere */
...@@ -188,7 +193,7 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, ...@@ -188,7 +193,7 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
if (!ISOFS_SB(inode->i_sb)->s_rock) if (!ISOFS_SB(inode->i_sb)->s_rock)
return 0; return 0;
SETUP_ROCK_RIDGE(de, chr, len); setup_rock_ridge(de, inode, &chr, &len);
if (regard_xa) { if (regard_xa) {
chr += 14; chr += 14;
len -= 14; len -= 14;
...@@ -527,7 +532,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page) ...@@ -527,7 +532,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
struct buffer_head *bh; struct buffer_head *bh;
char *rpnt = link; char *rpnt = link;
unsigned char *pnt; unsigned char *pnt;
struct iso_directory_record *raw_inode; struct iso_directory_record *raw_de;
int cont_extent = 0; int cont_extent = 0;
int cont_offset = 0; int cont_offset = 0;
int cont_size = 0; int cont_size = 0;
...@@ -550,7 +555,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page) ...@@ -550,7 +555,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
offset = ei->i_iget5_offset; offset = ei->i_iget5_offset;
pnt = (unsigned char *)bh->b_data + offset; pnt = (unsigned char *)bh->b_data + offset;
raw_inode = (struct iso_directory_record *)pnt; raw_de = (struct iso_directory_record *)pnt;
/* /*
* If we go past the end of the buffer, there is some sort of error. * If we go past the end of the buffer, there is some sort of error.
...@@ -561,7 +566,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page) ...@@ -561,7 +566,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
/* Now test for possible Rock Ridge extensions which will override /* Now test for possible Rock Ridge extensions which will override
some of these numbers in the inode structure. */ some of these numbers in the inode structure. */
SETUP_ROCK_RIDGE(raw_inode, chr, len); setup_rock_ridge(raw_de, inode, &chr, &len);
repeat: repeat:
while (len > 2) { /* There may be one byte for padding somewhere */ while (len > 2) { /* There may be one byte for padding somewhere */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment