Pekka Enberg
2005-03-28 18:05:17 UTC
This patch inlines the MAYBE_CONTINUE macro in fs/isofs/rock.c.
Signed-off-by: Pekka Enberg <***@cs.helsinki.fi>
---
rock.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 90 insertions(+), 31 deletions(-)
Index: 2.6/fs/isofs/rock.c
===================================================================
--- 2.6.orig/fs/isofs/rock.c 2005-03-28 16:28:05.000000000 +0300
+++ 2.6/fs/isofs/rock.c 2005-03-28 16:31:53.000000000 +0300
@@ -52,34 +52,6 @@
} \
}
-#define MAYBE_CONTINUE(LABEL,DEV) \
- {if (buffer) { kfree(buffer); buffer = NULL; } \
- if (cont_extent){ \
- int block, offset, offset1; \
- struct buffer_head * pbh; \
- buffer = kmalloc(cont_size,GFP_KERNEL); \
- if (!buffer) goto out; \
- block = cont_extent; \
- offset = cont_offset; \
- offset1 = 0; \
- pbh = sb_bread(DEV->i_sb, block); \
- if(pbh){ \
- if (offset > pbh->b_size || offset + cont_size > pbh->b_size){ \
- brelse(pbh); \
- goto out; \
- } \
- memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1); \
- brelse(pbh); \
- chr = (unsigned char *) buffer; \
- len = cont_size; \
- cont_extent = 0; \
- cont_size = 0; \
- cont_offset = 0; \
- goto LABEL; \
- } \
- printk("Unable to read rock-ridge attributes\n"); \
- }}
-
/* return length of name field; 0: not found, -1: to be ignored */
int get_rock_ridge_filename(struct iso_directory_record *de,
char *retname, struct inode *inode)
@@ -163,7 +135,36 @@
}
}
}
- MAYBE_CONTINUE(repeat, inode);
+ if (buffer) {
+ kfree(buffer);
+ buffer = NULL;
+ }
+ if (cont_extent) {
+ int block, offset, offset1;
+ struct buffer_head * pbh;
+ buffer = kmalloc(cont_size,GFP_KERNEL);
+ if (!buffer)
+ goto out;
+ block = cont_extent;
+ offset = cont_offset;
+ offset1 = 0;
+ pbh = sb_bread(inode->i_sb, block);
+ if(pbh) {
+ if (offset > pbh->b_size || offset + cont_size > pbh->b_size) {
+ brelse(pbh);
+ goto out;
+ }
+ memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1);
+ brelse(pbh);
+ chr = (unsigned char *) buffer;
+ len = cont_size;
+ cont_extent = 0;
+ cont_size = 0;
+ cont_offset = 0;
+ goto repeat;
+ }
+ printk("Unable to read rock-ridge attributes\n");
+ }
if (buffer)
kfree(buffer);
return retnamlen; /* If 0, this file did not have a NM field */
@@ -428,7 +429,36 @@
}
}
}
- MAYBE_CONTINUE(repeat, inode);
+ if (buffer) {
+ kfree(buffer);
+ buffer = NULL;
+ }
+ if (cont_extent) {
+ int block, offset, offset1;
+ struct buffer_head * pbh;
+ buffer = kmalloc(cont_size,GFP_KERNEL);
+ if (!buffer)
+ goto out;
+ block = cont_extent;
+ offset = cont_offset;
+ offset1 = 0;
+ pbh = sb_bread(inode->i_sb, block);
+ if(pbh) {
+ if (offset > pbh->b_size || offset + cont_size > pbh->b_size) {
+ brelse(pbh);
+ goto out;
+ }
+ memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1);
+ brelse(pbh);
+ chr = (unsigned char *) buffer;
+ len = cont_size;
+ cont_extent = 0;
+ cont_size = 0;
+ cont_offset = 0;
+ goto repeat;
+ }
+ printk("Unable to read rock-ridge attributes\n");
+ }
out:
if (buffer)
kfree(buffer);
@@ -597,7 +627,36 @@
break;
}
}
- MAYBE_CONTINUE(repeat, inode);
+ if (buffer) {
+ kfree(buffer);
+ buffer = NULL;
+ }
+ if (cont_extent) {
+ int block, offset, offset1;
+ struct buffer_head * pbh;
+ buffer = kmalloc(cont_size,GFP_KERNEL);
+ if (!buffer)
+ goto out;
+ block = cont_extent;
+ offset = cont_offset;
+ offset1 = 0;
+ pbh = sb_bread(inode->i_sb, block);
+ if(pbh) {
+ if (offset > pbh->b_size || offset + cont_size > pbh->b_size) {
+ brelse(pbh);
+ goto out;
+ }
+ memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1);
+ brelse(pbh);
+ chr = (unsigned char *) buffer;
+ len = cont_size;
+ cont_extent = 0;
+ cont_size = 0;
+ cont_offset = 0;
+ goto repeat;
+ }
+ printk("Unable to read rock-ridge attributes\n");
+ }
if (buffer)
kfree(buffer);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Signed-off-by: Pekka Enberg <***@cs.helsinki.fi>
---
rock.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 90 insertions(+), 31 deletions(-)
Index: 2.6/fs/isofs/rock.c
===================================================================
--- 2.6.orig/fs/isofs/rock.c 2005-03-28 16:28:05.000000000 +0300
+++ 2.6/fs/isofs/rock.c 2005-03-28 16:31:53.000000000 +0300
@@ -52,34 +52,6 @@
} \
}
-#define MAYBE_CONTINUE(LABEL,DEV) \
- {if (buffer) { kfree(buffer); buffer = NULL; } \
- if (cont_extent){ \
- int block, offset, offset1; \
- struct buffer_head * pbh; \
- buffer = kmalloc(cont_size,GFP_KERNEL); \
- if (!buffer) goto out; \
- block = cont_extent; \
- offset = cont_offset; \
- offset1 = 0; \
- pbh = sb_bread(DEV->i_sb, block); \
- if(pbh){ \
- if (offset > pbh->b_size || offset + cont_size > pbh->b_size){ \
- brelse(pbh); \
- goto out; \
- } \
- memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1); \
- brelse(pbh); \
- chr = (unsigned char *) buffer; \
- len = cont_size; \
- cont_extent = 0; \
- cont_size = 0; \
- cont_offset = 0; \
- goto LABEL; \
- } \
- printk("Unable to read rock-ridge attributes\n"); \
- }}
-
/* return length of name field; 0: not found, -1: to be ignored */
int get_rock_ridge_filename(struct iso_directory_record *de,
char *retname, struct inode *inode)
@@ -163,7 +135,36 @@
}
}
}
- MAYBE_CONTINUE(repeat, inode);
+ if (buffer) {
+ kfree(buffer);
+ buffer = NULL;
+ }
+ if (cont_extent) {
+ int block, offset, offset1;
+ struct buffer_head * pbh;
+ buffer = kmalloc(cont_size,GFP_KERNEL);
+ if (!buffer)
+ goto out;
+ block = cont_extent;
+ offset = cont_offset;
+ offset1 = 0;
+ pbh = sb_bread(inode->i_sb, block);
+ if(pbh) {
+ if (offset > pbh->b_size || offset + cont_size > pbh->b_size) {
+ brelse(pbh);
+ goto out;
+ }
+ memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1);
+ brelse(pbh);
+ chr = (unsigned char *) buffer;
+ len = cont_size;
+ cont_extent = 0;
+ cont_size = 0;
+ cont_offset = 0;
+ goto repeat;
+ }
+ printk("Unable to read rock-ridge attributes\n");
+ }
if (buffer)
kfree(buffer);
return retnamlen; /* If 0, this file did not have a NM field */
@@ -428,7 +429,36 @@
}
}
}
- MAYBE_CONTINUE(repeat, inode);
+ if (buffer) {
+ kfree(buffer);
+ buffer = NULL;
+ }
+ if (cont_extent) {
+ int block, offset, offset1;
+ struct buffer_head * pbh;
+ buffer = kmalloc(cont_size,GFP_KERNEL);
+ if (!buffer)
+ goto out;
+ block = cont_extent;
+ offset = cont_offset;
+ offset1 = 0;
+ pbh = sb_bread(inode->i_sb, block);
+ if(pbh) {
+ if (offset > pbh->b_size || offset + cont_size > pbh->b_size) {
+ brelse(pbh);
+ goto out;
+ }
+ memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1);
+ brelse(pbh);
+ chr = (unsigned char *) buffer;
+ len = cont_size;
+ cont_extent = 0;
+ cont_size = 0;
+ cont_offset = 0;
+ goto repeat;
+ }
+ printk("Unable to read rock-ridge attributes\n");
+ }
out:
if (buffer)
kfree(buffer);
@@ -597,7 +627,36 @@
break;
}
}
- MAYBE_CONTINUE(repeat, inode);
+ if (buffer) {
+ kfree(buffer);
+ buffer = NULL;
+ }
+ if (cont_extent) {
+ int block, offset, offset1;
+ struct buffer_head * pbh;
+ buffer = kmalloc(cont_size,GFP_KERNEL);
+ if (!buffer)
+ goto out;
+ block = cont_extent;
+ offset = cont_offset;
+ offset1 = 0;
+ pbh = sb_bread(inode->i_sb, block);
+ if(pbh) {
+ if (offset > pbh->b_size || offset + cont_size > pbh->b_size) {
+ brelse(pbh);
+ goto out;
+ }
+ memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1);
+ brelse(pbh);
+ chr = (unsigned char *) buffer;
+ len = cont_size;
+ cont_extent = 0;
+ cont_size = 0;
+ cont_offset = 0;
+ goto repeat;
+ }
+ printk("Unable to read rock-ridge attributes\n");
+ }
if (buffer)
kfree(buffer);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------