Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

partitions: fix sometimes unreadable partition strings

Fix this garbage happening quite often:

==> sda:
scsi 3:0:0:0: CD-ROM TOSHIBA
==> sda1 sda2 sda3 sda4 <sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
^^^
Uniform CD-ROM driver Revision: 3.20
sr 3:0:0:0: Attached scsi CD-ROM sr0
==> sda5 sda6 sda7 >

Make "sda: sda1 ..." lines actually lines.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alexey Dobriyan and committed by
Linus Torvalds
9c867fbe ecd62691

+136 -72
+20 -15
fs/partitions/acorn.c
··· 45 45 nr_sects = (le32_to_cpu(dr->disc_size_high) << 23) | 46 46 (le32_to_cpu(dr->disc_size) >> 9); 47 47 48 - if (name) 49 - printk(" [%s]", name); 48 + if (name) { 49 + strlcat(state->pp_buf, " [", PAGE_SIZE); 50 + strlcat(state->pp_buf, name, PAGE_SIZE); 51 + strlcat(state->pp_buf, "]", PAGE_SIZE); 52 + } 50 53 put_partition(state, slot, first_sector, nr_sects); 51 54 return dr; 52 55 } ··· 84 81 if (!rr) 85 82 return -1; 86 83 87 - printk(" [RISCiX]"); 84 + strlcat(state->pp_buf, " [RISCiX]", PAGE_SIZE); 88 85 89 86 90 87 if (rr->magic == RISCIX_MAGIC) { 91 88 unsigned long size = nr_sects > 2 ? 2 : nr_sects; 92 89 int part; 93 90 94 - printk(" <"); 91 + strlcat(state->pp_buf, " <", PAGE_SIZE); 95 92 96 93 put_partition(state, slot++, first_sect, size); 97 94 for (part = 0; part < 8; part++) { ··· 100 97 put_partition(state, slot++, 101 98 le32_to_cpu(rr->part[part].start), 102 99 le32_to_cpu(rr->part[part].length)); 103 - printk("(%s)", rr->part[part].name); 100 + strlcat(state->pp_buf, "(", PAGE_SIZE); 101 + strlcat(state->pp_buf, rr->part[part].name, PAGE_SIZE); 102 + strlcat(state->pp_buf, ")", PAGE_SIZE); 104 103 } 105 104 } 106 105 107 - printk(" >\n"); 106 + strlcat(state->pp_buf, " >\n", PAGE_SIZE); 108 107 } else { 109 108 put_partition(state, slot++, first_sect, nr_sects); 110 109 } ··· 136 131 struct linux_part *linuxp; 137 132 unsigned long size = nr_sects > 2 ? 2 : nr_sects; 138 133 139 - printk(" [Linux]"); 134 + strlcat(state->pp_buf, " [Linux]", PAGE_SIZE); 140 135 141 136 put_partition(state, slot++, first_sect, size); 142 137 ··· 144 139 if (!linuxp) 145 140 return -1; 146 141 147 - printk(" <"); 142 + strlcat(state->pp_buf, " <", PAGE_SIZE); 148 143 while (linuxp->magic == cpu_to_le32(LINUX_NATIVE_MAGIC) || 149 144 linuxp->magic == cpu_to_le32(LINUX_SWAP_MAGIC)) { 150 145 if (slot == state->limit) ··· 154 149 le32_to_cpu(linuxp->nr_sects)); 155 150 linuxp ++; 156 151 } 157 - printk(" >"); 152 + strlcat(state->pp_buf, " >", PAGE_SIZE); 158 153 159 154 put_dev_sector(sect); 160 155 return slot; ··· 299 294 break; 300 295 } 301 296 } 302 - printk("\n"); 297 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 303 298 return 1; 304 299 } 305 300 #endif ··· 372 367 return 0; 373 368 } 374 369 375 - printk(" [ICS]"); 370 + strlcat(state->pp_buf, " [ICS]", PAGE_SIZE); 376 371 377 372 for (slot = 1, p = (const struct ics_part *)data; p->size; p++) { 378 373 u32 start = le32_to_cpu(p->start); ··· 406 401 } 407 402 408 403 put_dev_sector(sect); 409 - printk("\n"); 404 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 410 405 return 1; 411 406 } 412 407 #endif ··· 466 461 return 0; 467 462 } 468 463 469 - printk(" [POWERTEC]"); 464 + strlcat(state->pp_buf, " [POWERTEC]", PAGE_SIZE); 470 465 471 466 for (i = 0, p = (const struct ptec_part *)data; i < 12; i++, p++) { 472 467 u32 start = le32_to_cpu(p->start); ··· 477 472 } 478 473 479 474 put_dev_sector(sect); 480 - printk("\n"); 475 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 481 476 return 1; 482 477 } 483 478 #endif ··· 548 543 549 544 size = get_capacity(state->bdev->bd_disk); 550 545 put_partition(state, slot++, start, size - start); 551 - printk("\n"); 546 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 552 547 } 553 548 554 549 return i ? 1 : 0;
+15 -5
fs/partitions/amiga.c
··· 69 69 /* blksize is blocks per 512 byte standard block */ 70 70 blksize = be32_to_cpu( rdb->rdb_BlockBytes ) / 512; 71 71 72 - printk(" RDSK (%d)", blksize * 512); /* Be more informative */ 72 + { 73 + char tmp[7 + 10 + 1 + 1]; 74 + 75 + /* Be more informative */ 76 + snprintf(tmp, sizeof(tmp), " RDSK (%d)", blksize * 512); 77 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 78 + } 73 79 blk = be32_to_cpu(rdb->rdb_PartitionList); 74 80 put_dev_sector(sect); 75 81 for (part = 1; blk>0 && part<=16; part++, put_dev_sector(sect)) { ··· 112 106 { 113 107 /* Be even more informative to aid mounting */ 114 108 char dostype[4]; 109 + char tmp[42]; 110 + 115 111 __be32 *dt = (__be32 *)dostype; 116 112 *dt = pb->pb_Environment[16]; 117 113 if (dostype[3] < ' ') 118 - printk(" (%c%c%c^%c)", 114 + snprintf(tmp, sizeof(tmp), " (%c%c%c^%c)", 119 115 dostype[0], dostype[1], 120 116 dostype[2], dostype[3] + '@' ); 121 117 else 122 - printk(" (%c%c%c%c)", 118 + snprintf(tmp, sizeof(tmp), " (%c%c%c%c)", 123 119 dostype[0], dostype[1], 124 120 dostype[2], dostype[3]); 125 - printk("(res %d spb %d)", 121 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 122 + snprintf(tmp, sizeof(tmp), "(res %d spb %d)", 126 123 be32_to_cpu(pb->pb_Environment[6]), 127 124 be32_to_cpu(pb->pb_Environment[4])); 125 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 128 126 } 129 127 res = 1; 130 128 } 131 - printk("\n"); 129 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 132 130 133 131 rdb_done: 134 132 return res;
+6 -6
fs/partitions/atari.c
··· 62 62 } 63 63 64 64 pi = &rs->part[0]; 65 - printk (" AHDI"); 65 + strlcat(state->pp_buf, " AHDI", PAGE_SIZE); 66 66 for (slot = 1; pi < &rs->part[4] && slot < state->limit; slot++, pi++) { 67 67 struct rootsector *xrs; 68 68 Sector sect2; ··· 81 81 #ifdef ICD_PARTS 82 82 part_fmt = 1; 83 83 #endif 84 - printk(" XGM<"); 84 + strlcat(state->pp_buf, " XGM<", PAGE_SIZE); 85 85 partsect = extensect = be32_to_cpu(pi->st); 86 86 while (1) { 87 87 xrs = read_part_sector(state, partsect, &sect2); ··· 120 120 break; 121 121 } 122 122 } 123 - printk(" >"); 123 + strlcat(state->pp_buf, " >", PAGE_SIZE); 124 124 } 125 125 #ifdef ICD_PARTS 126 126 if ( part_fmt!=1 ) { /* no extended partitions -> test ICD-format */ 127 127 pi = &rs->icdpart[0]; 128 128 /* sanity check: no ICD format if first partition invalid */ 129 129 if (OK_id(pi->id)) { 130 - printk(" ICD<"); 130 + strlcat(state->pp_buf, " ICD<", PAGE_SIZE); 131 131 for (; pi < &rs->icdpart[8] && slot < state->limit; slot++, pi++) { 132 132 /* accept only GEM,BGM,RAW,LNX,SWP partitions */ 133 133 if (!((pi->flg & 1) && OK_id(pi->id))) ··· 137 137 be32_to_cpu(pi->st), 138 138 be32_to_cpu(pi->siz)); 139 139 } 140 - printk(" >"); 140 + strlcat(state->pp_buf, " >", PAGE_SIZE); 141 141 } 142 142 } 143 143 #endif 144 144 put_dev_sector(sect); 145 145 146 - printk ("\n"); 146 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 147 147 148 148 return 1; 149 149 }
+18 -4
fs/partitions/check.c
··· 164 164 state = kzalloc(sizeof(struct parsed_partitions), GFP_KERNEL); 165 165 if (!state) 166 166 return NULL; 167 + state->pp_buf = (char *)__get_free_page(GFP_KERNEL); 168 + if (!state->pp_buf) { 169 + kfree(state); 170 + return NULL; 171 + } 172 + state->pp_buf[0] = '\0'; 167 173 168 174 state->bdev = bdev; 169 175 disk_name(hd, 0, state->name); 170 - printk(KERN_INFO " %s:", state->name); 176 + snprintf(state->pp_buf, PAGE_SIZE, " %s:", state->name); 171 177 if (isdigit(state->name[strlen(state->name)-1])) 172 178 sprintf(state->name, "p"); 173 179 ··· 191 185 } 192 186 193 187 } 194 - if (res > 0) 188 + if (res > 0) { 189 + printk(KERN_INFO "%s", state->pp_buf); 190 + 191 + free_page((unsigned long)state->pp_buf); 195 192 return state; 193 + } 196 194 if (state->access_beyond_eod) 197 195 err = -ENOSPC; 198 196 if (err) 199 197 /* The partition is unrecognized. So report I/O errors if there were any */ 200 198 res = err; 201 199 if (!res) 202 - printk(" unknown partition table\n"); 200 + strlcat(state->pp_buf, " unknown partition table\n", PAGE_SIZE); 203 201 else if (warn_no_part) 204 - printk(" unable to read partition table\n"); 202 + strlcat(state->pp_buf, " unable to read partition table\n", PAGE_SIZE); 203 + 204 + printk(KERN_INFO "%s", state->pp_buf); 205 + 206 + free_page((unsigned long)state->pp_buf); 205 207 kfree(state); 206 208 return ERR_PTR(res); 207 209 }
+5 -1
fs/partitions/check.h
··· 16 16 int next; 17 17 int limit; 18 18 bool access_beyond_eod; 19 + char *pp_buf; 19 20 }; 20 21 21 22 static inline void *read_part_sector(struct parsed_partitions *state, ··· 33 32 put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size) 34 33 { 35 34 if (n < p->limit) { 35 + char tmp[1 + BDEVNAME_SIZE + 10 + 1]; 36 + 36 37 p->parts[n].from = from; 37 38 p->parts[n].size = size; 38 - printk(" %s%d", p->name, n); 39 + snprintf(tmp, sizeof(tmp), " %s%d", p->name, n); 40 + strlcat(p->pp_buf, tmp, PAGE_SIZE); 39 41 } 40 42 } 41 43
+1 -1
fs/partitions/efi.c
··· 630 630 } 631 631 kfree(ptes); 632 632 kfree(gpt); 633 - printk("\n"); 633 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 634 634 return 1; 635 635 }
+11 -6
fs/partitions/ibm.c
··· 75 75 unsigned char *data; 76 76 Sector sect; 77 77 sector_t labelsect; 78 + char tmp[64]; 78 79 79 80 res = 0; 80 81 blocksize = bdev_logical_block_size(bdev); ··· 145 144 */ 146 145 blocksize = label->cms.block_size; 147 146 if (label->cms.disk_offset != 0) { 148 - printk("CMS1/%8s(MDSK):", name); 147 + snprintf(tmp, sizeof(tmp), "CMS1/%8s(MDSK):", name); 148 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 149 149 /* disk is reserved minidisk */ 150 150 offset = label->cms.disk_offset; 151 151 size = (label->cms.block_count - 1) 152 152 * (blocksize >> 9); 153 153 } else { 154 - printk("CMS1/%8s:", name); 154 + snprintf(tmp, sizeof(tmp), "CMS1/%8s:", name); 155 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 155 156 offset = (info->label_block + 1); 156 157 size = label->cms.block_count 157 158 * (blocksize >> 9); ··· 162 159 size-offset*(blocksize >> 9)); 163 160 } else { 164 161 if (strncmp(type, "LNX1", 4) == 0) { 165 - printk("LNX1/%8s:", name); 162 + snprintf(tmp, sizeof(tmp), "LNX1/%8s:", name); 163 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 166 164 if (label->lnx.ldl_version == 0xf2) { 167 165 fmt_size = label->lnx.formatted_blocks 168 166 * (blocksize >> 9); ··· 182 178 offset = (info->label_block + 1); 183 179 } else { 184 180 /* unlabeled disk */ 185 - printk("(nonl)"); 181 + strlcat(tmp, sizeof(tmp), "(nonl)", PAGE_SIZE); 186 182 size = i_size >> 9; 187 183 offset = (info->label_block + 1); 188 184 } ··· 201 197 * if not, something is wrong, skipping partition detection 202 198 */ 203 199 if (strncmp(type, "VOL1", 4) == 0) { 204 - printk("VOL1/%8s:", name); 200 + snprintf(tmp, sizeof(tmp), "VOL1/%8s:", name); 201 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 205 202 /* 206 203 * get block number and read then go through format1 207 204 * labels ··· 258 253 259 254 } 260 255 261 - printk("\n"); 256 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 262 257 goto out_freeall; 263 258 264 259
+1 -1
fs/partitions/karma.c
··· 50 50 } 51 51 slot++; 52 52 } 53 - printk("\n"); 53 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 54 54 put_dev_sector(sect); 55 55 return 1; 56 56 }
+2 -2
fs/partitions/ldm.c
··· 643 643 return false; 644 644 } 645 645 646 - printk (" [LDM]"); 646 + strlcat(pp->pp_buf, " [LDM]", PAGE_SIZE); 647 647 648 648 /* Create the data partitions */ 649 649 list_for_each (item, &ldb->v_part) { ··· 658 658 part_num++; 659 659 } 660 660 661 - printk ("\n"); 661 + strlcat(pp->pp_buf, "\n", PAGE_SIZE); 662 662 return true; 663 663 } 664 664
+2 -2
fs/partitions/mac.c
··· 59 59 put_dev_sector(sect); 60 60 return 0; /* not a MacOS disk */ 61 61 } 62 - printk(" [mac]"); 62 + strlcat(state->pp_buf, " [mac]", PAGE_SIZE); 63 63 blocks_in_map = be32_to_cpu(part->map_count); 64 64 for (blk = 1; blk <= blocks_in_map; ++blk) { 65 65 int pos = blk * secsize; ··· 128 128 #endif 129 129 130 130 put_dev_sector(sect); 131 - printk("\n"); 131 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 132 132 return 1; 133 133 }
+45 -22
fs/partitions/msdos.c
··· 213 213 put_dev_sector(sect); 214 214 return; 215 215 } 216 - printk(" %s%d: <solaris:", state->name, origin); 216 + { 217 + char tmp[1 + BDEVNAME_SIZE + 10 + 11 + 1]; 218 + 219 + snprintf(tmp, sizeof(tmp), " %s%d: <solaris:", state->name, origin); 220 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 221 + } 217 222 if (le32_to_cpu(v->v_version) != 1) { 218 - printk(" cannot handle version %d vtoc>\n", 219 - le32_to_cpu(v->v_version)); 223 + char tmp[64]; 224 + 225 + snprintf(tmp, sizeof(tmp), " cannot handle version %d vtoc>\n", 226 + le32_to_cpu(v->v_version)); 227 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 220 228 put_dev_sector(sect); 221 229 return; 222 230 } ··· 232 224 max_nparts = le16_to_cpu (v->v_nparts) > 8 ? SOLARIS_X86_NUMSLICE : 8; 233 225 for (i=0; i<max_nparts && state->next<state->limit; i++) { 234 226 struct solaris_x86_slice *s = &v->v_slice[i]; 227 + char tmp[3 + 10 + 1 + 1]; 228 + 235 229 if (s->s_size == 0) 236 230 continue; 237 - printk(" [s%d]", i); 231 + snprintf(tmp, sizeof(tmp), " [s%d]", i); 232 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 238 233 /* solaris partitions are relative to current MS-DOS 239 234 * one; must add the offset of the current partition */ 240 235 put_partition(state, state->next++, ··· 245 234 le32_to_cpu(s->s_size)); 246 235 } 247 236 put_dev_sector(sect); 248 - printk(" >\n"); 237 + strlcat(state->pp_buf, " >\n", PAGE_SIZE); 249 238 #endif 250 239 } 251 240 ··· 261 250 Sector sect; 262 251 struct bsd_disklabel *l; 263 252 struct bsd_partition *p; 253 + char tmp[64]; 264 254 265 255 l = read_part_sector(state, offset + 1, &sect); 266 256 if (!l) ··· 270 258 put_dev_sector(sect); 271 259 return; 272 260 } 273 - printk(" %s%d: <%s:", state->name, origin, flavour); 261 + 262 + snprintf(tmp, sizeof(tmp), " %s%d: <%s:", state->name, origin, flavour); 263 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 274 264 275 265 if (le16_to_cpu(l->d_npartitions) < max_partitions) 276 266 max_partitions = le16_to_cpu(l->d_npartitions); ··· 289 275 /* full parent partition, we have it already */ 290 276 continue; 291 277 if (offset > bsd_start || offset+size < bsd_start+bsd_size) { 292 - printk("bad subpartition - ignored\n"); 278 + strlcat(state->pp_buf, "bad subpartition - ignored\n", PAGE_SIZE); 293 279 continue; 294 280 } 295 281 put_partition(state, state->next++, bsd_start, bsd_size); 296 282 } 297 283 put_dev_sector(sect); 298 - if (le16_to_cpu(l->d_npartitions) > max_partitions) 299 - printk(" (ignored %d more)", 300 - le16_to_cpu(l->d_npartitions) - max_partitions); 301 - printk(" >\n"); 284 + if (le16_to_cpu(l->d_npartitions) > max_partitions) { 285 + snprintf(tmp, sizeof(tmp), " (ignored %d more)", 286 + le16_to_cpu(l->d_npartitions) - max_partitions); 287 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 288 + } 289 + strlcat(state->pp_buf, " >\n", PAGE_SIZE); 302 290 } 303 291 #endif 304 292 ··· 349 333 put_dev_sector(sect); 350 334 return; 351 335 } 352 - printk(" %s%d: <unixware:", state->name, origin); 336 + { 337 + char tmp[1 + BDEVNAME_SIZE + 10 + 12 + 1]; 338 + 339 + snprintf(tmp, sizeof(tmp), " %s%d: <unixware:", state->name, origin); 340 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 341 + } 353 342 p = &l->vtoc.v_slice[1]; 354 343 /* I omit the 0th slice as it is the same as whole disk. */ 355 344 while (p - &l->vtoc.v_slice[0] < UNIXWARE_NUMSLICE) { ··· 368 347 p++; 369 348 } 370 349 put_dev_sector(sect); 371 - printk(" >\n"); 350 + strlcat(state->pp_buf, " >\n", PAGE_SIZE); 372 351 #endif 373 352 } 374 353 ··· 397 376 * the normal boot sector. */ 398 377 if (msdos_magic_present (data + 510) && 399 378 SYS_IND(p) == MINIX_PARTITION) { /* subpartition table present */ 379 + char tmp[1 + BDEVNAME_SIZE + 10 + 9 + 1]; 400 380 401 - printk(" %s%d: <minix:", state->name, origin); 381 + snprintf(tmp, sizeof(tmp), " %s%d: <minix:", state->name, origin); 382 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 402 383 for (i = 0; i < MINIX_NR_SUBPARTITIONS; i++, p++) { 403 384 if (state->next == state->limit) 404 385 break; ··· 409 386 put_partition(state, state->next++, 410 387 start_sect(p), nr_sects(p)); 411 388 } 412 - printk(" >\n"); 389 + strlcat(state->pp_buf, " >\n", PAGE_SIZE); 413 390 } 414 391 put_dev_sector(sect); 415 392 #endif /* CONFIG_MINIX_SUBPARTITION */ ··· 448 425 449 426 if (aix_magic_present(state, data)) { 450 427 put_dev_sector(sect); 451 - printk( " [AIX]"); 428 + strlcat(state->pp_buf, " [AIX]", PAGE_SIZE); 452 429 return 0; 453 430 } 454 431 ··· 469 446 fb = (struct fat_boot_sector *) data; 470 447 if (slot == 1 && fb->reserved && fb->fats 471 448 && fat_valid_media(fb->media)) { 472 - printk("\n"); 449 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 473 450 put_dev_sector(sect); 474 451 return 1; 475 452 } else { ··· 514 491 n = min(size, max(sector_size, n)); 515 492 put_partition(state, slot, start, n); 516 493 517 - printk(" <"); 494 + strlcat(state->pp_buf, " <", PAGE_SIZE); 518 495 parse_extended(state, start, size); 519 - printk(" >"); 496 + strlcat(state->pp_buf, " >", PAGE_SIZE); 520 497 continue; 521 498 } 522 499 put_partition(state, slot, start, size); 523 500 if (SYS_IND(p) == LINUX_RAID_PARTITION) 524 501 state->parts[slot].flags = ADDPART_FLAG_RAID; 525 502 if (SYS_IND(p) == DM6_PARTITION) 526 - printk("[DM]"); 503 + strlcat(state->pp_buf, "[DM]", PAGE_SIZE); 527 504 if (SYS_IND(p) == EZD_PARTITION) 528 - printk("[EZD]"); 505 + strlcat(state->pp_buf, "[EZD]", PAGE_SIZE); 529 506 } 530 507 531 - printk("\n"); 508 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 532 509 533 510 /* second pass - output for each on a separate line */ 534 511 p = (struct partition *) (0x1be + data);
+1 -1
fs/partitions/osf.c
··· 72 72 le32_to_cpu(partition->p_size)); 73 73 slot++; 74 74 } 75 - printk("\n"); 75 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 76 76 put_dev_sector(sect); 77 77 return 1; 78 78 }
+1 -1
fs/partitions/sgi.c
··· 76 76 } 77 77 slot++; 78 78 } 79 - printk("\n"); 79 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 80 80 put_dev_sector(sect); 81 81 return 1; 82 82 }
+1 -1
fs/partitions/sun.c
··· 116 116 } 117 117 slot++; 118 118 } 119 - printk("\n"); 119 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 120 120 put_dev_sector(sect); 121 121 return 1; 122 122 }
+6 -3
fs/partitions/sysv68.c
··· 54 54 unsigned char *data; 55 55 struct dkblk0 *b; 56 56 struct slice *slice; 57 + char tmp[64]; 57 58 58 59 data = read_part_sector(state, 0, &sect); 59 60 if (!data) ··· 74 73 return -1; 75 74 76 75 slices -= 1; /* last slice is the whole disk */ 77 - printk("sysV68: %s(s%u)", state->name, slices); 76 + snprintf(tmp, sizeof(tmp), "sysV68: %s(s%u)", state->name, slices); 77 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 78 78 slice = (struct slice *)data; 79 79 for (i = 0; i < slices; i++, slice++) { 80 80 if (slot == state->limit) ··· 84 82 put_partition(state, slot, 85 83 be32_to_cpu(slice->blkoff), 86 84 be32_to_cpu(slice->nblocks)); 87 - printk("(s%u)", i); 85 + snprintf(tmp, sizeof(tmp), "(s%u)", i); 86 + strlcat(state->pp_buf, tmp, PAGE_SIZE); 88 87 } 89 88 slot++; 90 89 } 91 - printk("\n"); 90 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 92 91 put_dev_sector(sect); 93 92 return 1; 94 93 }
+1 -1
fs/partitions/ultrix.c
··· 39 39 label->pt_part[i].pi_blkoff, 40 40 label->pt_part[i].pi_nblocks); 41 41 put_dev_sector(sect); 42 - printk ("\n"); 42 + strlcat(state->pp_buf, "\n", PAGE_SIZE); 43 43 return 1; 44 44 } else { 45 45 put_dev_sector(sect);