From patchwork Fri May 3 20:16:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinar Valeev X-Patchwork-Id: 241373 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 7E3022C011D for ; Sat, 4 May 2013 06:16:51 +1000 (EST) Received: from mail-ob0-x235.google.com (mail-ob0-x235.google.com [IPv6:2607:f8b0:4003:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 7166A2C00DA for ; Sat, 4 May 2013 06:16:49 +1000 (EST) Received: by mail-ob0-f181.google.com with SMTP id ta14so1765079obb.12 for ; Fri, 03 May 2013 13:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:from:date:x-google-sender-auth :message-id:subject:to:cc:content-type; bh=HFHZK5I3AxsddiED3Hf4lIMhrate7i+b0ey+WC4sqKg=; b=XSRlK+WdnhHFGOGCF9GQXM68X7RCP4woczsjct+P8KkbUXFWFZkqrEQin0Ep962XSP YldIc7vb2mHB4YYaLsGvEajy7cIsrZkFwUisQy3gzV3LU4r5zjAK776ZN3WebH/ia2t1 yGzVYN0XM2fmpEnGehB6ZUg7Z7wOXPSi3zAuGMYp6ubNYl2YVHzeYXHayveF4NPRLncp GGAY0WGufTZV4S62L82xI4kh/iPQ4aPITf9fPZPhpMloxBqVQgjZiODFOrbXXH5sg+Hg 0lqx/E48ggVwUwRnWk5GQgT4vm/J9kS2yKdu/3ITlCYPpIhKQV8vsgXT2OzyD1EskrU3 UQ/A== X-Received: by 10.60.141.35 with SMTP id rl3mr3295040oeb.121.1367612204513; Fri, 03 May 2013 13:16:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.137.166 with HTTP; Fri, 3 May 2013 13:16:24 -0700 (PDT) From: Dinar Valeev Date: Fri, 3 May 2013 22:16:24 +0200 X-Google-Sender-Auth: zWYa2GiWw2dB-RPaIoAZKQZws4I Message-ID: Subject: [PATCH] Fix partitions bigger than 2TB To: yaboot-devel@lists.ozlabs.org Cc: Tony Breeds X-BeenThere: yaboot-devel@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Yaboot-devel" Partitions which are bigger than 2TB doesn't fit unsigned long, change it ot unsigned long long. --- include/partition.h | 4 ++-- second/file.c | 2 +- second/partition.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) unsigned short part_blocksize, int sys_ind) { struct partition_t* part; @@ -452,7 +452,7 @@ get_part_type(char *device, int partition) return '\0'; for (p = parts; p && !found; p=p->next) { - DEBUG_F("number: %02d, start: 0x%08lx, length: 0x%08lx, type: %s, name: %s\n", + DEBUG_F("number: %02d, start: 0x%08Lx, length: 0x%08Lx, type: %s, name: %s\n", p->part_number, p->part_start, p->part_size, p->part_type, p->part_name); if ((partition >= 0) && (partition == p->part_number)) { type = strdup(p->part_type); -- 1.8.1.4 diff --git a/include/partition.h b/include/partition.h index 23c99ba..c9c4d0b 100644 --- a/include/partition.h +++ b/include/partition.h @@ -37,8 +37,8 @@ struct partition_t { int part_number; char part_type[MAX_PART_NAME]; char part_name[MAX_PART_NAME]; - unsigned long part_start; /* In blocks */ - unsigned long part_size; /* In blocks */ + unsigned long long part_start; /* In blocks */ + unsigned long long part_size; /* In blocks */ unsigned short blocksize; int sys_ind; /* fs type */ }; diff --git a/second/file.c b/second/file.c index fd081a3..a276a72 100644 --- a/second/file.c +++ b/second/file.c @@ -582,7 +582,7 @@ file_block_open( struct boot_file_t* file, prom_printf("no partitions found.\n"); #endif for (p = parts; p && !found; p=p->next) { - DEBUG_F("number: %02d, start: 0x%08lx, length: 0x%08lx\n", + DEBUG_F("number: %02d, start: 0x%08Lx, length: 0x%08Lx\n", p->part_number, p->part_start, p->part_size ); if (partition == -1) { file->fs = fs_open( file, p, fspec ); diff --git a/second/partition.c b/second/partition.c index f5be637..6f94722 100644 --- a/second/partition.c +++ b/second/partition.c @@ -68,7 +68,7 @@ static unsigned char block_buffer[MAX_BLOCK_SIZE]; static void add_new_partition(struct partition_t** list, int part_number, const char *part_type, - const char *part_name, unsigned long part_start, unsigned long part_size, + const char *part_name, unsigned long long part_start, unsigned long long part_size,