Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fa393a1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

[PATCH] rock: manual tidies



Fix stuff which Lindent got wrong, rework a few deeply-nested blocks.

Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1d372116
Loading
Loading
Loading
Loading
+285 −286
Original line number Diff line number Diff line
@@ -90,7 +90,10 @@ 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;
@@ -98,9 +101,6 @@ int get_rock_ridge_filename(struct iso_directory_record *de,

	SETUP_ROCK_RIDGE(de, chr, len);
repeat:
	{
		struct rock_ridge *rr;
		int sig;

	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,9 +158,7 @@ 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:
@@ -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)
@@ -192,12 +193,6 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
	}

repeat:
	{
		int cnt, sig;
		struct inode *reloc;
		struct rock_ridge *rr;
		int rootflag;

	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,56 +372,55 @@ 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:
	if (buffer)
@@ -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)