提交 7fa393a1 编写于 作者: A Andrew Morton 提交者: Linus Torvalds

[PATCH] rock: manual tidies

Fix stuff which Lindent got wrong, rework a few deeply-nested blocks.
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1d372116
......@@ -90,17 +90,17 @@ int get_rock_ridge_filename(struct iso_directory_record *de,
int len;
unsigned char *chr;
CONTINUE_DECLS;
int retnamlen = 0, truncate = 0;
struct rock_ridge *rr;
int sig;
int retnamlen = 0;
int truncate = 0;
if (!ISOFS_SB(inode->i_sb)->s_rock)
return 0;
*retname = 0;
SETUP_ROCK_RIDGE(de, chr, len);
repeat:
{
struct rock_ridge *rr;
int sig;
repeat:
while (len > 2) { /* There may be one byte for padding somewhere */
rr = (struct rock_ridge *)chr;
......@@ -135,13 +135,11 @@ int get_rock_ridge_filename(struct iso_directory_record *de,
* care anyways, since we can just use the non-RR
* name.
*/
if (rr->u.NM.flags & 6) {
if (rr->u.NM.flags & 6)
break;
}
if (rr->u.NM.flags & ~1) {
printk
("Unsupported NM flag settings (%d)\n",
printk("Unsupported NM flag settings (%d)\n",
rr->u.NM.flags);
break;
}
......@@ -160,12 +158,10 @@ int get_rock_ridge_filename(struct iso_directory_record *de,
break;
}
}
}
MAYBE_CONTINUE(repeat, inode);
if (buffer)
kfree(buffer);
return retnamlen; /* If 0, this file did not have a NM field */
out:
out:
if (buffer)
kfree(buffer);
return 0;
......@@ -178,6 +174,11 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
int len;
unsigned char *chr;
int symlink_len = 0;
int cnt, sig;
struct inode *reloc;
struct rock_ridge *rr;
int rootflag;
CONTINUE_DECLS;
if (!ISOFS_SB(inode->i_sb)->s_rock)
......@@ -191,13 +192,7 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
len = 0;
}
repeat:
{
int cnt, sig;
struct inode *reloc;
struct rock_ridge *rr;
int rootflag;
repeat:
while (len > 2) { /* There may be one byte for padding somewhere */
rr = (struct rock_ridge *)chr;
if (rr->len < 3)
......@@ -244,10 +239,13 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
high = isonum_733(rr->u.PN.dev_high);
low = isonum_733(rr->u.PN.dev_low);
/*
* The Rock Ridge standard specifies that if sizeof(dev_t) <= 4,
* then the high field is unused, and the device number is completely
* stored in the low field. Some writers may ignore this subtlety,
* and as a result we test to see if the entire device number is
* The Rock Ridge standard specifies that if
* sizeof(dev_t) <= 4, then the high field is
* unused, and the device number is completely
* stored in the low field. Some writers may
* ignore this subtlety,
* and as a result we test to see if the entire
* device number is
* stored in the low field, and use that.
*/
if ((low & ~0xff) && high == 0) {
......@@ -260,9 +258,13 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
}
break;
case SIG('T', 'F'):
/* Some RRIP writers incorrectly place ctime in the TF_CREATE field.
Try to handle this correctly for either case. */
cnt = 0; /* Rock ridge never appears on a High Sierra disk */
/*
* Some RRIP writers incorrectly place ctime in the
* TF_CREATE field. Try to handle this correctly for
* either case.
*/
/* Rock ridge never appears on a High Sierra disk */
cnt = 0;
if (rr->u.TF.flags & TF_CREATE) {
inode->i_ctime.tv_sec =
iso_date(rr->u.TF.times[cnt++].time,
......@@ -314,15 +316,13 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
inode->i_size += 1;
break;
default:
printk
("Symlink component flag not implemented\n");
printk("Symlink component flag "
"not implemented\n");
}
slen -= slp->len + 2;
oldslp = slp;
slp =
(struct SL_component
*)(((char *)slp) +
slp->len + 2);
slp = (struct SL_component *)
(((char *)slp) + slp->len + 2);
if (slen < 2) {
if (((rr->u.SL.
......@@ -336,7 +336,8 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
}
/*
* If this component record isn't continued, then append a '/'.
* If this component record isn't
* continued, then append a '/'.
*/
if (!rootflag
&& (oldslp->flags & 1) == 0)
......@@ -346,8 +347,8 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
symlink_len = inode->i_size;
break;
case SIG('R', 'E'):
printk(KERN_WARNING
"Attempt to read inode for relocated directory\n");
printk(KERN_WARNING "Attempt to read inode for "
"relocated directory\n");
goto out;
case SIG('C', 'L'):
ISOFS_I(inode)->i_first_extent =
......@@ -371,58 +372,57 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
iput(reloc);
break;
#ifdef CONFIG_ZISOFS
case SIG('Z', 'F'):
if (!ISOFS_SB(inode->i_sb)->s_nocompress) {
case SIG('Z', 'F'): {
int algo;
if (ISOFS_SB(inode->i_sb)->s_nocompress)
break;
algo = isonum_721(rr->u.ZF.algorithm);
if (algo == SIG('p', 'z')) {
int block_shift =
isonum_711(&rr->u.ZF.
parms[1]);
if (block_shift <
PAGE_CACHE_SHIFT
isonum_711(&rr->u.ZF.parms[1]);
if (block_shift < PAGE_CACHE_SHIFT
|| block_shift > 17) {
printk(KERN_WARNING
"isofs: Can't handle ZF block size of 2^%d\n",
printk(KERN_WARNING "isofs: "
"Can't handle ZF block "
"size of 2^%d\n",
block_shift);
} else {
/* Note: we don't change i_blocks here */
ISOFS_I(inode)->
i_file_format =
/*
* Note: we don't change
* i_blocks here
*/
ISOFS_I(inode)->i_file_format =
isofs_file_compressed;
/* Parameters to compression algorithm (header size, block size) */
ISOFS_I(inode)->
i_format_parm[0] =
isonum_711(&rr->u.
ZF.
parms
[0]);
ISOFS_I(inode)->
i_format_parm[1] =
isonum_711(&rr->u.
ZF.
parms
[1]);
/*
* Parameters to compression
* algorithm (header size,
* block size)
*/
ISOFS_I(inode)->i_format_parm[0] =
isonum_711(&rr->u.ZF.parms[0]);
ISOFS_I(inode)->i_format_parm[1] =
isonum_711(&rr->u.ZF.parms[1]);
inode->i_size =
isonum_733(rr->u.ZF.
real_size);
}
} else {
printk(KERN_WARNING
"isofs: Unknown ZF compression algorithm: %c%c\n",
"isofs: Unknown ZF compression "
"algorithm: %c%c\n",
rr->u.ZF.algorithm[0],
rr->u.ZF.algorithm[1]);
}
}
break;
}
#endif
default:
break;
}
}
}
MAYBE_CONTINUE(repeat, inode);
out:
out:
if (buffer)
kfree(buffer);
return 0;
......@@ -553,7 +553,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
SETUP_ROCK_RIDGE(raw_inode, chr, len);
repeat:
repeat:
while (len > 2) { /* There may be one byte for padding somewhere */
rr = (struct rock_ridge *)chr;
if (rr->len < 3)
......@@ -586,7 +586,6 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
}
}
MAYBE_CONTINUE(repeat, inode);
if (buffer)
kfree(buffer);
if (rpnt == link)
......@@ -600,19 +599,19 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
return 0;
/* error exit from macro */
out:
out:
if (buffer)
kfree(buffer);
goto fail;
out_noread:
out_noread:
printk("unable to read i-node block");
goto fail;
out_bad_span:
out_bad_span:
printk("symlink spans iso9660 blocks\n");
fail:
fail:
brelse(bh);
unlock_kernel();
error:
error:
SetPageError(page);
kunmap(page);
unlock_page(page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册